Skip to content

Commit

Permalink
Partially fix issue #3374
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Mar 31, 2021
1 parent b7c6d97 commit 7227676
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/viewer/svmnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ SVMenuNode::~SVMenuNode() = default;
// Create a new sub menu node with just a caption. This is used to create
// nodes which act as parent nodes to other nodes (e.g. submenus).
SVMenuNode *SVMenuNode::AddChild(const char *txt) {
auto *s = new SVMenuNode(-1, txt, false, false, nullptr, nullptr);
auto *s = new SVMenuNode(-1, txt, false, false);
this->AddChild(s);
return s;
}

// Create a "normal" menu node which is associated with a command event.
void SVMenuNode::AddChild(const char *txt, int command_event) {
this->AddChild(new SVMenuNode(command_event, txt, false, false, nullptr, nullptr));
this->AddChild(new SVMenuNode(command_event, txt, false, false));
}

// Create a menu node with an associated value (which might be changed
// through the gui).
void SVMenuNode::AddChild(const char *txt, int command_event, const char *val) {
this->AddChild(new SVMenuNode(command_event, txt, false, false, val, nullptr));
this->AddChild(new SVMenuNode(command_event, txt, false, false, val));
}

// Create a menu node with an associated value and description_.
Expand All @@ -80,7 +80,7 @@ void SVMenuNode::AddChild(const char *txt, int command_event, const char *val, c

// Create a flag menu node.
void SVMenuNode::AddChild(const char *txt, int command_event, int tv) {
this->AddChild(new SVMenuNode(command_event, txt, tv, true, nullptr, nullptr));
this->AddChild(new SVMenuNode(command_event, txt, tv, true));
}

// Convenience function called from the different constructors to initialize
Expand Down
4 changes: 2 additions & 2 deletions src/viewer/svmnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class SVMenuNode {

private:
// Constructor holding the actual node data.
SVMenuNode(int command_event, const char *txt, int tv, bool check_box_entry, const char *val,
const char *desc);
SVMenuNode(int command_event, const char *txt, int tv, bool check_box_entry, const char *val = "",
const char *desc = "");

// Adds a new menu node to the current node.
void AddChild(SVMenuNode *svmn);
Expand Down

0 comments on commit 7227676

Please sign in to comment.