poppler/OptionalContent.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
New commits: commit 03a0a69ef765b09187b6dcf20eabfcc7c0c4ffa9 Author: Carlos Garcia Campos <[email protected]> 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()) { _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
