From: Vadim Zeitlin Date: Mon, 4 Jul 2011 21:09:24 +0000 (+0000) Subject: Fix crash when getting or setting wxComboBox value in wxUniv. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0aae39efd27d0325a84c363e2cf350a72bd59d5c Fix crash when getting or setting wxComboBox value in wxUniv. Forward DoGetValue() and SetValue() to the associated wxTextCtrl. Closes #13298. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 95df6afad4..0cfcbcdd71 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -273,12 +273,13 @@ wxComboBox::~wxComboBox() wxString wxComboBox::DoGetValue() const { - return wxComboCtrl::GetValue(); + return GetTextCtrl() ? GetTextCtrl()->GetValue() : wxString(); } void wxComboBox::SetValue(const wxString& value) { - wxComboCtrl::SetValue(value); + if ( GetTextCtrl() ) + GetTextCtrl()->SetValue(value); } void wxComboBox::WriteText(const wxString& value)