Handle the case of NSNotFound result properly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
9584818ae9
commit
2c755d9bbf
@ -124,7 +124,10 @@ wxString wxNSComboBoxControl::GetStringAtIndex(int pos) const
|
||||
|
||||
int wxNSComboBoxControl::FindString(const wxString& text) const
|
||||
{
|
||||
return [m_comboBox indexOfItemWithObjectValue:wxCFStringRef( text , m_wxPeer->GetFont().GetEncoding() ).AsNSString()];
|
||||
int result = [m_comboBox indexOfItemWithObjectValue:wxCFStringRef( text , m_wxPeer->GetFont().GetEncoding() ).AsNSString()];
|
||||
if (result == NSNotFound)
|
||||
result = wxNOT_FOUND;
|
||||
return result;
|
||||
}
|
||||
|
||||
wxWidgetImplType* wxWidgetImpl::CreateComboBox( wxWindowMac* wxpeer,
|
||||
|
Loading…
Reference in New Issue
Block a user