Since we use C-style casts to grab the pointer from an item id, we can return an invalid item if the control has extra items appended.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier
2008-04-08 00:31:44 +00:00
parent 47788d7b6c
commit 77da448aff

View File

@@ -1995,7 +1995,7 @@ wxListCtrl::HitTest(const wxPoint& point, int& flags, long *ptrSubItem) const
m_dbImpl->GetItemID( (DataBrowserTableViewRowIndex) row, &id );
// TODO: Use GetDataBrowserItemPartBounds to return if we are in icon or label
if ( !(GetWindowStyleFlag() & wxLC_VIRTUAL ) )
if ( !(GetWindowStyleFlag() & wxLC_VIRTUAL ) && row < GetItemCount() )
{
wxMacListCtrlItem* lcItem;
lcItem = (wxMacListCtrlItem*) id;