summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--poppler/Form.cc19
-rw-r--r--poppler/Form.h4
2 files changed, 23 insertions, 0 deletions
diff --git a/poppler/Form.cc b/poppler/Form.cc
index b73f52d1..ced3140c 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -1640,6 +1640,25 @@ Form::Form(PDFDoc *docA, Object* acroFormA)
}
obj1.free ();
+ acroForm->dictLookup("CO", &obj1);
+ if (obj1.isArray()) {
+ Array *array = obj1.getArray();
+ calculateOrder.reserve(array->getLength());
+ for(int i=0; i<array->getLength(); i++) {
+ Object oref;
+ array->getNF(i, &oref);
+ if (!oref.isRef()) {
+ error(errSyntaxWarning, -1, "Direct object in CO");
+ oref.free();
+ continue;
+ }
+ calculateOrder.push_back(oref.getRef());
+
+ oref.free();
+ }
+ }
+ obj1.free ();
+
#ifdef DEBUG_FORMS
for (int i = 0; i < numFields; i++)
rootFields[i]->printTree();
diff --git a/poppler/Form.h b/poppler/Form.h
index 52651336..8696d2f5 100644
--- a/poppler/Form.h
+++ b/poppler/Form.h
@@ -540,6 +540,9 @@ public:
FormWidget* findWidgetByRef (Ref aref);
void postWidgetsLoad();
+
+ const std::vector<Ref> &getCalculateOrder() const { return calculateOrder; }
+
private:
FormField** rootFields;
int numFields;
@@ -550,6 +553,7 @@ private:
GBool needAppearances;
GfxResources *defaultResources;
Object resDict;
+ std::vector<Ref> calculateOrder;
// Variable Text
GooString *defaultAppearance;