[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 087bdda: Stylistically rework penultimate com
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 087bdda: Stylistically rework penultimate commit 43dcd1b7 |
Date: |
Fri, 24 Aug 2018 11:00:16 -0400 (EDT) |
branch: master
commit 087bdda85fed4ffc9c8f9f53ce7d0f11c67aed0a
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Stylistically rework penultimate commit 43dcd1b7
See:
https://lists.nongnu.org/archive/html/lmi/2018-08/msg00036.html
---
report_table.hpp | 8 ++++----
wx_table_generator.cpp | 15 +++++++++------
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/report_table.hpp b/report_table.hpp
index ccbae02..0147223 100644
--- a/report_table.hpp
+++ b/report_table.hpp
@@ -88,10 +88,10 @@ class LMI_SO table_column_info
bool is_clipped() const {return is_elastic();}
private:
- std::string col_header_;
- int col_width_;
- oenum_h_align alignment_;
- bool is_elastic_;
+ std::string const col_header_;
+ int const col_width_;
+ oenum_h_align const alignment_;
+ bool const is_elastic_;
};
std::vector<int> LMI_SO apportion(std::vector<int> const& votes, int seats);
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 35ca797..be44227 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -66,15 +66,18 @@ wx_table_generator::wx_table_generator
,2 * one_em_
,one_puncsp
);
+
+ std::vector<table_column_info> resized_columns;
for(int j = 0; j < lmi::ssize(all_columns()); ++j)
{
- all_columns_[j] = table_column_info
+ resized_columns.emplace_back
(all_columns_[j].col_header()
,w [j]
,all_columns_[j].alignment()
,all_columns_[j].is_elastic() ? oe_elastic : oe_inelastic
);
}
+ all_columns_.swap(resized_columns);
// Set a pen with zero width to make grid lines thin,
// and round cap style so that they combine seamlessly.
@@ -114,15 +117,18 @@ wx_table_generator::wx_table_generator
,2 * one_em_
,one_puncsp
);
+
+ std::vector<table_column_info> resized_columns;
for(int j = 0; j < lmi::ssize(all_columns()); ++j)
{
- all_columns_[j] = table_column_info
+ resized_columns.emplace_back
(all_columns_[j].col_header()
,w [j]
,all_columns_[j].alignment()
,all_columns_[j].is_elastic() ? oe_elastic : oe_inelastic
);
}
+ all_columns_.swap(resized_columns);
dc_.SetPen(illustration_rule_color);
}
@@ -435,10 +441,7 @@ LMI_ASSERT(std::size_t(h / lh) == 1u +
count_newlines(z.header));
break;
}
- all_columns_.push_back
- (table_column_info
- (z.header, width, z.alignment, z.elasticity)
- );
+ all_columns_.emplace_back(z.header, width, z.alignment, z.elasticity);
}
void wx_table_generator::do_output_single_row
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [lmi] master 087bdda: Stylistically rework penultimate commit 43dcd1b7,
Greg Chicares <=