From 60d02d56379fd89c7a0d59474b5e76ec57ee146e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 2 Mar 2008 14:29:38 +0000 Subject: [PATCH] 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 --- src/generic/odcombo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index 10ccc454ce..bd3a9ed0c1 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -632,10 +632,11 @@ void wxVListBoxComboPopup::SetStringValue( const wxString& value ) { int index = m_strings.Index(value); - m_value = index; - - if ( index >= -1 && index < (int)wxVListBox::GetItemCount() ) + if ( index >= 0 && index < (int)wxVListBox::GetItemCount() ) + { + m_value = index; wxVListBox::SetSelection(index); + } } void wxVListBoxComboPopup::CalcWidths()