summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2009-06-02 10:37:49 +0200
committerCarlos Garcia Campos <carlosgc@gnome.org>2009-06-16 16:34:16 +0200
commit0af5464352dfa51f0458c57a3590c847a45964c7 (patch)
treeb1cee8a7d7611f00ab43a6c6c62c3bf36c1802a9
parentfc4bc43dcd6f6871a47b9198e8c2571a5d448c3e (diff)
Save parent reference of popup annotations
-rw-r--r--poppler/Annot.cc16
-rw-r--r--poppler/Annot.h4
2 files changed, 7 insertions, 13 deletions
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 0f0267b8..e2f4e3e3 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -1306,22 +1306,16 @@ AnnotPopup::AnnotPopup(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj) :
}
AnnotPopup::~AnnotPopup() {
- /*
- if (parent)
- delete parent;
- */
+ parent.free();
}
void AnnotPopup::initialize(XRef *xrefA, Dict *dict, Catalog *catalog) {
Object obj1;
- /*
- if (dict->lookup("Parent", &obj1)->isDict()) {
- parent = NULL;
- } else {
- parent = NULL;
+
+ if (!dict->lookupNF("Parent", &parent)->isRef()) {
+ parent.initNull();
}
- obj1.free();
- */
+
if (dict->lookup("Open", &obj1)->isBool()) {
open = obj1.getBool();
} else {
diff --git a/poppler/Annot.h b/poppler/Annot.h
index b4d87949..f1b53cd2 100644
--- a/poppler/Annot.h
+++ b/poppler/Annot.h
@@ -585,13 +585,13 @@ public:
AnnotPopup(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
~AnnotPopup();
- Dict *getParent() const { return parent; }
+ Object *getParent(Object *obj) { return parent.fetch (xref, obj); }
GBool getOpen() const { return open; }
protected:
void initialize(XRef *xrefA, Dict *dict, Catalog *catalog);
- Dict *parent; // Parent
+ Object parent; // Parent
GBool open; // Open
};