From: Robin Dunn Date: Fri, 17 Dec 2010 00:56:26 +0000 (+0000) Subject: Use a " " (space) for the menu item if an empty string is used for an item in a wxCho... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/708cc39462e4f113ab1a52b502b79d1e473059e7?ds=inline Use a " " (space) for the menu item if an empty string is used for an item in a wxChoice, in order to avoid an assert in wxMenuItem. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/choice_osx.cpp b/src/osx/choice_osx.cpp index f303ec637c..966974de06 100644 --- a/src/osx/choice_osx.cpp +++ b/src/osx/choice_osx.cpp @@ -126,7 +126,10 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items, m_strings.Insert( items[i], idx ); } - m_popUpMenu->Insert( idx, i+1, items[i] ); + wxString text = items[i]; + if (text == wxEmptyString) + text = " "; // menu items can't have empty labels + m_popUpMenu->Insert( idx, i+1, text ); m_datas.Insert( NULL, idx ); AssignNewItemClientData(idx, clientData, i, type); }