[poppler] poppler/Annot.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Feb 19 14:23:16 PST 2008


 poppler/Annot.cc |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit e964e2b9fbbe9b52b137ecd06729a06530835227
Author: Michael Vrable <mvrable at cs.ucsd.edu>
Date:   Tue Feb 19 23:22:55 2008 +0100

    Allow grouped checkboxes to be selected individually.
    
    When checkboxes are in a group, they ought to behave like a collection of
    radio buttons.  However, when deciding whether to draw a checkbox as
    selected or not, the checkbox-drawing code was looking up the value of the
    V field in the form dictionary, which is shared among all checkboxes in the
    group.  Thus, checkboxes would either all be on or off in unison.
    
    Instead, look up the AS (appearance state) value in each checkbox's
    annotation dictionary, so that different checkboxes can be drawn
    differently.

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 5e62ac4..2f7d8fc 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -2789,10 +2789,8 @@ void AnnotWidget::generateFieldAppearance() {
       }
       // checkbox
     } else {
-      // According to the PDF spec the off state must be named "Off",
-      // and the on state can be named anything, but Acrobat apparently
-      // looks for "Yes" and treats anything else as off.
-      if (Form::fieldLookup(field, "V", &obj1)->isName("Yes")) {
+      if (annot->lookup("AS", &obj1)->isName() &&
+          strcmp(obj1.getName(), "Off") != 0) {
         if (!caption) {
           caption = new GooString("3"); // ZapfDingbats checkmark
         }


More information about the poppler mailing list