>From b259c417fc1c8efccbc9a56bf335f403c9ad0ac0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 27 Aug 2015 19:44:19 +0200 Subject: [PATCH] No real changes, just rename header_data to global_report_data. The data in ex-header_data didn't appear only in the header but also in the footer and writing header_.footer_ was confusing, so avoid it by renaming the struct and the variable containing it to a more neutral name. --- group_quote_pdf_gen_wx.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/group_quote_pdf_gen_wx.cpp b/group_quote_pdf_gen_wx.cpp index 180315c..bb769d6 100644 --- a/group_quote_pdf_gen_wx.cpp +++ b/group_quote_pdf_gen_wx.cpp @@ -229,10 +229,10 @@ class group_quote_pdf_generator_wx ,enum_output_mode output_mode = e_output_normal ); - struct header_data + struct global_report_data { // Extract header fields from a ledger. - void fill_header_data(LedgerInvariant const& ledger); + void fill_global_report_data(LedgerInvariant const& ledger); std::string company_; std::string prepared_by_; @@ -244,7 +244,7 @@ class group_quote_pdf_generator_wx std::string contract_state_; std::string footer_; }; - header_data header_; + global_report_data report_data_; struct row_data { @@ -306,7 +306,7 @@ group_quote_pdf_generator_wx::group_quote_pdf_generator_wx() { } -void group_quote_pdf_generator_wx::header_data::fill_header_data +void group_quote_pdf_generator_wx::global_report_data::fill_global_report_data (LedgerInvariant const& ledger ) { @@ -328,9 +328,9 @@ void group_quote_pdf_generator_wx::add_ledger(Ledger const& ledger) // We suppose that header data is the same for all ledgers, so only fill it // once. - if(header_.company_.empty()) + if(report_data_.company_.empty()) { - header_.fill_header_data(Invar); + report_data_.fill_global_report_data(Invar); } int const year = 0; @@ -530,7 +530,7 @@ void group_quote_pdf_generator_wx::do_generate_pdf(wxPdfDC& pdf_dc) LMI_ASSERT(header.find("%s") != std::string::npos); header = wxString::Format - (wxString(header), header_.premium_mode_ + (wxString(header), report_data_.premium_mode_ ).ToStdString(); } break; @@ -697,7 +697,7 @@ void group_quote_pdf_generator_wx::do_generate_pdf(wxPdfDC& pdf_dc) wxDCTextColourChanger set_white_text(pdf_dc, *wxWHITE); wxString const image_text - (header_.company_ + (report_data_.company_ + "\nPremium & Benefit Summary" ); @@ -731,9 +731,9 @@ void group_quote_pdf_generator_wx::do_generate_pdf(wxPdfDC& pdf_dc) "Prepared By: %s" "" "" - ,header_.company_ + ,report_data_.company_ ,wxDateTime::Today().FormatDate() - ,header_.prepared_by_ + ,report_data_.prepared_by_ ); output_html(html_parser, horz_margin, *pos_y, page_.width_ / 2, title_html); @@ -771,12 +771,12 @@ void group_quote_pdf_generator_wx::do_generate_pdf(wxPdfDC& pdf_dc) "" "" ,wxDateTime::Today().FormatDate() - ,header_.plan_type_ - ,header_.guarantee_issue_max_ - ,header_.premium_mode_ - ,header_.product_ - ,header_.contract_state_ - ,header_.available_riders_ + ,report_data_.plan_type_ + ,report_data_.guarantee_issue_max_ + ,report_data_.premium_mode_ + ,report_data_.product_ + ,report_data_.contract_state_ + ,report_data_.available_riders_ ,row_num_ - 1 // "- 1": don't count the composite. ); @@ -913,7 +913,7 @@ void group_quote_pdf_generator_wx::do_generate_pdf(wxPdfDC& pdf_dc) *pos_y += logo_image.GetSize().y + vert_skip; } - wxString const footer_html = "

" + header_.footer_ + "

"; + wxString const footer_html = "

" + report_data_.footer_ + "

"; *pos_y += output_html (html_parser -- 2.1.0