[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);
- [lmi-commits] [lmi] master updated (6fbb81b -> df0e283), Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master a6e446f 1/8: Move nested-class forward declaration, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master df0e283 8/8: Initialize variable at declaration; simplify logic; clarify commentary, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master f6c8fa6 6/8: Add and use const accessors, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master 124dd7b 7/8: Expunge a simulation of a const accessor,
Greg Chicares <=
- [lmi-commits] [lmi] master 93ee33f 2/8: Rename a member variable, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master c88b192 5/8: Rename member variables, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master 1750a86 3/8: Add const accessors, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master 30286c5 4/8: Use const accessors, Greg Chicares, 2018/04/27