lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master f82b136 31/46: Remove unnecessary make_cell_n


From: Greg Chicares
Subject: [lmi-commits] [lmi] master f82b136 31/46: Remove unnecessary make_cell_number_column_read_only() function
Date: Wed, 22 Jul 2020 11:05:14 -0400 (EDT)

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

    Remove unnecessary make_cell_number_column_read_only() function
    
    This function is simple and was called only once after the changes of
    the previous commit, so simply inline it into its caller.
---
 census_view.cpp | 28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/census_view.cpp b/census_view.cpp
index 32b5206..4adb583 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -1482,13 +1482,7 @@ class CensusViewGridTable
     // Cell serial number: always shown in the first column.
     static int const Col_CellNum = 0;
 
-    explicit CensusViewGridTable(CensusGridView& view)
-        :view_ {view}
-    {
-        wxGrid const* grid = view.grid_window_;
-        SetAttrProvider(new(wx) CensusViewGridCellAttrProvider(grid));
-        make_cell_number_column_read_only();
-    }
+    explicit CensusViewGridTable(CensusGridView& view);
 
     // return the number of rows and columns in this table.
     int GetNumberRows() override;
@@ -1508,8 +1502,6 @@ class CensusViewGridTable
 
     wxString GetColLabelValue(int col) override;
 
-    void make_cell_number_column_read_only();
-
     std::string const& col_name(int col) const;
 
     Input& row_at(int row);
@@ -1538,6 +1530,17 @@ class CensusViewGridTable
     std::vector<int> visible_columns_;
 };
 
+CensusViewGridTable::CensusViewGridTable(CensusGridView& view)
+    :view_ {view}
+{
+    wxGrid const* grid = view.grid_window_;
+    SetAttrProvider(new(wx) CensusViewGridCellAttrProvider(grid));
+
+    auto attr = new(wx) wxGridCellAttr();
+    attr->SetReadOnly();
+    SetColAttr(attr, 0);
+}
+
 int CensusViewGridTable::GetNumberRows()
 {
     return lmi::ssize(view_.cell_parms());
@@ -1708,13 +1711,6 @@ bool CensusViewGridTable::DeleteCols(size_t pos, size_t 
num_cols)
     return true;
 }
 
-void CensusViewGridTable::make_cell_number_column_read_only()
-{
-    auto attr = new(wx) wxGridCellAttr();
-    attr->SetReadOnly();
-    SetColAttr(attr, 0);
-}
-
 inline std::string const& CensusViewGridTable::col_name(int col) const
 {
     LMI_ASSERT(0 < col);



reply via email to

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