lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 7ccd207 087/156: Rename "footer_contents" to


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 7ccd207 087/156: Rename "footer_contents" to more precise "page_number"
Date: Tue, 30 Jan 2018 17:22:18 -0500 (EST)

branch: master
commit 7ccd207e0a865aaf9128e586f45b132ef24a1bc9
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>

    Rename "footer_contents" to more precise "page_number"
    
    This variable expands to a string containing just the page number (or
    the equivalent), so name it accordingly instead of wrongly implying that
    it might contain something else.
---
 footer.mustache             |  2 +-
 ledger_pdf_generator_wx.cpp | 22 +++++++++++-----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/footer.mustache b/footer.mustache
index d675000..a4cebb4 100644
--- a/footer.mustache
+++ b/footer.mustache
@@ -6,7 +6,7 @@
     </tr>
     <tr>
         <td>Date Prepared: {{date_prepared}}</td>
-        <td align="center">{{footer_contents}}</td>
+        <td align="center">{{page_number}}</td>
         <td align="right">{{InsCoName}}</td>
     </tr>
     <tr>
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 8d0be52..aacd259 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -868,29 +868,29 @@ class page_with_footer : public page
 
   private:
     // Method to be overridden in the base class which should actually return
-    // the contents of the (middle part of the) footer.
-    virtual std::string get_footer_contents() const = 0;
+    // the page number or equivalent string (e.g. "Appendix").
+    virtual std::string get_page_number() const = 0;
 
-    // This method uses get_footer_contents() and returns the HTML wrapping it
+    // This method uses get_page_number() and returns the HTML wrapping it
     // and other fixed information appearing in the footer.
     text get_footer_html(html_interpolator const& interpolate_html) const
     {
-        auto const contents = get_footer_contents();
+        auto const page_number_str = get_page_number();
 
         // Use our own interpolation function to handle the special
-        // "footer_contents" variable that is replaced with the actual
-        // (possibly dynamic) footer contents.
+        // "page_number" variable that is replaced with the actual
+        // (possibly dynamic) page number.
         return text::from_html
             (interpolate_string
                 ("{{>footer}}"
-                ,[contents, interpolate_html]
+                ,[page_number_str, interpolate_html]
                     (std::string const& s
                     ,interpolate_lookup_kind kind
                     ) -> std::string
                     {
-                    if(s == "footer_contents")
+                    if(s == "page_number")
                         {
-                        return contents;
+                        return page_number_str;
                         }
 
                     return interpolate_html.interpolation_func(s, kind);
@@ -906,7 +906,7 @@ class page_with_footer : public page
 class attachment_page : public page_with_footer
 {
   private:
-    std::string get_footer_contents() const override
+    std::string get_page_number() const override
     {
         return "Attachment";
     }
@@ -986,7 +986,7 @@ class numbered_page : public page_with_footer
         return 0;
     }
 
-    std::string get_footer_contents() const override
+    std::string get_page_number() const override
     {
         std::ostringstream oss;
         oss << "Page " << this_page_number_ << " of " << last_page_number_;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]