Fix wxPGProperty::InsertChoice

Take into account that wxPGProperty::GetChoiceSelection can return either 0 (for wxEnumProperty) or -1 (for other properties) if choice value list is empty and initialize new selection index properly.

See #16401.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77012 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Artur Wieczorek 2014-08-06 13:34:01 +00:00
parent 0f9ba6c59f
commit 138297786c

View File

@ -1898,7 +1898,7 @@ int wxPGProperty::InsertChoice( const wxString& label, int index, int value )
wxPropertyGrid* pg = GetGrid();
const int sel = GetChoiceSelection();
int newSel = sel;
int newSel = (sel == wxNOT_FOUND) ? 0 : sel;
const int numChoices = m_choices.GetCount();
if ( index == wxNOT_FOUND )