Skip to content

Commit

Permalink
Merge pull request #1379 from KeyWorksRW/wxToolBar
Browse files Browse the repository at this point in the history
Prevent double-assignment in wxToolBar
  • Loading branch information
Randalphwa authored Jan 14, 2024
2 parents cd740dd + 73bed76 commit 0da74ba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/generate/gen_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1304,18 +1304,20 @@ void GenToolCode(Code& code)
{
const auto* node = code.node();
code.Eol(eol_if_needed);
bool need_variable_result =
(node->hasValue(prop_var_name) &&
((node->as_string(prop_class_access) != "none") || node->isGen(gen_tool_dropdown) ||
(node->isGen(gen_auitool) && node->as_string(prop_initial_state) != "wxAUI_BUTTON_STATE_NORMAL")));

if (node->as_bool(prop_disabled) || (node->as_string(prop_id) == "wxID_ANY" && node->getInUseEventCount()))
{
code.AddAuto().NodeName();
if (code.is_golang())
code += " := ";
else
code += " = ";
need_variable_result = false; // make certain we don't add this again
}
bool need_variable_result =
(node->hasValue(prop_var_name) &&
((node->as_string(prop_class_access) != "none") || node->isGen(gen_tool_dropdown) ||
(node->isGen(gen_auitool) && node->as_string(prop_initial_state) != "wxAUI_BUTTON_STATE_NORMAL")));

if (need_variable_result)
{
Expand Down

0 comments on commit 0da74ba

Please # to comment.