Commit be450045 authored by Oliver Sander's avatar Oliver Sander Committed by Albert Astals Cid

Use a std::string value in LinkUnknown

parent 9980bc8e
......@@ -896,11 +896,7 @@ LinkHide::~LinkHide() {
//------------------------------------------------------------------------
LinkUnknown::LinkUnknown(const char *actionA) {
action = new GooString(actionA);
}
LinkUnknown::~LinkUnknown() {
delete action;
action = std::string(actionA ? actionA : "");
}
//------------------------------------------------------------------------
......
......@@ -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
};
//------------------------------------------------------------------------
......
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