From 9fe19926fa2849ac6069a04f8f1a0a29bc5bd2ec Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 26 Apr 2007 02:17:18 +0000 Subject: [PATCH] don't assert in SetSelection(wxNOT_FOUND), just clear text zone contents (patch 1707475) [backport from HEAD] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45653 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 4 ++++ src/mac/carbon/combobox.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index 4810012c3f..5dde0cbb30 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -122,6 +122,10 @@ wxGTK: - Fix wxNO_BORDER style for wxRadioBox (David Hart) - Fix wxTextCtrl::GetLineText() for empty lines (Marcin Wojdyr) +wxMac: + +- Fix wxComboBox::SetSelection(wxNOT_FOUND) (Adrian Secord) + wxUniv: - Fix wxTextCtrl::SetSelection(-1, -1) to behave as documented (Anders Larsen) diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index 6a155d9636..bf360cb425 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -576,7 +576,7 @@ void wxComboBox::SetSelection(int n) m_choice->SetSelection( n ); if ( m_text != NULL ) - m_text->SetValue(GetString(n)); + m_text->SetValue(n != wxNOT_FOUND ? GetString(n) : wxString(wxEmptyString)); } int wxComboBox::FindString(const wxString& s, bool bCase) const