From 146befeb88219fb7c33d1ec893a419afb3389b55 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 26 Oct 2019 00:41:15 +0200 Subject: [PATCH] Fix appearance of ampersands in wxAuiNotebook dropdown menu They need to be escaped to prevent them from being interpreted as special characters in wxMenuItem ctor. Closes #18055. --- src/aui/tabart.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/aui/tabart.cpp b/src/aui/tabart.cpp index 60e7939a7e..7c512f95d7 100644 --- a/src/aui/tabart.cpp +++ b/src/aui/tabart.cpp @@ -778,7 +778,10 @@ int wxAuiGenericTabArt::ShowDropDown(wxWindow* wnd, for (i = 0; i < count; ++i) { const wxAuiNotebookPage& page = pages.Item(i); - wxString caption = page.caption; + + // Preserve ampersands possibly present in the caption string by + // escaping them before passing the caption to wxMenuItem. + wxString caption = wxControl::EscapeMnemonics(page.caption); // if there is no caption, make it a space. This will prevent // an assert in the menu code.