lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 124dd7b 7/8: Expunge a simulation of a const


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 124dd7b 7/8: Expunge a simulation of a const accessor
Date: Fri, 27 Apr 2018 10:52:49 -0400 (EDT)

branch: master
commit 124dd7b95dfb6b0e55950af1f3ff6a897a663ec7
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Expunge a simulation of a const accessor
    
    Got rid of a local const variable that formerly served the role of a
    const accessor. Now that a true const accessor is available, that
    variable had become a superfluous alias that was actually a barrier
    to tracing the data flow.
---
 wx_table_generator.cpp | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 411bb60..0c67124 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -657,8 +657,6 @@ void wx_table_generator::do_output_values
             continue;
             }
 
-        int const width = ci.col_width();
-
         std::string const& s = values[col];
         if(!s.empty())
             {
@@ -666,14 +664,14 @@ void wx_table_generator::do_output_values
 
             if(align_right_)
                 {
-                x_text += width - dc_.GetTextExtent(s).x;
+                x_text += ci.col_width() - dc_.GetTextExtent(s).x;
                 }
             else
                 {
                 if(ci.is_centered())
                     {
                     // Centre the text for the columns configured to do it.
-                    x_text += (width - dc_.GetTextExtent(s).x) / 2;
+                    x_text += (ci.col_width() - dc_.GetTextExtent(s).x) / 2;
                     }
                 else
                     {
@@ -693,7 +691,7 @@ void wx_table_generator::do_output_values
                     (dc_
                     ,wxRect
                         {wxPoint{x, y_top}
-                        ,wxSize{width - column_margin(), row_height_}
+                        ,wxSize{ci.col_width() - column_margin(), row_height_}
                         }
                     );
 
@@ -704,7 +702,7 @@ void wx_table_generator::do_output_values
                 do_output();
                 }
             }
-        x += width;
+        x += ci.col_width();
         if(draw_separators_)
             {
             do_output_vert_separator(x, y_top, y);



reply via email to

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