summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2017-03-02 00:52:21 +0100
committerAlbert Astals Cid <aacid@kde.org>2017-03-02 00:52:21 +0100
commit0ae3d40a79c25feb5cb9bce6fc8cc48c30bfd1b6 (patch)
treeff2ee204f370392d49118d1a50b1c2c52605d61f
parentbbfc56b3c9a1e613e6db008a56c9c3333ae1427a (diff)
Parse AcroForm CO (calculateOrder)
-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;