[poppler] [PATCH] Annotation removal improvements
Fabio D'Urso
fabiodurso at hotmail.it
Mon May 21 15:44:26 PDT 2012
On Sunday, May 20, 2012 07:04:45 PM Fabio D'Urso wrote:
> On Sunday, May 20, 2012 12:27:52 PM Carlos Garcia Campos wrote:
> > Why doesn't Page::removeAnnot() also remove the appearances? I've
> > noticed that the qt4 implementation removes the popup and appearances
> > manually. [...]
> > What happens with all other objects referenced by annotations? I guess
> > they are all left in the document, should we remove them too? like the
> > appearances? [...]
> > Maybe we could add a Annot::removeAnnotFromPage (or something like
> > that) so that every annotation can implement it to remove the objects
> > it references and not referenced by others.
The attached patch defines a virtual Annot::removeReferencedObjects method
that each annotation type can reimplement. The base implementation takes
care of removing the appearance stream. The AnnotMarkup implementation
takes care of removing the popup too.
> I have some doubts about setting /P if the annotation has no /P or a wrong
> value, because that would mean that annotations are automatically modified
> as soon as the document is loaded.
This patch implements the following behavior:
- When parsing existing annotations, /P is ignored and the in-memory
page field is always set to the page which the annotation was read
from (without setting or changing the actual /P value).
- When adding a new annotation to a given page, /P is set accordingly.
Fabio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-Annot-removeReferencedObjects-Always-set-annot.patch
Type: text/x-patch
Size: 7296 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20120522/e939c26d/attachment.bin>
More information about the poppler
mailing list