]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/lboxcmn.cpp
fixed incorrectly inversed test for parent [not] being deleted (patch 1624472)
[wxWidgets.git] / src / common / lboxcmn.cpp
index 6350c107f29b0a2b6adf95d69daa7e21facb0d9b..218ba8a71adf0459c32c3aad7dcc955f01d43aac 100644 (file)
 
 #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);