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.
This commit is contained in:
Vadim Zeitlin
2020-04-13 17:48:15 +02:00
parent da84a25311
commit 39d0c21a81

View File

@@ -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);
}
}