[Poppler-bugs] [Bug 64821] [TAGGEDPDF] Expose the structure tree and attributes in poppler-glib

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Nov 5 00:23:47 PST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=64821

--- Comment #28 from Carlos Garcia Campos <carlosgc at gnome.org> ---
Comment on attachment 86685
  --> https://bugs.freedesktop.org/attachment.cgi?id=86685
[PATCH v8 12/15] glib: Accessors for form fields of structure elements

Review of attachment 86685:
-----------------------------------------------------------------

New public symbols should be added to the sections.txt file

::: glib/poppler-structure-element.cc
@@ +859,5 @@
> +
> +/**
> + * poppler_structure_element_get_form_field:
> + * @poppler_structure_element: A #PopplerStructureElement
> + *

You should add a brief explanation here.

@@ +862,5 @@
> + * @poppler_structure_element: A #PopplerStructureElement
> + *
> + * Return value: (transfer full): A #PopplerFormField, or %NULL if
> + *    the element is not a %POPPLER_STRUCTURE_ELEMENT_FORM.
> + */

Since: 0.26.

@@ +880,5 @@
> +    return NULL;
> +
> +  gint field_id = -1;
> +  const StructElement *child = poppler_structure_element->elem->getElement (0);
> +  if (child->isContent ())

You can return early here to simplify the return below.

@@ +896,5 @@
> +
> +  if (field_id < 0)
> +    return NULL;
> +
> +  return (field_id < 0) ? NULL : poppler_document_get_form_field (poppler_structure_element->document,

You have already returned in the previous if when field_id < 0.

@@ +903,5 @@
> +
> +/**
> + * poppler_structure_element_get_form_field_mapping:
> + * @poppler_structure_element: a #PopplerStructureElement
> + *

Description.

@@ +906,5 @@
> + * @poppler_structure_element: a #PopplerStructureElement
> + *
> + * Return value: (transfer full): A #PopplerFormFieldMapping, or %NULL if
> + *    the element is not a %POPPLER_STRUCTURE_ELEMENT_FORM
> + */

Since: 0.26

::: glib/poppler-structure-element.h
@@ +118,4 @@
>                                                                                     gboolean                  recursive);
>  const gchar                 *poppler_structure_element_get_alt_text               (PopplerStructureElement  *poppler_structure_element);
>  const gchar                 *poppler_structure_element_get_actual_text            (PopplerStructureElement  *poppler_structure_element);
> +PopplerFormField            *poppler_structure_element_get_form_field             (PopplerStructureElement  *poppler_structure_element);

This is not correctly indented.

@@ +118,5 @@
>                                                                                     gboolean                  recursive);
>  const gchar                 *poppler_structure_element_get_alt_text               (PopplerStructureElement  *poppler_structure_element);
>  const gchar                 *poppler_structure_element_get_actual_text            (PopplerStructureElement  *poppler_structure_element);
> +PopplerFormField            *poppler_structure_element_get_form_field             (PopplerStructureElement  *poppler_structure_element);
> +PopplerFormFieldMapping     *poppler_structure_element_get_form_field_mapping     (PopplerStructureElement  *poppler_structure_element);

Ditto.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20131105/26c63845/attachment.html>


More information about the Poppler-bugs mailing list