Commit 7a9e7fc9 authored by Carlos Garcia Campos's avatar Carlos Garcia Campos

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.
parent 796d9cb9
......@@ -1967,6 +1967,16 @@ void AnnotText::initialize(XRef *xrefA, Catalog *catalog, Dict *dict) {
obj1.free();
}
//------------------------------------------------------------------------
// 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")) {
......
......@@ -403,6 +403,16 @@ private:
// None if StareModel Review)
};
//------------------------------------------------------------------------
// AnnotLink
//------------------------------------------------------------------------
class AnnotLink: public Annot {
public:
AnnotLink(XRef *xrefA, Dict *acroForm, Dict *dict, Catalog *catalog, Object *obj);
};
//------------------------------------------------------------------------
// Annots
//------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment