]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/combobox.mm
Handle the case of NSNotFound result properly.
[wxWidgets.git] / 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,