lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 7ed2bbf 027/156: Simplify footer generation c


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 7ed2bbf 027/156: Simplify footer generation code by moving font tag outside
Date: Tue, 30 Jan 2018 17:22:00 -0500 (EST)

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

    Simplify footer generation code by moving font tag outside
    
    Put the entire table inside a <font size="-2"> tag instead of repeating
    it for all the table cells, which all use font of the same size.
---
 ledger_pdf_generator_wx.cpp | 78 ++++++++++++++++++++-------------------------
 1 file changed, 35 insertions(+), 43 deletions(-)

diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 2223db0..d4b54c2 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -466,72 +466,64 @@ class page_with_footer : public page
         ) override
     {
         auto footer_html =
-            tag::table[attr::width("100%")]
-                      [attr::cellspacing("0")]
-                      [attr::cellpadding("0")]
-                (tag::tr
-                    (tag::td[attr::colspan("3")]
-                        (text::nbsp())
+            tag::font[attr::size("-2")]
+                (tag::table[attr::width("100%")]
+                          [attr::cellspacing("0")]
+                          [attr::cellpadding("0")]
+                    (tag::tr
+                        (tag::td[attr::colspan("3")]
+                            (text::nbsp())
+                        )
                     )
-                )
-                (tag::tr
-                    (tag::td
-                        (tag::font[attr::size("-2")]
+                    (tag::tr
+                        (tag::td
                             (interpolate_html
                                 ("Date Prepared: {{date_prepared}}"
                                 )
                             )
                         )
-                    )
-                    (tag::td[attr::align("center")]
-                        (tag::font[attr::size("-2")]
+                        (tag::td[attr::align("center")]
                             (text::from(get_footer_contents())
                             )
                         )
-                    )
-                    (tag::td[attr::align("right")]
-                        (tag::font[attr::size("-2")]
+                        (tag::td[attr::align("right")]
                             (interpolate_html
                                 ("{{InsCoName}}"
                                 )
                             )
                         )
                     )
-                )
-                (tag::tr
-                    (tag::td
-                        (tag::font[attr::size("-2")]
+                    (tag::tr
+                        (tag::td
                             (interpolate_html
                                 ("System Version: {{lmi_version}}"
                                 )
                             )
                         )
-                    )
-                    (tag::td
-                        (text::nbsp()
+                        (tag::td
+                            (text::nbsp()
+                            )
                         )
-                    )
-                    (tag::td[attr::align("right")]
-                        (tag::font[attr::size("-2")]
+                        (tag::td[attr::align("right")]
                             (interpolate_html
                                 (R"(
-{{#IsInforce}}
-    {{#Composite}}
-        {{ImprimaturInforceComposite}}
-    {{/Composite}}
-    {{^Composite}}
-        {{ImprimaturInforce}}
-    {{/Composite}}
-{{/IsInforce}}
-{{^IsInforce}}
-    {{#Composite}}
-        {{ImprimaturPresaleComposite}}
-    {{/Composite}}
-    {{^Composite}}
-        {{ImprimaturPresale}}
-    {{/Composite}}
-{{/IsInforce}}
-)"
+    {{#IsInforce}}
+        {{#Composite}}
+            {{ImprimaturInforceComposite}}
+        {{/Composite}}
+        {{^Composite}}
+            {{ImprimaturInforce}}
+        {{/Composite}}
+    {{/IsInforce}}
+    {{^IsInforce}}
+        {{#Composite}}
+            {{ImprimaturPresaleComposite}}
+        {{/Composite}}
+        {{^Composite}}
+            {{ImprimaturPresale}}
+        {{/Composite}}
+    {{/IsInforce}}
+    )"
                                 )
                             )
                         )



reply via email to

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