[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 772f4a4 139/156: Refactor: use get_fixed_page
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 772f4a4 139/156: Refactor: use get_fixed_page_contents_template_name() |
Date: |
Tue, 30 Jan 2018 17:22:32 -0500 (EST) |
branch: master
commit 772f4a4aad5d4b14dd6ac7b031791d0cbf01d32c
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Refactor: use get_fixed_page_contents_template_name()
Instead of always (and not just "typically", as its comment said)
implementing pure virtual get_fixed_page_contents() method by returning
a string of the form "{{>template_name}}", replace it with the new
method which just returns the template name from which the page contents
HTML is then generated.
---
ledger_pdf_generator_wx.cpp | 47 ++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 24 deletions(-)
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 4fcc371..ef1bd4b 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -1610,9 +1610,8 @@ class page_with_tabular_report
}
protected:
- // Must be overridden to return the contents of the fixed page part. This
- // string will be interpolated and typically will be just "{{>template}}".
- virtual std::string get_fixed_page_contents() const = 0;
+ // Must be overridden to return the template containing the fixed page
part.
+ virtual std::string get_fixed_page_contents_template_name() const = 0;
// May be overridden to render (only if output_mode is e_output_normal)
// the extra headers just above the regular table headers.
@@ -1650,7 +1649,7 @@ class page_with_tabular_report
(writer.get_horz_margin()
,pos_y
,writer.get_page_width()
- ,interpolate_html(get_fixed_page_contents())
+ ,interpolate_html("{{>" + get_fixed_page_contents_template_name()
+ "}}")
,output_mode
);
@@ -1735,9 +1734,9 @@ class tabular_detail_page : public
page_with_tabular_report
,column_max
};
- std::string get_fixed_page_contents() const override
+ std::string get_fixed_page_contents_template_name() const override
{
- return "{{>tabular_details}}";
+ return "tabular_details";
}
std::string get_upper_footer_template_name() const override
@@ -1823,9 +1822,9 @@ class tabular_detail2_page : public
page_with_tabular_report
,column_max
};
- std::string get_fixed_page_contents() const override
+ std::string get_fixed_page_contents_template_name() const override
{
- return "{{>tabular_details2}}";
+ return "tabular_details2";
}
std::string get_upper_footer_template_name() const override
@@ -1870,9 +1869,9 @@ class standard_supplemental_report : public
page_with_tabular_report
return columns_;
}
- std::string get_fixed_page_contents() const override
+ std::string get_fixed_page_contents_template_name() const override
{
- return "{{>" + page_template_ + "}}";
+ return page_template_;
}
// Helper function used by the ctor to initialize the const columns_ field.
@@ -2252,9 +2251,9 @@ class page_with_basic_tabular_report : public
page_with_tabular_report
class nasd_basic : public page_with_basic_tabular_report
{
private:
- std::string get_fixed_page_contents() const override
+ std::string get_fixed_page_contents_template_name() const override
{
- return "{{>nasd_basic}}";
+ return "nasd_basic";
}
std::string get_two_column_header
@@ -2304,9 +2303,9 @@ class nasd_supplemental : public page_with_tabular_report
,column_max
};
- std::string get_fixed_page_contents() const override
+ std::string get_fixed_page_contents_template_name() const override
{
- return "{{>nasd_supplemental}}";
+ return "nasd_supplemental";
}
illustration_table_columns const& get_table_columns() const override
@@ -2389,9 +2388,9 @@ class nasd_assumption_detail : public
page_with_tabular_report
,column_max
};
- std::string get_fixed_page_contents() const override
+ std::string get_fixed_page_contents_template_name() const override
{
- return "{{>nasd_assumption_detail}}";
+ return "nasd_assumption_detail";
}
illustration_table_columns const& get_table_columns() const override
@@ -2492,9 +2491,9 @@ class pdf_illustration_nasd : public pdf_illustration
class reg_d_group_basic : public page_with_basic_tabular_report
{
private:
- std::string get_fixed_page_contents() const override
+ std::string get_fixed_page_contents_template_name() const override
{
- return "{{>reg_d_group_basic}}";
+ return "reg_d_group_basic";
}
std::string get_two_column_header
@@ -2661,9 +2660,9 @@ class reg_d_individual_guar_irr : public
reg_d_individual_irr_base
return base::guaranteed;
}
- std::string get_fixed_page_contents() const override
+ std::string get_fixed_page_contents_template_name() const override
{
- return "{{>reg_d_individual_guar_irr}}";
+ return "reg_d_individual_guar_irr";
}
illustration_table_columns const& get_table_columns() const override
@@ -2695,9 +2694,9 @@ class reg_d_individual_cur_irr : public
reg_d_individual_irr_base
return base::current;
}
- std::string get_fixed_page_contents() const override
+ std::string get_fixed_page_contents_template_name() const override
{
- return "{{>reg_d_individual_cur_irr}}";
+ return "reg_d_individual_cur_irr";
}
illustration_table_columns const& get_table_columns() const override
@@ -2739,9 +2738,9 @@ class reg_d_individual_cur : public
page_with_tabular_report
,column_max
};
- std::string get_fixed_page_contents() const override
+ std::string get_fixed_page_contents_template_name() const override
{
- return "{{>reg_d_individual_cur}}";
+ return "reg_d_individual_cur";
}
illustration_table_columns const& get_table_columns() const override
- [lmi-commits] [lmi] master 29865fc 133/156: Add supplemental report to NASD illustrations too, (continued)
- [lmi-commits] [lmi] master 29865fc 133/156: Add supplemental report to NASD illustrations too, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 919d796 001/156: Remove old XSL-FO-based PDF generation code, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master cc7fc05 143/156: Change template file extension from .mustache to .mst, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 08984bb 148/156: Recognize Mustache files in the coding rules test, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master de5a5c7 151/156: Fix interpolate_string_test build, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master bb5693e 136/156: Harmonize spacing in header in reg_d_group illustrations too, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 0c85a7a 154/156: Avoid using directive for the "html" namespace, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 463e8ca 138/156: Fix bug with page numbers in subsequent illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 830e1fd 130/156: Manually break column titles into lines, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 43859a6 053/156: Add support for "measure only" output mode to wx_table_generator, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 772f4a4 139/156: Refactor: use get_fixed_page_contents_template_name(),
Greg Chicares <=
- [lmi-commits] [lmi] master 81ccdc8 129/156: Remove the never used elements of the columns title map, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2478fbc 010/156: Start implementing PDF illustrations directly, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 9d24cd9 024/156: Compilation fix for C++11 but not C++14 compilers, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1229745 020/156: Make add_body_paragraph() even more convenient to use, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 14aca9e 142/156: Replace underscores in title map with explicit line breaks, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 5241f0f 045/156: Fix some typos in wx_table_generator::add_column() comment, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 47bddbf 155/156: Merge branch 'vz-no-xslfo' into gwc-no-xslfo, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master a1342a9 106/156: Fix supplemental NASD illustration page for split premiums, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master ec0b298 110/156: Add NASD illustration second explanatory notes page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 80423d2 134/156: Improve appearance of lower header part in NASD illustrations, Greg Chicares, 2018/01/30