[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master ab0c08d 5/5: Replace decayed-array arguments
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master ab0c08d 5/5: Replace decayed-array arguments with vectors |
Date: |
Wed, 25 Apr 2018 10:53:48 -0400 (EDT) |
branch: master
commit ab0c08dba9e71d72ff47de486d72946f4185a6ee
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Replace decayed-array arguments with vectors
---
group_quote_pdf_gen_wx.cpp | 2 +-
ledger_pdf_generator_wx.cpp | 4 ++--
wx_table_generator.cpp | 18 +++++++++---------
wx_table_generator.hpp | 8 ++++----
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/group_quote_pdf_gen_wx.cpp b/group_quote_pdf_gen_wx.cpp
index 1076110..3d71d89 100644
--- a/group_quote_pdf_gen_wx.cpp
+++ b/group_quote_pdf_gen_wx.cpp
@@ -763,7 +763,7 @@ void group_quote_pdf_generator_wx::save(std::string const&
output_filename)
for(auto const& i : rows_)
{
- table_gen.output_row(&pos_y, i.output_values.data());
+ table_gen.output_row(&pos_y, i.output_values);
if(last_row_y <= pos_y)
{
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 11adec1..378b315 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -1511,7 +1511,7 @@ class numeric_summary_table_cell
;
}
- table.output_row(&pos_y, output_values.data());
+ table.output_row(&pos_y, output_values);
break;
}
}
@@ -1638,7 +1638,7 @@ class page_with_tabular_report
;
}
- table.output_row(&pos_y, output_values.data());
+ table.output_row(&pos_y, output_values);
++year;
if(year == year_max)
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index ef630af..03c4ddd 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -414,9 +414,9 @@ void wx_table_generator::do_compute_column_widths()
}
void wx_table_generator::do_output_values
- (int& x
- ,int& y
- ,std::string const* values
+ (int& x
+ ,int& y
+ ,std::vector<std::string> const& values
)
{
int const y_top = y;
@@ -586,12 +586,12 @@ void wx_table_generator::output_header
int x = 0;
for(std::size_t line = 0; line < max_header_lines_; ++line)
{
- x = left_margin_;
- do_output_values
- (x
- ,*pos_y
- ,&headers_by_line.at(line * num_columns)
+ std::vector<std::string> const nth_line
+ (headers_by_line.begin() + line * num_columns
+ ,headers_by_line.begin() + (1 + line) * num_columns
);
+ x = left_margin_;
+ do_output_values(x, *pos_y, nth_line);
}
// Finally draw the separators above and (a double one) below them.
@@ -640,7 +640,7 @@ void wx_table_generator::output_super_header
void wx_table_generator::output_row
(int* pos_y
- ,std::string const* values
+ ,std::vector<std::string> const values
)
{
int x = left_margin_;
diff --git a/wx_table_generator.hpp b/wx_table_generator.hpp
index cf5de99..4f455e3 100644
--- a/wx_table_generator.hpp
+++ b/wx_table_generator.hpp
@@ -86,7 +86,7 @@ class wx_table_generator
// Render a row with the given values at the given position and update it.
// The values here can be single-line only and there must be exactly the
// same number of them as the number of columns.
- void output_row(int* pos_y, std::string const* values);
+ void output_row(int* pos_y, std::vector<std::string> const values);
// Render a single highlighted (by shading its background) cell with the
// given string displayed in it (always centered).
@@ -146,9 +146,9 @@ class wx_table_generator
void do_compute_column_widths();
void do_output_values
- (int& pos_x
- ,int& pos_y
- ,std::string const* values
+ (int& pos_x
+ ,int& pos_y
+ ,std::vector<std::string> const& values
);
wxDC& dc_;