diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index ca7866655a..9675f1f117 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -390,46 +390,10 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData) int wxListBox::FindString(const wxString& s, bool bCase) const { - if ( s.Right(1) == wxT("*") ) + for ( size_t i = 0 ; i < m_noItems ; ++ i ) { - wxString search = s.Left( s.length() - 1 ) ; - int len = search.length() ; - Str255 s1 , s2 ; - wxMacStringToPascal( search , s2 ) ; - - for ( unsigned int i = 0 ; i < m_noItems ; ++ i ) - { - wxMacStringToPascal( m_stringArray[i].Left( len ) , s1 ) ; - - if ( EqualString( s1 , s2 , bCase , false ) ) - return (int)i; - } - - if ( s.Left(1) == wxT("*") && s.length() > 1 ) - { - wxString st = s ; - st.MakeLower() ; - - for ( unsigned int i = 0 ; i < m_noItems ; ++i ) - { - if (GetString(i).Lower().Matches(st) ) - return (int)i ; - } - } - } - else - { - Str255 s1 , s2 ; - - wxMacStringToPascal( s , s2 ) ; - - for ( unsigned int i = 0 ; i < m_noItems ; ++ i ) - { - wxMacStringToPascal( m_stringArray[i] , s1 ) ; - - if ( EqualString( s1 , s2 , bCase , false ) ) - return (int)i ; - } + if (s.IsSameAs(GetString(i), bCase)) + return (int)i ; } return wxNOT_FOUND;