Avoid selecting all rows up to UINT_MAX in generic wxDataViewCtrl.
Shift clicking in a control with multiple selections without a previous current row attempted to select all rows from the current one up to UINT_MAX which resulted in a program freezing (and probably running out of memory in 64 bit builds). Fix this by explicitly checking for the absence of the current item. Closes #16582. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77941 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4359,6 +4359,13 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
|
|||||||
unsigned int lineFrom = oldCurrentRow,
|
unsigned int lineFrom = oldCurrentRow,
|
||||||
lineTo = current;
|
lineTo = current;
|
||||||
|
|
||||||
|
if ( lineFrom == static_cast<unsigned>(-1) )
|
||||||
|
{
|
||||||
|
// If we hadn't had any current row before, treat this as a
|
||||||
|
// simple click and select the new row only.
|
||||||
|
lineFrom = current;
|
||||||
|
}
|
||||||
|
|
||||||
if ( lineTo < lineFrom )
|
if ( lineTo < lineFrom )
|
||||||
{
|
{
|
||||||
lineTo = lineFrom;
|
lineTo = lineFrom;
|
||||||
|
Reference in New Issue
Block a user