]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/choice.cpp
GTK_TOOLBAR_BOTH_HORIZ is GTK 2 only (it would have been nice if the patch mentioned...
[wxWidgets.git] / src / mac / carbon / choice.cpp
index 86d75eb0da14405232ad9e54bc81eb293ff67f50..c187d9ecc75ef2f05485fc205c175616a5ef0bed 100644 (file)
@@ -105,7 +105,7 @@ void wxChoice::Delete(int n)
         delete GetClientObject(n);
     }
     ::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1) ;
-    m_strings.Remove( n ) ;
+    m_strings.RemoveAt( n ) ;
     m_datas.RemoveAt( n ) ;
     SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
 }
@@ -177,8 +177,12 @@ void wxChoice::SetString(int n, const wxString& s)
 
 wxString wxChoice::GetString(int n) const
 {
+    wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), _T(""),
+                    _T("wxChoice::GetString(): invalid index") );
+
     return m_strings[n] ;
 }
+
 // ----------------------------------------------------------------------------
 // client data
 // ----------------------------------------------------------------------------