[poppler] 2 commits - poppler/Form.cc
Pino Toscano
pino at kemper.freedesktop.org
Sun Sep 21 05:44:19 PDT 2008
poppler/Form.cc | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
New commits:
commit fe26075353226be9a02c8cf1a6a29586de15ce86
Author: Pino Toscano <pino at kde.org>
Date: Sun Sep 21 12:03:21 2008 +0200
really use the key passed to it
diff --git a/poppler/Form.cc b/poppler/Form.cc
index 50f70fd..30f1026 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -167,7 +167,7 @@ void FormWidget::updateField (const char *key, Object *value)
}
obj2.free ();
- obj1->getDict ()->set ("V", value);
+ obj1->getDict ()->set (const_cast<char*>(key), value);
//notify the xref about the update
xref->setModifiedObject(obj1, ref1);
}
commit 8aa531cb478d6ae838a94f9f31e6a0bbd0dd957c
Author: Pino Toscano <pino at kde.org>
Date: Sun Sep 21 11:18:22 2008 +0200
Read the 'readOnly' attribute directly in the FormField constructor.
diff --git a/poppler/Form.cc b/poppler/Form.cc
index 192d428..50f70fd 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -765,6 +765,9 @@ FormField::FormField(XRef* xrefA, Object *aobj, const Ref& aref, FormFieldType t
//flags
if (Form::fieldLookup(dict, "Ff", &obj1)->isInt()) {
int flags = obj1.getInt();
+ if (flags & 0x1) { // 1 -> ReadOnly
+ readOnly = true;
+ }
if (flags & 0x2) { // 2 -> Required
//TODO
}
@@ -1164,15 +1167,6 @@ Form::Form(XRef *xrefA, Object* acroFormA)
rootFields[numFields++] = createFieldFromDict (&obj2, xrefA, oref.getRef());
- //Mark readonly field
- Object obj3;
- if (Form::fieldLookup(obj2.getDict (), "Ff", &obj3)->isInt()) {
- int flags = obj3.getInt();
- if (flags & 0x1)
- rootFields[numFields-1]->setReadOnly(true);
- }
- obj3.free();
-
obj2.free();
oref.free();
}
More information about the poppler
mailing list