From 181747f462ef4d7d2dfe4fb9a868786d53b702d4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 28 Jun 2020 00:21:23 +0200 Subject: [PATCH] Remove useless IsCellEditControlEnabled() checks There is no need to do this before calling DisableCellEditControl() as it won't do anything if the cell edit control is already disabled. --- src/generic/grid.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 258b4c33b8..9872f367ee 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -5222,8 +5222,7 @@ void wxGrid::ClearGrid() { if ( m_table ) { - if (IsCellEditControlEnabled()) - DisableCellEditControl(); + DisableCellEditControl(); m_table->Clear(); if ( ShouldRefresh() ) @@ -5240,8 +5239,7 @@ wxGrid::DoModifyLines(bool (wxGridTableBase::*funcModify)(size_t, size_t), if ( !m_table ) return false; - if ( IsCellEditControlEnabled() ) - DisableCellEditControl(); + DisableCellEditControl(); return (m_table->*funcModify)(pos, num);