X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b26b60fac70f89cf33935f78469e27536d8b614..99e8cb505ad94704ec6596d20842ca8fa34e7d9e:/src/mac/carbon/choice.cpp?ds=sidebyside diff --git a/src/mac/carbon/choice.cpp b/src/mac/carbon/choice.cpp index 86d75eb0da..c187d9ecc7 100644 --- a/src/mac/carbon/choice.cpp +++ b/src/mac/carbon/choice.cpp @@ -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 // ----------------------------------------------------------------------------