diff --git a/poppler/Annot.cc b/poppler/Annot.cc index e55ddde..6440529 100644 --- a/poppler/Annot.cc +++ b/poppler/Annot.cc @@ -3730,10 +3730,9 @@ AnnotWidget::~AnnotWidget() { if (action) delete action; - - if (additionActions) - delete additionActions; - + + additionalActions.free(); + if (parent) delete parent; } @@ -3773,12 +3772,7 @@ void AnnotWidget::initialize(PDFDoc *docA, Dict *dict) { } obj1.free(); - if(dict->lookup("AA", &obj1)->isDict()) { - additionActions = NULL; - } else { - additionActions = NULL; - } - obj1.free(); + dict->lookupNF("AA", &additionalActions); if(dict->lookup("Parent", &obj1)->isDict()) { parent = NULL; @@ -5103,7 +5097,7 @@ AnnotScreen::~AnnotScreen() { if (action) delete action; - additionAction.free(); + additionalActions.free(); } void AnnotScreen::initialize(PDFDoc *docA, Dict* dict) { @@ -5127,14 +5121,13 @@ void AnnotScreen::initialize(PDFDoc *docA, Dict* dict) { } obj1.free(); - dict->lookup("AA", &additionAction); + dict->lookupNF("AA", &additionalActions); appearCharacs = NULL; if(dict->lookup("MK", &obj1)->isDict()) { appearCharacs = new AnnotAppearanceCharacs(obj1.getDict()); } obj1.free(); - } //------------------------------------------------------------------------ diff --git a/poppler/Annot.h b/poppler/Annot.h index 0d20cc7..82a033b 100644 --- a/poppler/Annot.h +++ b/poppler/Annot.h @@ -805,7 +805,7 @@ class AnnotScreen: public Annot { AnnotAppearanceCharacs *getAppearCharacs() { return appearCharacs; } LinkAction* getAction() { return action; } - Object* getAdditionActions() { return &additionAction; } + Object *getAdditionalActions(Object *obj) { return additionalActions.fetch(xref, obj); } private: void initialize(PDFDoc *docA, Dict *dict); @@ -816,7 +816,7 @@ class AnnotScreen: public Annot { AnnotAppearanceCharacs* appearCharacs; // MK LinkAction *action; // A - Object additionAction; // AA + Object additionalActions; // AA }; //------------------------------------------------------------------------ @@ -1278,7 +1278,7 @@ public: AnnotWidgetHighlightMode getMode() { return mode; } AnnotAppearanceCharacs *getAppearCharacs() { return appearCharacs; } LinkAction *getAction() { return action; } - Dict *getAdditionActions() { return additionActions; } + Object *getAdditionalActions(Object *obj) { return additionalActions.fetch(xref, obj); } Dict *getParent() { return parent; } private: @@ -1297,7 +1297,7 @@ private: AnnotWidgetHighlightMode mode; // H (Default I) AnnotAppearanceCharacs *appearCharacs; // MK LinkAction *action; // A - Dict *additionActions; // AA + Object additionalActions; // AA // inherited from Annot // AnnotBorderBS border; // BS Dict *parent; // Parent