From 2c755d9bbf4c786a03cf6193c630fc986a69f802 Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Wed, 20 Jan 2010 02:07:22 +0000 Subject: [PATCH] Handle the case of NSNotFound result properly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/combobox.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/combobox.mm b/src/osx/cocoa/combobox.mm index 0438d14866..56ce4b05ca 100644 --- a/src/osx/cocoa/combobox.mm +++ b/src/osx/cocoa/combobox.mm @@ -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, -- 2.47.2