refactor(builder): Remove unused condition parameter

Same as in #1952, the methods are never called with the optional
parameter, except once where it is called with the default value.

Ref: #1952
This commit is contained in:
patrick96 2019-12-18 10:27:39 +01:00 committed by Patrick Ziegler
parent bc560952e0
commit 4bc7a09c7e
2 changed files with 7 additions and 9 deletions

View File

@ -47,9 +47,9 @@ class builder {
void underline(const string& color = ""); void underline(const string& color = "");
void underline_close(); void underline_close();
void control(controltag tag); void control(controltag tag);
void cmd(mousebtn index, string action, bool condition = true); void cmd(mousebtn index, string action);
void cmd(mousebtn index, string action, const label_t& label); void cmd(mousebtn index, string action, const label_t& label);
void cmd_close(bool condition = true); void cmd_close();
protected: protected:
string background_hex(); string background_hex();

View File

@ -429,8 +429,8 @@ void builder::control(controltag tag) {
/** /**
* Open command tag * Open command tag
*/ */
void builder::cmd(mousebtn index, string action, bool condition) { void builder::cmd(mousebtn index, string action) {
if (condition && !action.empty()) { if (!action.empty()) {
action = string_util::replace_all(action, ":", "\\:"); action = string_util::replace_all(action, ":", "\\:");
tag_open(syntaxtag::A, to_string(static_cast<int>(index)) + ":" + action + ":"); tag_open(syntaxtag::A, to_string(static_cast<int>(index)) + ":" + action + ":");
} }
@ -441,7 +441,7 @@ void builder::cmd(mousebtn index, string action, bool condition) {
*/ */
void builder::cmd(mousebtn index, string action, const label_t& label) { void builder::cmd(mousebtn index, string action, const label_t& label) {
if (label && *label) { if (label && *label) {
cmd(index, action, true); cmd(index, action);
node(label); node(label);
tag_close(syntaxtag::A); tag_close(syntaxtag::A);
} }
@ -450,11 +450,9 @@ void builder::cmd(mousebtn index, string action, const label_t& label) {
/** /**
* Close command tag * Close command tag
*/ */
void builder::cmd_close(bool condition) { void builder::cmd_close() {
if (condition) {
tag_close(syntaxtag::A); tag_close(syntaxtag::A);
} }
}
/** /**
* Get default background hex string * Get default background hex string