lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 99930af 1/8: Declare a variable only in the s


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 99930af 1/8: Declare a variable only in the scope where it's used
Date: Wed, 12 Sep 2018 12:08:05 -0400 (EDT)

branch: master
commit 99930afbc297655f2b808b4e35ea4233bd9bcdcf
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Declare a variable only in the scope where it's used
---
 ledger_pdf_generator_wx.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index fbfcead..e06641a 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -1417,9 +1417,6 @@ class numeric_summary_table_cell
         table_gen.output_horz_separator(0, column_max, pos_y, output_mode);
         pos_y += table_gen.separator_line_height();
 
-        // And now the table values themselves.
-        auto const& columns = get_table_columns();
-
         auto const& invar = ledger.GetLedgerInvariant();
         auto const& interpolate_html = 
pdf_context_for_html_output.interpolate_html();
 
@@ -1459,6 +1456,7 @@ class numeric_summary_table_cell
 
                 case oe_render:
                     {
+                    auto const& columns = get_table_columns();
                     std::vector<std::string> visible_values;
                     for(int j = 0; j < lmi::ssize(columns); ++j)
                         {
@@ -1610,8 +1608,6 @@ class page_with_tabular_report
 
         wx_table_generator table_gen{create_table_generator(ledger, writer)};
 
-        auto const& columns = get_table_columns();
-
         // Just some cached values used inside the loop below.
         auto const row_height = table_gen.row_height();
         auto const page_bottom = get_footer_top();
@@ -1630,6 +1626,7 @@ class page_with_tabular_report
 
             for(;;)
                 {
+                auto const& columns = get_table_columns();
                 std::vector<std::string> visible_values;
                 for(int j = 0; j < lmi::ssize(columns); ++j)
                     {



reply via email to

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