summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Sander <oliver.sander@tu-dresden.de>2020-01-23 17:57:52 +0100
committerAlbert Astals Cid <tsdgeos@yahoo.es>2020-02-23 16:46:59 +0000
commitbe45004531235f4dc3cce92e5a24b7cff6c385c1 (patch)
treefa66800f09dcf10c82a9b0a467874da344d9781e
parent9980bc8eb1e7e6a7e39e684622bce52f3637784b (diff)
Use a std::string value in LinkUnknown
-rw-r--r--poppler/Link.cc6
-rw-r--r--poppler/Link.h10
2 files changed, 5 insertions, 11 deletions
diff --git a/poppler/Link.cc b/poppler/Link.cc
index 8d823919..74b16d7f 100644
--- a/poppler/Link.cc
+++ b/poppler/Link.cc
@@ -896,11 +896,7 @@ LinkHide::~LinkHide() {
//------------------------------------------------------------------------
LinkUnknown::LinkUnknown(const char *actionA) {
- action = new GooString(actionA);
-}
-
-LinkUnknown::~LinkUnknown() {
- delete action;
+ action = std::string(actionA ? actionA : "");
}
//------------------------------------------------------------------------
diff --git a/poppler/Link.h b/poppler/Link.h
index 4d10f2dd..532eac74 100644
--- a/poppler/Link.h
+++ b/poppler/Link.h
@@ -505,19 +505,17 @@ public:
// Build a LinkUnknown with the specified action type.
LinkUnknown(const char *actionA);
- // Destructor.
- ~LinkUnknown() override;
-
// Was the LinkUnknown create successfully?
- bool isOk() const override { return action != nullptr; }
+ // Yes: nothing can go wrong when creating LinkUnknown objects
+ bool isOk() const override { return true; }
// Accessors.
LinkActionKind getKind() const override { return actionUnknown; }
- const GooString *getAction() const { return action; }
+ const std::string& getAction() const { return action; }
private:
- GooString *action; // action subtype
+ std::string action; // action subtype
};
//------------------------------------------------------------------------