From c7707a16c7f854514268940695ccca44ef52e02f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 1 Feb 2020 01:57:04 +0100 Subject: [PATCH] Simplify check for current cell in Home/End handling code Prefer to just test whether we have it instead of breaking out of the case if we don't, this is slightly more straightforward. No real changes. --- src/generic/grid.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 4fbe07fb69..19359643e7 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -5563,10 +5563,8 @@ void wxGrid::OnKeyDown( wxKeyEvent& event ) break; case WXK_HOME: + if ( m_currentCellCoords != wxGridNoCellCoords ) { - if ( m_currentCellCoords == wxGridNoCellCoords ) - break; - const bool useSelectedBlockCorner = event.ShiftDown() && m_selectedBlockCorner != wxGridNoCellCoords; int row = useSelectedBlockCorner ? m_selectedBlockCorner.GetRow() @@ -5606,10 +5604,8 @@ void wxGrid::OnKeyDown( wxKeyEvent& event ) break; case WXK_END: + if ( m_currentCellCoords != wxGridNoCellCoords ) { - if ( m_currentCellCoords == wxGridNoCellCoords ) - break; - const bool useSelectedBlockCorner = event.ShiftDown() && m_selectedBlockCorner != wxGridNoCellCoords; int row = useSelectedBlockCorner ? m_selectedBlockCorner.GetRow()