[poppler] poppler/OptionalContent.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Wed Sep 15 02:25:49 PDT 2010


 poppler/OptionalContent.cc |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 4ec3e7784cdba5c0720b1992ba500e97a7e0ed2b
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Wed Sep 15 11:24:07 2010 +0200

    Set initial state of optional content groups based on BaseState field
    
    There's a test case using BaseState attached to bug #30106

diff --git a/poppler/OptionalContent.cc b/poppler/OptionalContent.cc
index 9568694..7e242e5 100644
--- a/poppler/OptionalContent.cc
+++ b/poppler/OptionalContent.cc
@@ -71,15 +71,19 @@ OCGs::OCGs(Object *ocgObject, XRef *xref) :
     ok = gFalse;
     return;
   }
-#if 0
-  // this is untested - we need an example showing BaseState
+
   Object baseState;
   defaultOcgConfig.dictLookup("BaseState", &baseState);
-  if (baseState.isString()) {
-    // read the value, and set each OptionalContentGroup entry appropriately
+  if (baseState.isName("OFF")) {
+    for (int i = 0; i < optionalContentGroups->getLength(); ++i) {
+      OptionalContentGroup *group;
+
+      group = (OptionalContentGroup *)optionalContentGroups->get(i);
+      group->setState(OptionalContentGroup::Off);
+    }
   }
   baseState.free();
-#endif
+
   Object on;
   defaultOcgConfig.dictLookup("ON", &on);
   if (on.isArray()) {


More information about the poppler mailing list