[Poppler-bugs] [Bug 106356] [PATCH] Qt5: Support additional widget actions in PDF Forms

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun May 6 15:38:26 UTC 2018


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

--- Comment #5 from Albert Astals Cid <aacid at kde.org> ---
(In reply to Andre Heinecke from comment #4)
> I thought that combining both in a single enumeration might be a good idea
> because I saw:
> 
>  * The widget annotation represents a widget (form field) on a page.
>  *
>  * \note This class is just provided for consistency of the annotation API,
>  *       use the FormField classes to get all the form-related information.
> 
> So I thought that it makes sense API wise to have everything related to
> FormFields declared in poppler-form / the FormField class. Currently there
> is also no dependency from poppler-form.h to poppler-annotation.h.
> 
> From an implementation standpoint, yes it would make the type
> differentiation in popler-form.cc FormField::additionalAction simpler by
> splitting both branches into two functions.
> But as an API user I find it simpler to only have to care about a single
> AdditionalAction enum.
> 
> At least in Okular reducing both enum's to a single AdditionalActionType
> enum helps so that we don't need duplicated API to carry / access them
> there. I found it more elegant to directly "abstract" the difference away in
> the poppler-qt api.

I don't agree it's a good abstraction, you're duplicating API, by having "the
same enum values" in two different places, which for people that are "not you
or me" makes you wonder why that happens or if one is the new and the other the
old, or what.

I think adding a new function accepting the annotation enums, is exactly
fullfiling that "this class is just provided for consistency" comment.

You know you want the MousePressed action, but since there is that comment you
go to the form field classes, and there you go, there's exactly the function
accepting what you want.

Why is it any different for Okular?

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


More information about the Poppler-bugs mailing list