From 37471696602f2b30fa495b9bc64ffb939bda164a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 28 Jun 2020 22:53:10 +0200 Subject: [PATCH] Remove apparently unnecessary wxGrid::m_inOnKeyDown Although this variable, and a check for it in OnKeyDown(), was present since the first version of this code added back in f85afd4e46 (Added new wxGrid classes[...], 1999-10-06), there doesn't seem to be any indication that it has ever been needed, so remove it to simplify the code and make it possible to add early returns to this function easily. No real changes yet. --- include/wx/generic/grid.h | 1 - src/generic/grid.cpp | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 40c8e74bc4..cbdf6a0904 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -2520,7 +2520,6 @@ protected: wxGridCellAttr* m_defaultCellAttr; - bool m_inOnKeyDown; int m_batchCount; diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 1c19408e47..bad5babbb9 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -2887,7 +2887,6 @@ void wxGrid::Init() m_editable = true; // default for whole grid - m_inOnKeyDown = false; m_batchCount = 0; m_extraWidth = @@ -5639,15 +5638,6 @@ void wxGrid::OnDPIChanged(wxDPIChangedEvent& event) void wxGrid::OnKeyDown( wxKeyEvent& event ) { - if ( m_inOnKeyDown ) - { - // shouldn't be here - we are going round in circles... - // - wxFAIL_MSG( wxT("wxGrid::OnKeyDown called while already active") ); - } - - m_inOnKeyDown = true; - // propagate the event up and see if it gets processed wxWindow *parent = GetParent(); wxKeyEvent keyEvt( event ); @@ -5954,8 +5944,6 @@ void wxGrid::OnKeyDown( wxKeyEvent& event ) break; } } - - m_inOnKeyDown = false; } void wxGrid::OnKeyUp( wxKeyEvent& WXUNUSED(event) )