[poppler] poppler/Link.cc poppler/Link.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Mar 18 16:37:43 UTC 2020


 poppler/Link.cc |   20 ++++++++++++++++++++
 poppler/Link.h  |   20 +++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)

New commits:
commit 81a86064c14a7fc25047b6040d65464e732cf501
Author: Adam Reichold <adam.reichold at t-online.de>
Date:   Wed Mar 18 11:39:50 2020 +0100

    Fix vague linkage of Link* class vtables
    
    Due to falling back to the implicitly inline destructors,
    some of the Link* classes had all their overridden methods
    defined inline with made the linkage of their vtables vague.
    
    This change moves their destructors into a defined translation
    unit thereby anchoring their vtables in the libpoppler DSO which
    fixes issues using dynamic_cast when builing Poppler using Clang.

diff --git a/poppler/Link.cc b/poppler/Link.cc
index 790c41ab..cc3ebf2a 100644
--- a/poppler/Link.cc
+++ b/poppler/Link.cc
@@ -444,6 +444,8 @@ LinkGoTo::LinkGoTo(const Object *destObj) {
   }
 }
 
+LinkGoTo::~LinkGoTo() = default;
+
 //------------------------------------------------------------------------
 // LinkGoToR
 //------------------------------------------------------------------------
@@ -474,6 +476,8 @@ LinkGoToR::LinkGoToR(Object *fileSpecObj, Object *destObj) {
   }
 }
 
+LinkGoToR::~LinkGoToR() = default;
+
 //------------------------------------------------------------------------
 // LinkLaunch
 //------------------------------------------------------------------------
@@ -552,6 +556,8 @@ LinkURI::LinkURI(const Object *uriObj, const GooString *baseURI) {
   }
 }
 
+LinkURI::~LinkURI() = default;
+
 //------------------------------------------------------------------------
 // LinkNamed
 //------------------------------------------------------------------------
@@ -564,6 +570,8 @@ LinkNamed::LinkNamed(const Object *nameObj) {
   }
 }
 
+LinkNamed::~LinkNamed() = default;
+
 //------------------------------------------------------------------------
 // LinkMovie
 //------------------------------------------------------------------------
@@ -607,6 +615,8 @@ LinkMovie::LinkMovie(const Object *obj) {
   }
 }
 
+LinkMovie::~LinkMovie() = default;
+
 //------------------------------------------------------------------------
 // LinkSound
 //------------------------------------------------------------------------
@@ -645,6 +655,8 @@ LinkSound::LinkSound(const Object *soundObj) {
   }
 }
 
+LinkSound::~LinkSound() = default;
+
 //------------------------------------------------------------------------
 // LinkRendition
 //------------------------------------------------------------------------
@@ -738,6 +750,8 @@ LinkJavaScript::LinkJavaScript(Object *jsObj) {
   }
 }
 
+LinkJavaScript::~LinkJavaScript() = default;
+
 Object LinkJavaScript::createObject(XRef *xref, const GooString &js)
 {
   Dict *linkDict = new Dict(xref);
@@ -793,6 +807,8 @@ LinkOCGState::LinkOCGState(const Object *obj)
   preserveRB = obj->dictLookup("PreserveRB").getBoolWithDefaultValue(true);
 }
 
+LinkOCGState::~LinkOCGState() = default;
+
 //------------------------------------------------------------------------
 // LinkHide
 //------------------------------------------------------------------------
@@ -814,6 +830,8 @@ LinkHide::LinkHide(const Object *hideObj) {
   }
 }
 
+LinkHide::~LinkHide() = default;
+
 //------------------------------------------------------------------------
 // LinkUnknown
 //------------------------------------------------------------------------
@@ -822,6 +840,8 @@ LinkUnknown::LinkUnknown(const char *actionA) {
   action = std::string(actionA ? actionA : "");
 }
 
+LinkUnknown::~LinkUnknown() = default;
+
 //------------------------------------------------------------------------
 // Links
 //------------------------------------------------------------------------
diff --git a/poppler/Link.h b/poppler/Link.h
index 3aa5e0a8..57c169ea 100644
--- a/poppler/Link.h
+++ b/poppler/Link.h
@@ -164,6 +164,8 @@ public:
   // Build a LinkGoTo from a destination (dictionary, name, or string).
   LinkGoTo(const Object *destObj);
 
+  ~LinkGoTo() override;
+
   // Was the LinkGoTo created successfully?
   bool isOk() const override { return dest || namedDest; }
 
@@ -191,6 +193,8 @@ public:
   // (dictionary, name, or string).
   LinkGoToR(Object *fileSpecObj, Object *destObj);
 
+  ~LinkGoToR() override;
+
   // Was the LinkGoToR created successfully?
   bool isOk() const override { return fileName && (dest || namedDest); }
 
@@ -243,6 +247,8 @@ public:
   // Build a LinkURI given the URI (string) and base URI.
   LinkURI(const Object *uriObj, const GooString *baseURI);
 
+  ~LinkURI() override;
+
   // Was the LinkURI created successfully?
   bool isOk() const override { return hasURIFlag; }
 
@@ -266,6 +272,8 @@ public:
   // Build a LinkNamed given the action name.
   LinkNamed(const Object *nameObj);
 
+  ~LinkNamed() override;
+
   bool isOk() const override { return hasNameFlag; }
 
   LinkActionKind getKind() const override { return actionNamed; }
@@ -294,6 +302,8 @@ public:
 
   LinkMovie(const Object *obj);
 
+  ~LinkMovie() override;
+
   bool isOk() const override { return hasAnnotRef() || hasAnnotTitleFlag; }
   LinkActionKind getKind() const override { return actionMovie; }
 
@@ -374,6 +384,8 @@ public:
 
   LinkSound(const Object *soundObj);
 
+  ~LinkSound() override;
+
   bool isOk() const override { return sound != nullptr; }
 
   LinkActionKind getKind() const override { return actionSound; }
@@ -403,6 +415,8 @@ public:
   // Build a LinkJavaScript given the action name.
   LinkJavaScript(Object *jsObj);
 
+  ~LinkJavaScript() override;
+
   bool isOk() const override { return isValid; }
 
   LinkActionKind getKind() const override { return actionJavaScript; }
@@ -423,7 +437,7 @@ class LinkOCGState: public LinkAction {
 public:
   LinkOCGState(const Object *obj);
 
-  ~LinkOCGState() override = default;
+  ~LinkOCGState() override;
 
   bool isOk() const override { return isValid; }
 
@@ -454,6 +468,8 @@ class LinkHide: public LinkAction {
 public:
   LinkHide(const Object *hideObj);
 
+  ~LinkHide() override;
+
   bool isOk() const override { return hasTargetNameFlag; }
   LinkActionKind getKind() const override { return actionHide; }
 
@@ -489,6 +505,8 @@ public:
   // Build a LinkUnknown with the specified action type.
   LinkUnknown(const char *actionA);
 
+  ~LinkUnknown() override;
+
   // Was the LinkUnknown create successfully?
   // Yes: nothing can go wrong when creating LinkUnknown objects
   bool isOk() const override { return true; }


More information about the poppler mailing list