From 1b2d4e26badd8ef4e4d7943a05ea8e0c39dbdfe0 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 6 May 2020 11:56:16 -0400 Subject: [PATCH] Consistently compare to translation of "Command" in KeyView.cpp... ... note that "cat" compared with it is concatenated with _("Menu") and stored in KeyNode::category, which is also compared elsewhere with CommandTranslated. So this change in one comparison is the right one. --- src/widgets/KeyView.cpp | 7 +++++-- src/widgets/KeyView.h | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/widgets/KeyView.cpp b/src/widgets/KeyView.cpp index f35efcd70..c03f2c903 100644 --- a/src/widgets/KeyView.cpp +++ b/src/widgets/KeyView.cpp @@ -146,7 +146,7 @@ BEGIN_EVENT_TABLE(KeyView, wxVListBox) EVT_SCROLLWIN(KeyView::OnScroll) END_EVENT_TABLE(); -wxString KeyView::CommandTranslated="Command"; +static wxString CommandTranslated = "Command"; // ============================================================================ @@ -656,6 +656,9 @@ KeyView::RefreshBindings(const CommandIDs & names, bool incat = false; bool inpfx = false; + // lookup translation once only + CommandTranslated = _("Command"); + // Examine all names...all arrays passed have the same indexes int cnt = (int) names.size(); for (int i = 0; i < cnt; i++) @@ -668,7 +671,7 @@ KeyView::RefreshBindings(const CommandIDs & names, wxString pfx = wxMenuItem::GetLabelText(prefixes[i].Translation()); // Append "Menu" this node is for a menu title - if (cat != wxT("Command")) + if (cat != CommandTranslated) { cat.Append(wxT(" ")); cat += _("Menu"); diff --git a/src/widgets/KeyView.h b/src/widgets/KeyView.h index 3b373c11e..c8f34d082 100644 --- a/src/widgets/KeyView.h +++ b/src/widgets/KeyView.h @@ -133,7 +133,6 @@ private: void OnLeftDown(wxMouseEvent & event); - static wxString CommandTranslated; static bool CmpKeyNodeByTree(KeyNode *n1, KeyNode *n2); static bool CmpKeyNodeByName(KeyNode *n1, KeyNode *n2); static bool CmpKeyNodeByKey(KeyNode *n1, KeyNode *n2);