lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] odd/foliation 5049184 1/2: Prepare to number cover p


From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/foliation 5049184 1/2: Prepare to number cover pages
Date: Tue, 23 Apr 2019 12:17:27 -0400 (EDT)

branch: odd/foliation
commit 5049184d1dcbef4df06fddad2ef828e83c1e2308
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Prepare to number cover pages
    
    Eventually, option (D) here:
      https://lists.nongnu.org/archive/html/lmi/2018-11/msg00045.html
    will be wanted for all ledger types, though it is better not to change
    'finra' illustrations yet. For option (D), the cover page class's place
    in the inheritance tree needs to change, requiring a change in its
    location in the code. This preparatory commit encompasses all changes
    that can be trivially reviewed with '--color-moved=plain'. Changing
    the order of the add<cover_page> and start_numbering() lines has no
    effect yet because class cover_page is not yet a numbered_page.
---
 pdf_command_wx.cpp | 67 +++++++++++++++++++++++++++---------------------------
 1 file changed, 34 insertions(+), 33 deletions(-)

diff --git a/pdf_command_wx.cpp b/pdf_command_wx.cpp
index d2de0f4..32369c8 100644
--- a/pdf_command_wx.cpp
+++ b/pdf_command_wx.cpp
@@ -1004,37 +1004,6 @@ class pdf_illustration : protected html_interpolator, 
protected pdf_writer_wx
     std::vector<std::unique_ptr<logical_page>> pages_;
 };
 
-// Cover page used by several different illustration kinds.
-class cover_page : public logical_page
-{
-  public:
-    using logical_page::logical_page;
-
-    void render() override
-    {
-        int const height_contents = writer_.output_html
-            (writer_.get_horz_margin()
-            ,writer_.get_vert_margin()
-            ,writer_.get_page_width()
-            ,interpolator_.expand_template("cover")
-            );
-
-        // There is no way to draw a border around the page contents in wxHTML
-        // currently, so do it manually.
-        auto& pdf_dc = writer_.dc();
-
-        pdf_dc.SetPen(wxPen(illustration_rule_color, 2));
-        pdf_dc.SetBrush(*wxTRANSPARENT_BRUSH);
-
-        pdf_dc.DrawRectangle
-            (writer_.get_horz_margin()
-            ,writer_.get_vert_margin()
-            ,writer_.get_page_width()
-            ,height_contents
-            );
-    }
-};
-
 // Base class for all pages with a footer and/or header, collectively called
 // "marginals".
 class page_with_marginals : public logical_page
@@ -1331,6 +1300,37 @@ class numbered_page : public page_with_marginals
     int               extra_pages_      {0};
 };
 
+// Cover page used by several different illustration kinds.
+class cover_page : public logical_page
+{
+  public:
+    using logical_page::logical_page;
+
+    void render() override
+    {
+        int const height_contents = writer_.output_html
+            (writer_.get_horz_margin()
+            ,writer_.get_vert_margin()
+            ,writer_.get_page_width()
+            ,interpolator_.expand_template("cover")
+            );
+
+        // There is no way to draw a border around the page contents in wxHTML
+        // currently, so do it manually.
+        auto& pdf_dc = writer_.dc();
+
+        pdf_dc.SetPen(wxPen(illustration_rule_color, 2));
+        pdf_dc.SetBrush(*wxTRANSPARENT_BRUSH);
+
+        pdf_dc.DrawRectangle
+            (writer_.get_horz_margin()
+            ,writer_.get_vert_margin()
+            ,writer_.get_page_width()
+            ,height_contents
+            );
+    }
+};
+
 // Simplest possible page which is entirely defined by its external template
 // whose name must be specified when constructing it.
 class standard_page : public numbered_page
@@ -2287,8 +2287,8 @@ class pdf_illustration_naic : public pdf_illustration
             );
 
         // Add all the pages.
-        add<cover_page>();
         numbered_page::start_numbering();
+        add<cover_page>();
         add<standard_page>("ill_reg_narr_summary");
         add<standard_page>("ill_reg_narr_summary2");
         add<standard_page>("ill_reg_column_headings");
@@ -2840,6 +2840,7 @@ class pdf_illustration_finra : public pdf_illustration
 
         // Add all the pages.
         add<cover_page>();
+        // PDF !! For the moment, don't number this format's cover page.
         numbered_page::start_numbering();
         add<finra_basic>();
         add<finra_supplemental>();
@@ -2924,8 +2925,8 @@ class pdf_illustration_reg_d_group : public 
pdf_illustration
             );
 
         // Add all the pages.
-        add<cover_page>();
         numbered_page::start_numbering();
+        add<cover_page>();
         add<reg_d_group_basic>();
         add<standard_page>("reg_d_group_column_headings");
         add<standard_page>("reg_d_group_narr_summary");



reply via email to

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