X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad9835c97c10c0d7de345e3a7a7c0fc2776eb2cb..69659fd770f615210efac4b4fa741b3ad6223616:/src/common/lboxcmn.cpp diff --git a/src/common/lboxcmn.cpp b/src/common/lboxcmn.cpp index 6350c107f2..218ba8a71a 100644 --- a/src/common/lboxcmn.cpp +++ b/src/common/lboxcmn.cpp @@ -26,9 +26,10 @@ #if wxUSE_LISTBOX +#include "wx/listbox.h" + #ifndef WX_PRECOMP #include "wx/dynarray.h" - #include "wx/listbox.h" #include "wx/arrstr.h" #endif @@ -74,9 +75,9 @@ void wxListBoxBase::Set(int nItems, const wxString* items, void **clientData) bool wxListBoxBase::SetStringSelection(const wxString& s, bool select) { - int sel = FindString(s); - wxCHECK_MSG( sel != wxNOT_FOUND, false, - wxT("invalid string in SetStringSelection") ); + const int sel = FindString(s); + if ( sel == wxNOT_FOUND ) + return false; SetSelection(sel, select);