[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
- [lmi-commits] [lmi] master updated (ec872ae -> 05129d0), Greg Chicares, 2018/09/19
- [lmi-commits] [lmi] master 3149080 4/9: Reformat some very long lines, Greg Chicares, 2018/09/19
- [lmi-commits] [lmi] master 1c240f6 1/9: Add missing piece of PDF context to class pdf_illustration, Greg Chicares, 2018/09/19
- [lmi-commits] [lmi] master 8cccd20 5/9: Note a mystery, Greg Chicares, 2018/09/19
- [lmi-commits] [lmi] master 00e5909 3/9: Explicitly use base-class accessor, Greg Chicares, 2018/09/19
- [lmi-commits] [lmi] master 71ad6f2 8/9: Deal more explicitly with pointers,
Greg Chicares <=
- [lmi-commits] [lmi] master 05129d0 9/9: Adjust whitespace for vertical alignment, Greg Chicares, 2018/09/19
- [lmi-commits] [lmi] master 0bb6ff8 7/9: Reformat and reuse if-with-initializer, Greg Chicares, 2018/09/19
- [lmi-commits] [lmi] master e5194ea 6/9: Adjust whitespace for vertical alignment, Greg Chicares, 2018/09/19
- [lmi-commits] [lmi] master 5f53cca 2/9: Appropriately treat font sizes as static data, Greg Chicares, 2018/09/19