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.
This commit is contained in:
Vadim Zeitlin
2020-02-01 01:57:04 +01:00
parent 7fa9416fb4
commit c7707a16c7

View File

@@ -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()