]> git.saurik.com Git - wxWidgets.git/commitdiff
Handle the case of NSNotFound result properly.
authorKevin Ollivier <kevino@theolliviers.com>
Wed, 20 Jan 2010 02:07:22 +0000 (02:07 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Wed, 20 Jan 2010 02:07:22 +0000 (02:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/combobox.mm

index 0438d1486608bbdc1bb449916ef9b82d3430e514..56ce4b05ca3bd6577129e912c4c073df85c97845 100644 (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,