From 39d0c21a81b93534bec38c555bfacfeceb160df3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 13 Apr 2020 17:48:15 +0200 Subject: [PATCH] Do make Ctrl-clicked cell current There isn't really any valid reason to ever set the current cell to the corner of a block remaining after breaking up the currently selected block after the deselection of the just clicked cell, so don't do it. Just set the current cell to the clicked cell, whether it's selected or not. --- src/generic/grid.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index ce39521ed0..69de77cada 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4561,10 +4561,6 @@ wxGrid::DoGridCellLeftDown(wxMouseEvent& event, DisableCellEditControl(); MakeCellVisible( coords ); - // Whether we should move the current grid cell to the corrner of the - // last selected block. - bool goToLastBlock = false; - if ( event.CmdDown() && !event.ShiftDown() ) { if ( m_selection ) @@ -4583,8 +4579,6 @@ wxGrid::DoGridCellLeftDown(wxMouseEvent& event, wxGridBlockCoords(coords.GetRow(), coords.GetCol(), coords.GetRow(), coords.GetCol()), event); - - goToLastBlock = true; } } } @@ -4619,15 +4613,7 @@ wxGrid::DoGridCellLeftDown(wxMouseEvent& event, coords != wxGridNoCellCoords; } - if ( goToLastBlock && m_selection->IsSelection() ) - { - wxGridBlockCoords& lastBlock = m_selection->GetBlocks().back(); - SetCurrentCell(lastBlock.GetTopLeft()); - } - else - { - SetCurrentCell(coords); - } + SetCurrentCell(coords); } }