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.
This commit is contained in:
Vadim Zeitlin
2019-10-26 00:41:15 +02:00
parent 46792d4933
commit 146befeb88

View File

@@ -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.