]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/checklst.cpp
don't compare invalid iterators/node pointers
[wxWidgets.git] / src / univ / checklst.cpp
index 6ed02a5f9c28b25ebf8b1551fe134d7001b07146..384d39359c10620a3f253a29dcda387b6b4e7035 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        univ/checklst.cpp
+// Name:        src/univ/checklst.cpp
 // Purpose:     wxCheckListBox implementation
 // Author:      Vadim Zeitlin
 // Modified by:
 // Purpose:     wxCheckListBox implementation
 // Author:      Vadim Zeitlin
 // Modified by:
 // headers
 // ----------------------------------------------------------------------------
 
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "univchecklst.h"
-#endif
-
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
@@ -136,7 +132,7 @@ void wxCheckListBox::Check(size_t item, bool check)
 
 void wxCheckListBox::Delete(int n)
 {
 
 void wxCheckListBox::Delete(int n)
 {
-    wxCHECK_RET( n < GetCount(), _T("invalid index in wxListBox::Delete") );
+    wxCHECK_RET( IsValid(n), _T("invalid index in wxListBox::Delete") );
 
     wxListBox::Delete(n);
 
 
     wxListBox::Delete(n);
 
@@ -269,7 +265,7 @@ bool wxStdCheckListboxInputHandler::HandleMouse(wxInputConsumer *consumer,
         if ( x >= 0 &&
              x < renderer->GetCheckBitmapSize().x &&
              item >= 0 &&
         if ( x >= 0 &&
              x < renderer->GetCheckBitmapSize().x &&
              item >= 0 &&
-             item < lbox->GetCount() )
+             (size_t)item < lbox->GetCount() )
         {
             lbox->PerformAction(wxACTION_CHECKLISTBOX_TOGGLE, item);
 
         {
             lbox->PerformAction(wxACTION_CHECKLISTBOX_TOGGLE, item);