]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
Include wx/pen.h according to precompiled headers of wx/wx.h (with other minor cleaning).
[wxWidgets.git] / src / msw / listctrl.cpp
index 24bee18da7051a64f5274f2725927feebbda48d2..33c6741c598186090c68dbabd29690c19557dbb9 100644 (file)
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/settings.h"
+    #include "wx/dcclient.h"
 #endif
 
 #include "wx/textctrl.h"
 #include "wx/imaglist.h"
 #include "wx/listctrl.h"
-#include "wx/dcclient.h"
 
 #include "wx/msw/private.h"
 
@@ -761,6 +761,10 @@ bool wxListCtrl::GetItem(wxListItem& info) const
 // Sets information about the item
 bool wxListCtrl::SetItem(wxListItem& info)
 {
+    const long id = info.GetId();
+    wxCHECK_MSG( id >= 0 && id < GetItemCount(), false,
+                 _T("invalid item index in SetItem") );
+
     LV_ITEM item;
     wxConvertToMSWListItem(this, info, item);
 
@@ -773,7 +777,7 @@ bool wxListCtrl::SetItem(wxListItem& info)
     {
         // get internal item data
         // perhaps a cache here ?
-        wxListItemInternalData *data = wxGetInternalData(this, info.m_itemId);
+        wxListItemInternalData *data = wxGetInternalData(this, id);
 
         if (! data)
         {