[poppler] Form-Reset and Print [patches]

Carlos Garcia Campos carlosgc at gnome.org
Sun Jun 13 01:21:35 PDT 2010


Excerpts from Guillermo Amaral's message of dom jun 13 04:40:44 +0200 2010:
> Albert Astals Cid <aacid at kde.org> wrote:
> > A Dissabte, 12 de juny de 2010, Guillermo Amaral va escriure:
> >> 
> >> I wanted to send in these patches, they allow handling of reset-form and
> >> print actions respectably.
> >> 
> >> Please check them out, and if you have any questions please don't hesitate
> >> to ask.
> > 
> > Do you have a document that uses them?
> 
>   I do, but I dunno if I can share them ATM, looking into it.
>   But I did make a test pdf that uses both features. :-)
> 
> > Also what is the point of
> > 
> > +  } else if (obj2.isName("ResetForm")) {
> > +    action = new LinkResetForm(obj2.getName());
> 
>   As usual, you are right aacid :) I try a little to hard not to break the
>   flow of other programs, I think I went to far lol (fixed)
> 
> > And 
> > if (obj->dictLookup("AA", &tmp)->isDict())
> > seems like an unrelated fix, can you please explain it too?
> 
>   Mixed them up, that one should be in the print patch (moved). Sometimes the
>   AA dict is used to hold a ref to the named object. I have seen it in two docs so
>   far, it seems to happen when people set an action to happen on mouse down
>   instead of mouse up. It should not break anything else (as far as I can see).
> 

We should definitely add support for additional actions properly in
poppler. 

> diff --git a/poppler/Link.cc b/poppler/Link.cc
> index 5d7b779..e3d6ce7 100644
> --- a/poppler/Link.cc
> +++ b/poppler/Link.cc
> @@ -124,6 +124,10 @@ LinkAction *LinkAction::parseAction(Object *obj, GooString *baseURI) {
>    } else if (obj2.isName("SetOCGState")) {
>      action = new LinkOCGState(obj);
>  
> +  // ResetForm action
> +  } else if (obj2.isName("ResetForm")) {
> +    action = new LinkResetForm();
> +
>    // unknown action
>    } else if (obj2.isName()) {
>      action = new LinkUnknown(obj2.getName());
> @@ -856,6 +860,18 @@ LinkOCGState::StateList::~StateList() {
>  }
>  
>  //------------------------------------------------------------------------
> +// LinkFormClear
> +//------------------------------------------------------------------------
> +
> +LinkResetForm::LinkResetForm() {
> +  action = new GooString("ResetForm");

this is redundant, you already know it's a LinkResetForm object. You
should parse Fields and Flags here. 

Regards, 
-- 
Carlos Garcia Campos
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20100613/be547e8b/attachment.pgp>


More information about the poppler mailing list