[poppler] Form Reset Patches
Albert Astals Cid
aacid at kde.org
Mon Aug 29 13:25:01 PDT 2011
A Dilluns, 29 d'agost de 2011, Carlos Garcia Campos vàreu escriure:
> Excerpts from Albert Astals Cid's message of dom ago 28 22:18:45 +0200 2011:
> > A Diumenge, 28 d'agost de 2011, vàreu escriure:
> > > Excerpts from Albert Astals Cid's message of jue ago 25 02:12:07 +0200
2011:
> > > > More than a year ago Guillermo Amaral posted some patches for
> > > > enabling form reset, i've reworked them to the final
> > > > requirements Carlos and I gave.
> > > >
> > > > I've integrated them + a Okular patch and it "works for me" but
> > > > I'd like a review before commiting to master.
> > >
> > > How do you reset the forms in okular? Reset action affects the
> > > document, not only the view.
> > >
> > > "Upon invocation of a reset-form action, a conforming processor
> > > shall
> > > reset selected interactive form fields to their default values; that
> > > is, it shall set the value of the V entry in the field dictionary to
> > > that of the DV entry (see Table 220). If no default value is defined
> > > for a field, its V entry shall be removed"
> >
> > We do it wrongly :D
> >
> > > So, I guess we should add FormField::reset() method to do that.
> >
> > Yep
> >
> > > > But as the feature freeze triggers in 4 days you have that time
> > > > to
> > > > review :D
> > > >
> > > > In the core there is a new LinkResetForm that is LinkAction and
> > > > has the flags and the field list
> > >
> > > Even though there's only one flag I think we should expose it as an
> > > enum in the core too, or as a boolean, but if more flags are added
> > > in
> > > future versions of pdf using a boolean might be a problem.
> >
> > Personally i do not like using a boolean, i can add a enum if you want
> > but it is pretty difficult to name given how the flag behaves, i can
> > name it IncludeExcludeFlag that is something similar as what the spec
> > uses (too lazy to open it)
>
> I don't like the boolean approach either, so let's add a flag with the
> name used by the spec. We can do a different thing in the frontends
> anyway.
Ok, will do that, not a priority now since we decided to wait until 0.20 for
this patch.
>
> > > > In the qt4 frontend there is the mirror public structure but the
> > > > field list is a list of fully qualified names instead of a list
> > > > of field *> >
> > > I think frontends should do the opposite, I mean, return a list of
> > > Field objects, so that viewers can simply call reset method on every
> > > form field when reset action is triggered.
> >
> > That is architecturally hard in the Qt4 frontend and gives not advantage
> > to how the code works with the current patch, so no, i'm not going to
> > change that.
>
> As long as core allows me to do that in the glib frontend, it's fine
> with me.
Sure, as said the core returns a pointer to the FormField so you can do as you
like in the glib frontend.
Albert
>
> > Albert
> >
> > > > Albert
> > >
> > > Regards,
>
> Regards,
> --
> Carlos Garcia Campos
> PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
More information about the poppler
mailing list