<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [TAGGEDPDF] Expose the structure tree and attributes in poppler-glib"
href="https://bugs.freedesktop.org/show_bug.cgi?id=64821#c51">Comment # 51</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [TAGGEDPDF] Expose the structure tree and attributes in poppler-glib"
href="https://bugs.freedesktop.org/show_bug.cgi?id=64821">bug 64821</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=90261" name="attach_90261" title="[PATCH v12 04/11] glib: Expose the document structure tree">attachment 90261</a> <a href="attachment.cgi?id=90261&action=edit" title="[PATCH v12 04/11] glib: Expose the document structure tree">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=64821&attachment=90261'>[review]</a>
[PATCH v12 04/11] glib: Expose the document structure tree
Review of <span class=""><a href="attachment.cgi?id=90261" name="attach_90261" title="[PATCH v12 04/11] glib: Expose the document structure tree">attachment 90261</a> <a href="attachment.cgi?id=90261&action=edit" title="[PATCH v12 04/11] glib: Expose the document structure tree">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=64821&attachment=90261'>[review]</a>:
-----------------------------------------------------------------
::: glib/poppler-structure-element.cc
@@ +44,5 @@
<span class="quote">> + * and poppler_structure_get_child() to enumerate the top level elements.
> + */
> +
> +static PopplerStructureElement *
> + _poppler_structure_element_new (PopplerDocument *document, StructElement *element);</span >
You should move the iter implementation to the bottom of the file and we don't
need this prototype here.
@@ +139,5 @@
<span class="quote">> + * poppler_structure_element_iter_free (iter);
> + * }
> + * </programlisting></informalexample>
> + *
> + * Return value: (transfer full): a new #PopplerStructureElementIter</span >
, or %NULL if ....
@@ +417,5 @@
<span class="quote">> +PopplerStructureElementKind
> +poppler_structure_element_get_kind (PopplerStructureElement *poppler_structure_element)
> +{
> + g_return_val_if_fail (POPPLER_IS_STRUCTURE_ELEMENT (poppler_structure_element), POPPLER_STRUCTURE_ELEMENT_UNKNOWN);
> + g_assert (poppler_structure_element->elem);</span >
Use g_return macros in public methods.
@@ +419,5 @@
<span class="quote">> +{
> + g_return_val_if_fail (POPPLER_IS_STRUCTURE_ELEMENT (poppler_structure_element), POPPLER_STRUCTURE_ELEMENT_UNKNOWN);
> + g_assert (poppler_structure_element->elem);
> +
> + return _poppler_structelement_type_to_poppler_structure_element_kind (poppler_structure_element->elem->getType ());</span >
This method is only used here, I think we can add th switch here instead.
@@ +436,5 @@
<span class="quote">> + */
> +gint
> +poppler_structure_element_get_page (PopplerStructureElement *poppler_structure_element)
> +{
> + g_return_val_if_fail (POPPLER_IS_STRUCTURE_ELEMENT (poppler_structure_element), POPPLER_STRUCTURE_ELEMENT_UNKNOWN);</span >
POPPLER_STRUCTURE_ELEMENT_UNKNOWN -> -1
@@ +454,5 @@
<span class="quote">> + * @poppler_structure_element: A #PopplerStructureElement
> + *
> + * Checks whether an element is actual document content.
> + *
> + * Return value: Whether the element is content.</span >
%TRUE if ..., %FALSE otherwise. And this pattern in all other methods.
@@ +524,5 @@
<span class="quote">> + g_assert (poppler_structure_element->elem);
> +
> + GooString *string = poppler_structure_element->elem->getID ();
> + gchar *result = string ? _poppler_goo_string_to_utf8 (string) : NULL;
> + delete string;</span >
getID() doesn't copy the string
@@ +546,5 @@
<span class="quote">> + g_assert (poppler_structure_element->elem);
> +
> + GooString *string = poppler_structure_element->elem->getTitle ();
> + gchar *result = string ? _poppler_goo_string_to_utf8 (string) : NULL;
> + delete string;</span >
Ditto.
@@ +574,5 @@
<span class="quote">> + return NULL;
> +
> + GooString *string = poppler_structure_element->elem->getExpandedAbbr ();
> + gchar *result = string ? _poppler_goo_string_to_utf8 (string) : NULL;
> + delete string;</span >
Ditto.
@@ +598,5 @@
<span class="quote">> + g_assert (poppler_structure_element->elem);
> +
> + GooString *string = poppler_structure_element->elem->getLanguage ();
> + gchar *result = string ? _poppler_goo_string_to_utf8 (string) : NULL;
> + delete string;</span >
Ditto.
@@ +626,5 @@
<span class="quote">> + g_assert (poppler_structure_element->elem);
> +
> + GooString *string = poppler_structure_element->elem->getAltText ();
> + gchar *result = string ? _poppler_goo_string_to_utf8 (string) : NULL;
> + delete string;</span >
Ditto.
@@ +656,5 @@
<span class="quote">> + g_assert (poppler_structure_element->elem);
> +
> + GooString *string = poppler_structure_element->elem->getActualText ();
> + gchar *result = string ? _poppler_goo_string_to_utf8 (string) : NULL;
> + delete string;</span >
Ditto.
::: glib/reference/poppler-docs.sgml
@@ +23,5 @@
<span class="quote">> <xi:include href="xml/poppler-layer.xml"/>
> <xi:include href="xml/poppler-media.xml"/>
> <xi:include href="xml/poppler-movie.xml"/>
> + <xi:include href="xml/poppler-structure.xml"/>
> + <xi:include href="xml/poppler-structure-element.xml"/></span >
Bad indentation here.</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>