assert when the item index is out of range in wxMSW's listctrl, just like generic listctrl does

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-01-12 19:34:42 +00:00
parent be53e8ae80
commit 8d1a41016d
2 changed files with 5 additions and 1 deletions

View File

@@ -1162,6 +1162,10 @@ bool wxListCtrl::GetSubItemRect(long item, long subItem, wxRect& rect, int code)
(subItem >= 0 && subItem < GetColumnCount()),
false, _T("invalid sub item index") );
// use wxCHECK_MSG against "item" too, for coherency with the generic implementation:
wxCHECK_MSG( item >= 0 && item < GetItemCount(), false,
_T("invalid item in GetSubItemRect") );
int codeWin;
if ( code == wxLIST_RECT_BOUNDS )
codeWin = LVIR_BOUNDS;