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:
Kevin Ollivier 2010-01-20 02:07:22 +00:00
parent 9584818ae9
commit 2c755d9bbf

View File

@ -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,