]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/combobox_osx.cpp
Compilation fixes for wx{X11,GTK1,Motif} after making ref data non copyable.
[wxWidgets.git] / src / osx / combobox_osx.cpp
index 214bdbdff4611cb5d23a4247635fc17ca8a1fd0a..9790bb95dca74fad92b71e877a4be18f6c63b1f5 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     1998-01-01
-// RCS-ID:      $Id: combobox_osx.cpp 58318 2009-01-23 08:36:16Z RR $
+// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -186,12 +186,15 @@ int wxComboBox::FindString(const wxString& s, bool bCase) const
 
 wxString wxComboBox::GetString(unsigned int n) const
 {
+    wxCHECK_MSG( n < GetCount(), wxString(), "Invalid combobox index" );
+
     return GetComboPeer()->GetStringAtIndex(n);
 }
 
 wxString wxComboBox::GetStringSelection() const
 {
-    return GetString(GetSelection());
+    const int sel = GetSelection();
+    return sel == wxNOT_FOUND ? wxString() : GetString(sel);
 }
 
 void wxComboBox::SetString(unsigned int n, const wxString& s)