lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 810de0a 26/46: Remove unnecessary wxGrid::IsC


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 810de0a 26/46: Remove unnecessary wxGrid::IsCellEditControlEnabled() calls
Date: Wed, 22 Jul 2020 11:05:13 -0400 (EDT)

branch: master
commit 810de0a35174efef2173f6ba5ea81cb338c7eefe
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Vadim Zeitlin <vadim@tt-solutions.com>

    Remove unnecessary wxGrid::IsCellEditControlEnabled() calls
    
    There is no need to check for the edit control being enabled before
    calling DisableCellEditControl(), the latter simply won't do anything if
    there is no edit control to disable.
---
 census_view.cpp | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/census_view.cpp b/census_view.cpp
index e37eda6..453d4b3 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -2253,10 +2253,7 @@ void CensusGridView::update_visible_columns()
 
         wxGridUpdateLocker grid_update_locker(grid_window_);
 
-        if(grid_window_->IsCellEditControlEnabled())
-            {
-            grid_window_->DisableCellEditControl();
-            }
+        grid_window_->DisableCellEditControl();
 
         grid_table_->set_visible_columns(std::move(new_visible_columns));
 
@@ -3194,11 +3191,7 @@ void CensusGridView::UponPasteCensus(wxCommandEvent&)
 
     wxGridUpdateLocker grid_update_locker(grid_window_);
     grid_window_->ClearSelection();
-
-    if(grid_window_->IsCellEditControlEnabled())
-        {
-        grid_window_->DisableCellEditControl();
-        }
+    grid_window_->DisableCellEditControl();
 
     if(old_rows != new_rows || old_cols != new_cols)
         {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]