]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix crash when getting or setting wxComboBox value in wxUniv.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 4 Jul 2011 21:09:24 +0000 (21:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 4 Jul 2011 21:09:24 +0000 (21:09 +0000)
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

src/univ/combobox.cpp

index 95df6afad42a1d6e3adfbea3269e4ca412501823..0cfcbcdd71bdd17a00901c79f254633e1b55c239 100644 (file)
@@ -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)