lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 76881d8 019/156: Refactor: extra add_body_par


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 76881d8 019/156: Refactor: extra add_body_paragraph() helper
Date: Tue, 30 Jan 2018 17:21:53 -0500 (EST)

branch: master
commit 76881d8120980e9b06a1d82972f4c581f542a8ba
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>

    Refactor: extra add_body_paragraph() helper
    
    Introduce a function for performing a common task.
    
    No real changes.
---
 ledger_pdf_generator_wx.cpp | 28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index c3eb614..d27dfea 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -458,6 +458,12 @@ class narrative_summary_page : public page
                 )
             ;
 
+        // Just a helper performing a common operation.
+        auto const add_body_paragraph = [](text const& t) -> text
+            {
+            return tag::p(tag::font[attr::size("-1")](t));
+            };
+
         std::string description;
         if(!interpolate_html.test_variable("SinglePremium"))
             {
@@ -494,21 +500,14 @@ adjustable benefits, and single premium.
 )";
             }
 
-        summary_html +=
-            tag::p
-                (tag::font[attr::size("-1")]
-                    (interpolate_html(description.c_str())
-                    )
-                )
-            ;
+        summary_html += add_body_paragraph
+            (interpolate_html(description.c_str())
+            );
 
         if(!invar.IsInforce)
             {
-            summary_html +=
-                tag::p
-                    (tag::font[attr::size("-1")]
-                        (interpolate_html
-                            (R"(
+            summary_html += add_body_paragraph
+                (interpolate_html(R"(
 Coverage may be available on a Guaranteed Standard Issue basis.
 All proposals are based on case characteristics and must
 be approved by the ${InsCoShortName}
@@ -516,10 +515,7 @@ Home Office. For details regarding underwriting
 and coverage limitations refer to your offer letter
 or contact your ${InsCoShortName} representative.
 )"
-                            )
-                        )
-                    )
-                ;
+                ));
             }
 
         writer.output_html



reply via email to

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