don't clear value index in SetStringValue() if the value is invalid (patch 1905695)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@52251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-03-02 14:29:38 +00:00
parent 17dd3f27e0
commit 60d02d5637

View File

@@ -632,10 +632,11 @@ void wxVListBoxComboPopup::SetStringValue( const wxString& value )
{ {
int index = m_strings.Index(value); int index = m_strings.Index(value);
if ( index >= 0 && index < (int)wxVListBox::GetItemCount() )
{
m_value = index; m_value = index;
if ( index >= -1 && index < (int)wxVListBox::GetItemCount() )
wxVListBox::SetSelection(index); wxVListBox::SetSelection(index);
}
} }
void wxVListBoxComboPopup::CalcWidths() void wxVListBoxComboPopup::CalcWidths()