poppler/Form.cc | 11 ++--------- poppler/Form.h | 2 +- qt4/src/poppler-form.cc | 3 +-- 3 files changed, 4 insertions(+), 12 deletions(-)
New commits: commit 93c25e100ae2564b9a866b95bed16d2fac619bd7 Author: Carlos Garcia Campos <[email protected]> Date: Wed Mar 9 20:49:32 2011 +0100 forms: Rename FormField::createActivationAction() to FormField::getActivationAction() And use the existing action from the AnnotWidget instead of creating a new one. diff --git a/poppler/Form.cc b/poppler/Form.cc index c2525f0..acd1b2c 100644 --- a/poppler/Form.cc +++ b/poppler/Form.cc @@ -161,15 +161,8 @@ GooString *FormWidget::getFullyQualifiedName() { return field->getFullyQualifiedName(); } -LinkAction *FormWidget::createActivationAction(Catalog *catalog) -{ - Object tmp; - LinkAction *act = NULL; - if (obj.dictLookup("A", &tmp)->isDict()) { - act = LinkAction::parseAction(&tmp, catalog ? catalog->getBaseURI() : NULL); - } - tmp.free(); - return act; +LinkAction *FormWidget::getActivationAction() { + return widget ? widget->getAction() : NULL; } FormWidgetButton::FormWidgetButton (XRef *xrefA, Object *aobj, unsigned num, Ref ref, FormField *p) : diff --git a/poppler/Form.h b/poppler/Form.h index f7bf33e..adcf646 100644 --- a/poppler/Form.h +++ b/poppler/Form.h @@ -99,7 +99,7 @@ public: bool isReadOnly() const; - LinkAction *createActivationAction(Catalog *catalog); + LinkAction *getActivationAction(); // return the unique ID corresponding to pageNum/fieldNum static int encodeID (unsigned pageNum, unsigned fieldNum); diff --git a/qt4/src/poppler-form.cc b/qt4/src/poppler-form.cc index 77afcca..596ccb0 100644 --- a/qt4/src/poppler-form.cc +++ b/qt4/src/poppler-form.cc @@ -156,10 +156,9 @@ bool FormField::isVisible() const Link* FormField::activationAction() const { Link* action = 0; - if (::LinkAction *act = m_formData->fm->createActivationAction(m_formData->doc->doc->getCatalog())) + if (::LinkAction *act = m_formData->fm->getActivationAction()) { action = PageData::convertLinkActionToLink(act, m_formData->doc, QRectF()); - delete act; } return action; } _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
