lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 71ad6f2 8/9: Deal more explicitly with pointe


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 71ad6f2 8/9: Deal more explicitly with pointers
Date: Wed, 19 Sep 2018 09:19:34 -0400 (EDT)

branch: master
commit 71ad6f26e3d9198705f53161a754c487a2fad95c
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Deal more explicitly with pointers
    
    Pointers are inherently dangerous. It compounds the danger to make
    them less visible by using 'auto' and relying on default conversion
    to boolean to test whether they're null.
---
 ledger_pdf_generator_wx.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 510fc2c..1472c06 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -1021,7 +1021,11 @@ class page_with_marginals : public logical_page
 
         page_top_ = writer.get_vert_margin();
 
-        if(auto header_html = get_header_html(); header_html)
+        // Pre-render the header, if any.
+        if
+            (wxHtmlContainerCell* header_html = get_header_html()
+            ;nullptr != header_html
+            )
             {
             page_top_ += writer.output_html
                 (frame_horz_margin
@@ -1081,7 +1085,10 @@ class page_with_marginals : public logical_page
         auto& pdf_dc = writer.dc();
 
         // Render the header, if any.
-        if(auto header_html = get_header_html(); header_html)
+        if
+            (wxHtmlContainerCell* header_html = get_header_html()
+            ;nullptr != header_html
+            )
             {
             writer.output_html
                 (frame_horz_margin



reply via email to

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