[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 4cfcfe4 07/15: Refactor: remove render_page_t
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 4cfcfe4 07/15: Refactor: remove render_page_template() helper function |
Date: |
Fri, 27 Jul 2018 17:23:16 -0400 (EDT) |
branch: master
commit 4cfcfe4e1918231d5b0459ac163a922977802b18
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Refactor: remove render_page_template() helper function
No real changes, just remove a trivial helper function as is not
actually that useful and while it's being used in two places right now,
this won't be the case any longer with the upcoming pagination changes
and it's not worth keeping it to just call it from a single place.
---
ledger_pdf_generator_wx.cpp | 35 +++++++++++------------------------
1 file changed, 11 insertions(+), 24 deletions(-)
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 9c57b1b..5cc4a56 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -669,25 +669,6 @@ class page
) = 0;
protected:
- // Helper method for rendering the contents of the given external template,
- // which is expected to be found in the file with the provided name and
- // ".mst" extension in the data directory.
- //
- // Return the height of the page contents.
- int render_page_template
- (std::string const& template_name
- ,pdf_writer_wx& writer
- ,html_interpolator const& interpolate_html
- )
- {
- return writer.output_html
- (writer.get_horz_margin()
- ,writer.get_vert_margin()
- ,writer.get_page_width()
- ,interpolate_html.expand_template(template_name)
- );
- }
-
// The associated illustration, which will be non-null by the time our
// virtual methods such as pre_render() and render() are called.
pdf_illustration const* illustration_ = nullptr;
@@ -931,10 +912,11 @@ class cover_page : public page
,html_interpolator const& interpolate_html
) override
{
- int const height_contents = render_page_template
- ("cover"
- ,writer
- ,interpolate_html
+ int const height_contents = writer.output_html
+ (writer.get_horz_margin()
+ ,writer.get_vert_margin()
+ ,writer.get_page_width()
+ ,interpolate_html.expand_template("cover")
);
// There is no way to draw a border around the page contents in wxHTML
@@ -1229,7 +1211,12 @@ class standard_page : public numbered_page
{
numbered_page::render(ledger, writer, interpolate_html);
- render_page_template(page_template_name_, writer, interpolate_html);
+ writer.output_html
+ (writer.get_horz_margin()
+ ,writer.get_vert_margin()
+ ,writer.get_page_width()
+ ,interpolate_html.expand_template(page_template_name_)
+ );
}
private:
- [lmi-commits] [lmi] master 6465704 04/15: Restore the use of wxDCClipper in PDF table generation code, (continued)
- [lmi-commits] [lmi] master 6465704 04/15: Restore the use of wxDCClipper in PDF table generation code, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master a8d5e26 08/15: Look for image files referenced in templates under data directory, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 005b3eb 06/15: Replace pdf_writer_wx::get_page_height() with get_total_height(), Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 28e3c42 11/15: Remove workarounds for wx 3.1.1 warnings not relevant any more, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master b6b6827 03/15: Do call EndPage() in PDF generation code, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master a86d90a 02/15: Use more recent wxPdfDocument fixing the text origin bug, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 554eb23 13/15: Forbid page breaks inside paragraphs in the illustrations, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 271db22 14/15: Fix over eager assert in pdf_writer_wx::output_html(), Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 12d84c9 15/15: Fix regression in font sizes used for the group quotes PDF, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 2bd38fa 12/15: Use standard <img> tag instead of <scaled_image> in templates, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 4cfcfe4 07/15: Refactor: remove render_page_template() helper function,
Greg Chicares <=
- [lmi-commits] [lmi] master e821acd 05/15: Require specifying font sizes when using pdf_writer_wx, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master c56a67f 09/15: Implement and use simple HTML output pagination, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master f03ff64 10/15: Merge first two notes pages of regular individual illustrations, Greg Chicares, 2018/07/27