diff options
-rw-r--r-- | poppler/OptionalContent.cc | 13 | ||||
-rw-r--r-- | poppler/OptionalContent.h | 10 |
2 files changed, 9 insertions, 14 deletions
diff --git a/poppler/OptionalContent.cc b/poppler/OptionalContent.cc index 4a3d4a92..f59b16ad 100644 --- a/poppler/OptionalContent.cc +++ b/poppler/OptionalContent.cc @@ -28,7 +28,7 @@ //------------------------------------------------------------------------ OCGs::OCGs(Object *ocgObject, XRef *xref) : - m_orderArray(0), m_rBGroupsArray(), m_xref(xref) + m_xref(xref) { // we need to parse the dictionary here, and build optionalContentGroups ok = gTrue; @@ -126,17 +126,8 @@ OCGs::OCGs(Object *ocgObject, XRef *xref) : } off.free(); - Object order; defaultOcgConfig.dictLookup("Order", &order); - if ( (order.isArray()) && (order.arrayGetLength() > 0) ) { - m_orderArray = order.getArray(); - } - - Object rbgroups; defaultOcgConfig.dictLookup("RBGroups", &rbgroups); - if ( (rbgroups.isArray()) && (rbgroups.arrayGetLength() > 0) ) { - m_rBGroupsArray = rbgroups.getArray(); - } ocgList.free(); defaultOcgConfig.free(); @@ -145,6 +136,8 @@ OCGs::OCGs(Object *ocgObject, XRef *xref) : OCGs::~OCGs() { deleteGooList(optionalContentGroups, OptionalContentGroup); + order.free(); + rbgroups.free(); } diff --git a/poppler/OptionalContent.h b/poppler/OptionalContent.h index b6136c3d..90fded29 100644 --- a/poppler/OptionalContent.h +++ b/poppler/OptionalContent.h @@ -40,8 +40,10 @@ public: OptionalContentGroup* findOcgByRef( const Ref &ref); - Array* getOrderArray() const { return m_orderArray; } - Array* getRBGroupsArray() const { return m_rBGroupsArray; } + Array* getOrderArray() + { return (order.isArray() && order.arrayGetLength() > 0) ? order.getArray() : NULL; } + Array* getRBGroupsArray() + { return (rbgroups.isArray() && rbgroups.arrayGetLength()) ? rbgroups.getArray() : NULL; } bool optContentIsVisible( Object *dictRef ); @@ -55,8 +57,8 @@ private: GooList *optionalContentGroups; - Array *m_orderArray; - Array *m_rBGroupsArray; + Object order; + Object rbgroups; XRef *m_xref; }; |