<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Missing functions for setting document's properties"
href="https://bugs.freedesktop.org/show_bug.cgi?id=36653#c46">Comment # 46</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Missing functions for setting document's properties"
href="https://bugs.freedesktop.org/show_bug.cgi?id=36653">bug 36653</a>
from <span class="vcard"><a class="email" href="mailto:carlosgc@gnome.org" title="Carlos Garcia Campos <carlosgc@gnome.org>"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=124573" name="attach_124573" title="[PATCH 2/7] Added DocInfo setters & getters">attachment 124573</a> <a href="attachment.cgi?id=124573&action=edit" title="[PATCH 2/7] Added DocInfo setters & getters">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=36653&attachment=124573'>[review]</a>
[PATCH 2/7] Added DocInfo setters & getters
Review of <span class=""><a href="attachment.cgi?id=124573" name="attach_124573" title="[PATCH 2/7] Added DocInfo setters & getters">attachment 124573</a> <a href="attachment.cgi?id=124573&action=edit" title="[PATCH 2/7] Added DocInfo setters & getters">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=36653&attachment=124573'>[review]</a>:
-----------------------------------------------------------------
Looks good to me, I have only a couple of comments, but to not delay this more
I'll push a modified patch with my comments addressed.
::: poppler/PDFDoc.cc
@@ +655,5 @@
<span class="quote">> +
> + GooString *result;
> +
> + if (entryObj.isString()) {
> + result = new GooString(entryObj.getString());</span >
As I suggested in a previous review, we can save the allocation here, by using
GooString::takeString().
::: poppler/PDFDoc.h
@@ +234,5 @@
<span class="quote">>
> + // Create and return the document's Info dictionary if none exists.
> + // Otherwise return the existing one.
> + Object *createDocInfoIfNoneExists(Object *obj) { return xref->createDocInfoIfNoneExists(obj); }
> + Object *createDocInfoIfNoneExistsNF(Object *obj) { return xref->createDocInfoIfNoneExistsNF(obj); }</span >
This doesn't seem to be used anywhere, I prefer to not add dead code, if we
eventually need this we can just add it.
::: poppler/XRef.cc
@@ +1312,5 @@
<span class="quote">> +
> + return obj;
> +}
> +
> +Object *XRef::createDocInfoIfNoneExistsNF(Object *obj) {</span >
Ditto.
@@ +1338,5 @@
<span class="quote">> +}
> +
> +void XRef::removeDocInfo() {
> + Object infoObjRef;
> + getDocInfoNF(&infoObjRef);</span >
Since this is public in the end, we should check that it's not null.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>