]> git.saurik.com Git - wxWidgets.git/commitdiff
don't assert in SetSelection(wxNOT_FOUND), just clear text zone contents
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 26 Apr 2007 02:22:00 +0000 (02:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 26 Apr 2007 02:22:00 +0000 (02:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/univ/combobox.cpp

index ea366000be32f3066647094de402139d40d5a972..0caac1a61cac755f87f39bc4e92ea0d67235d5b7 100644 (file)
@@ -184,6 +184,7 @@ wxMac:
 wxUniv:
 
 - Fix wxTextCtrl::SetSelection(-1, -1) to behave as documented (Anders Larsen)
+- Fix wxComboBox::SetSelection(wxNOT_FOUND)
 - Fix setting background colour for controls with transparent background
 
 
index b615a9b53727ae8294a715ce9df5615956e337b8..f347cfe1b97082e25b9b7ae5489365306bf2368d 100644 (file)
@@ -390,7 +390,11 @@ void wxComboBox::SetSelection(int n)
 
     GetLBox()->SetSelection(n);
 
-    SetText(GetLBox()->GetString(n));
+    wxString str;
+    if ( n != wxNOT_FOUND )
+        str = GetLBox()->GetString(n);
+
+    SetText(str);
 }
 
 int wxComboBox::GetSelection() const