[poppler] poppler/Annot.cc poppler/Annot.h

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sun Dec 16 12:21:26 PST 2007


 poppler/Annot.cc |   12 +++++++++++-
 poppler/Annot.h  |   10 ++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 7a9e7fc96b47b9d833300233ac38bbd60097f425
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun Dec 16 21:21:08 2007 +0100

    Add AnnotLink class so that link annots are properly recognized
    
    Right now, all of the annots except Text, are created using the
    base class Annot which sets the type to unknown. For link annots this
    causes the border never be drawn, since we are checking first whether the
    annot is a Link and it's always false.

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 9304189..da6cca9 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -1968,6 +1968,16 @@ void AnnotText::initialize(XRef *xrefA, Catalog *catalog, Dict *dict) {
 }
 
 //------------------------------------------------------------------------
+// AnnotLink
+//------------------------------------------------------------------------
+
+AnnotLink::AnnotLink(XRef *xrefA, Dict *acroForm, Dict *dict, Catalog *catalog, Object *obj) :
+    Annot(xrefA, acroForm, dict, catalog, obj) {
+
+  type = typeLink;
+}
+
+//------------------------------------------------------------------------
 // Annots
 //------------------------------------------------------------------------
 
@@ -2019,7 +2029,7 @@ Annot *Annots::createAnnot(XRef *xref, Dict *acroForm, Dict* dict, Catalog *cata
     if (!typeName->cmp("Text")) {
       annot = new AnnotText(xref, acroForm, dict, catalog, obj);
     } else if(!typeName->cmp("Link")) {
-      annot = new Annot(xref, acroForm, dict, catalog, obj);
+      annot = new AnnotLink(xref, acroForm, dict, catalog, obj);
     } else if(!typeName->cmp("FreeText")) {
       annot = new Annot(xref, acroForm, dict, catalog, obj);
     } else if(!typeName->cmp("Line")) {
diff --git a/poppler/Annot.h b/poppler/Annot.h
index 7a7f81d..7456160 100644
--- a/poppler/Annot.h
+++ b/poppler/Annot.h
@@ -404,6 +404,16 @@ private:
 };
 
 //------------------------------------------------------------------------
+// AnnotLink
+//------------------------------------------------------------------------
+
+class AnnotLink: public Annot {
+public:
+
+  AnnotLink(XRef *xrefA, Dict *acroForm, Dict *dict, Catalog *catalog, Object *obj);
+};
+
+//------------------------------------------------------------------------
 // Annots
 //------------------------------------------------------------------------
 


More information about the poppler mailing list