[poppler] 2 commits - qt4/src

Pino Toscano pino at kemper.freedesktop.org
Tue Aug 12 04:50:34 PDT 2008


 qt4/src/poppler-form.cc        |   19 +++++++++++++++++++
 qt4/src/poppler-form.h         |    8 ++++++++
 qt4/src/poppler-page-private.h |    2 ++
 qt4/src/poppler-page.cc        |    5 +++++
 4 files changed, 34 insertions(+)

New commits:
commit 2e7b0eb4af8cf5938833e5659d01b77096e7b7f7
Author: Pino Toscano <pino at kde.org>
Date:   Tue Aug 12 13:49:52 2008 +0200

    [Qt4] add a method to get the activation action of a FormField

diff --git a/qt4/src/poppler-form.cc b/qt4/src/poppler-form.cc
index 752c608..07675cd 100644
--- a/qt4/src/poppler-form.cc
+++ b/qt4/src/poppler-form.cc
@@ -24,6 +24,7 @@
 #include <Object.h>
 
 #include "poppler-form.h"
+#include "poppler-page-private.h"
 #include "poppler-private.h"
 #include "poppler-annotation-helper.h"
 
@@ -125,6 +126,24 @@ bool FormField::isVisible() const
   return !(m_formData->annoflags & (1 << 1));
 }
 
+Link* FormField::activationAction() const
+{
+  Object tmp;
+  Object *obj = m_formData->fm->getObj();
+  Link* action = 0;
+  if (obj->dictLookup("A", &tmp)->isDict())
+  {
+    ::LinkAction *act = ::LinkAction::parseAction(&tmp, m_formData->doc->doc->getCatalog()->getBaseURI());
+    if (act)
+    {
+      action = PageData::convertLinkActionToLink(act, m_formData->doc, QRectF());
+      delete act;
+    }
+  }
+  tmp.free();
+  return action;
+}
+
 
 FormFieldButton::FormFieldButton(DocumentData *doc, ::Page *p, ::FormWidgetButton *w)
   : FormField(*new FormFieldData(doc, p, w))
diff --git a/qt4/src/poppler-form.h b/qt4/src/poppler-form.h
index e8afff9..315ea65 100644
--- a/qt4/src/poppler-form.h
+++ b/qt4/src/poppler-form.h
@@ -32,6 +32,7 @@ class FormWidgetChoice;
 namespace Poppler {
 
     class DocumentData;
+    class Link;
 
     class FormFieldData;
     /**
@@ -89,6 +90,13 @@ namespace Poppler {
 	 */
 	bool isVisible() const;
 
+	/**
+	  The activation action of this form field.
+
+	  \note It may be null.
+	 */
+	Link* activationAction() const;
+
     protected:
 	/// \cond PRIVATE
 	FormField(FormFieldData &dd);
commit f9e679adbd6830da26eb9909bcb16e3bdf0da6b4
Author: Pino Toscano <pino at kde.org>
Date:   Tue Aug 12 13:47:15 2008 +0200

    create a static version of PageData::convertLinkActionToLink()

diff --git a/qt4/src/poppler-page-private.h b/qt4/src/poppler-page-private.h
index dd79306..012eed4 100644
--- a/qt4/src/poppler-page-private.h
+++ b/qt4/src/poppler-page-private.h
@@ -38,6 +38,8 @@ public:
   ::Page *page;
   int index;
   PageTransition *transition;
+
+  static Link* convertLinkActionToLink(::LinkAction * a, DocumentData *parentDoc, const QRectF &linkArea);
 };
 
 }
diff --git a/qt4/src/poppler-page.cc b/qt4/src/poppler-page.cc
index cfb98de..29602f4 100644
--- a/qt4/src/poppler-page.cc
+++ b/qt4/src/poppler-page.cc
@@ -59,6 +59,11 @@ class DummyAnnotation : public Annotation
 
 Link* PageData::convertLinkActionToLink(::LinkAction * a, const QRectF &linkArea)
 {
+    return convertLinkActionToLink(a, parentDoc, linkArea);
+}
+
+Link* PageData::convertLinkActionToLink(::LinkAction * a, DocumentData *parentDoc, const QRectF &linkArea)
+{
   if ( !a )
     return NULL;
 


More information about the poppler mailing list