From 75a788ee9230f65330731e58889840989525129b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 26 Apr 2007 02:22:00 +0000 Subject: [PATCH] don't assert in SetSelection(wxNOT_FOUND), just clear text zone contents git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/univ/combobox.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index ea366000be..0caac1a61c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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 diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index b615a9b537..f347cfe1b9 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -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 -- 2.50.0