[Poppler-bugs] [Bug 89136] Annotations of /Subtype /Popup are not added to /Annots array of a page

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Feb 15 08:02:08 PST 2015


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

--- Comment #9 from Carlos Garcia Campos <carlosgc at gnome.org> ---
Comment on attachment 113476
  --> https://bugs.freedesktop.org/attachment.cgi?id=113476
Alternative fix if done in poppler core

Review of attachment 113476:
-----------------------------------------------------------------

The commit message doesn't seem to be correctly formatted. Thanks for the
patch.

::: poppler/Annot.cc
@@ +2095,5 @@
> +  // dangling references to it.
> +  if (popup != NULL && popup->getPageNum() != 0) {
> +    Page *pageobj = popup->getDoc()->getPage(popup->getPageNum());
> +    if (pageobj) {
> +      pageobj->removeAnnot(popup);

Maybe we could reuse the existing object, instead of remove + add new.

@@ +2114,5 @@
> +    // If this annotation is already added to a page, then we
> +    // add the new popup annotation to the same page.
> +    if (page != 0) {
> +      Page *pageobj = doc->getPage(page);
> +      if (pageobj) {

This should be an error, so we should either add an assert() instead of add an
error message when this happens.

::: poppler/Page.cc
@@ +444,2 @@
>  
>    annots->appendAnnot(annot);

We ignore popup annots associated to a markup annotation in the list of annots,
so here, I would check if the newly added is a popup annot associated to a
markup annotation (you could simply check if it has parent), to not call
annots->appendAnnot()

@@ +449,5 @@
> +  if (annot_markup) {
> +    AnnotPopup *annot_popup = annot_markup->getPopup();
> +    if (annot_popup) {
> +      this->addAnnot(annot_popup);
> +    }

I don't think we need this. If a new markup annotation is created with a popup,
setPopup will be called at some point, so we don't need to add the popup when
the markup annot itself is added.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20150215/af5e9bfa/attachment.html>


More information about the Poppler-bugs mailing list