From cc7343106df962079f7b8eaaefbc0514428d3f2a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 10 Jul 2001 15:16:55 +0000 Subject: [PATCH] fix for crash when clicking below the items git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 6747342856..a306732993 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2649,7 +2649,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event ) int y = event.GetY(); CalcUnscrolledPosition( x, y, &x, &y ); - /* Did we actually hit an item ? */ + // where did we hit it (if we did)? long hitResult = 0; size_t count = GetItemCount(), @@ -2658,7 +2658,8 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event ) if ( HasFlag(wxLC_REPORT) ) { current = y / GetLineHeight(); - hitResult = HitTestLine(current, x, y); + if ( current < count ) + hitResult = HitTestLine(current, x, y); } else // !report {