lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master b725bcb 05/12: Reorder PDF column parameters


From: Greg Chicares
Subject: [lmi-commits] [lmi] master b725bcb 05/12: Reorder PDF column parameters
Date: Tue, 22 May 2018 17:09:21 -0400 (EDT)

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

    Reorder PDF column parameters
    
    Rearranged parameters more logically, by decreasing likelihood of
    variation.
    
    This commit is best examined with:
      git diff --ignore-all-space --color-moved=plain
---
 group_quote_pdf_gen_wx.cpp  | 8 ++++----
 ledger_pdf_generator_wx.cpp | 2 +-
 wx_table_generator.cpp      | 4 ++--
 wx_table_generator.hpp      | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/group_quote_pdf_gen_wx.cpp b/group_quote_pdf_gen_wx.cpp
index 1425a91..a9e6f06 100644
--- a/group_quote_pdf_gen_wx.cpp
+++ b/group_quote_pdf_gen_wx.cpp
@@ -674,13 +674,13 @@ void group_quote_pdf_generator_wx::save(std::string 
const& output_filename)
         {
         column_definition const& cd = column_definitions[col];
         std::string header;
+        oenum_h_align alignment = oe_center;
+        // PDF !! This doesn't fit into the switch logic below.
+        if(e_col_name == col) {alignment = oe_left;}
         oenum_visibility visibility = oe_shown;
         oenum_elasticity elasticity = oe_inelastic;
         // PDF !! This doesn't fit into the switch logic below.
         if(e_col_name == col) {elasticity = oe_elastic;}
-        oenum_h_align alignment = oe_center;
-        // PDF !! This doesn't fit into the switch logic below.
-        if(e_col_name == col) {alignment = oe_left;}
 
         // The cast is only used to ensure that if any new elements are added
         // to the enum, the compiler would warn about their values not being
@@ -720,7 +720,7 @@ void group_quote_pdf_generator_wx::save(std::string const& 
output_filename)
                 break;
             }
 
-        vc.push_back({header, cd.widest_text_, visibility, elasticity, 
alignment});
+        vc.push_back({header, cd.widest_text_, alignment, visibility, 
elasticity});
         }
 
     wx_table_generator table_gen
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 39f0028..1df4a83 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -365,9 +365,9 @@ class using_illustration_table
             vc.push_back
                 ({i.header
                  ,i.widest_text
+                 ,oe_right
                  ,should_hide_column(ledger, column++) ? oe_hidden : oe_shown
                  ,oe_inelastic
-                 ,oe_right
                 });
             }
         // Arguably, should_hide_column() should return an enumerator--see:
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 598c089..8819dba 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -165,9 +165,9 @@ class wx_table_generator::column_info
     column_info
         (std::string      const& header
         ,int                     width
+        ,oenum_h_align    const  alignment
         ,oenum_visibility const  visibility
         ,oenum_elasticity const  elasticity
-        ,oenum_h_align    const  alignment
         )
         :col_header_       (header)
         ,col_width_        (width)
@@ -363,7 +363,7 @@ LMI_ASSERT(w == dc_.GetMultiLineTextExtent(z.header).x);
 
     all_columns_.push_back
         (column_info
-            (z.header, width, z.visibility, z.elasticity, z.alignment)
+            (z.header, width, z.alignment, z.visibility, z.elasticity)
         );
 }
 
diff --git a/wx_table_generator.hpp b/wx_table_generator.hpp
index 71b900b..9ecbab8 100644
--- a/wx_table_generator.hpp
+++ b/wx_table_generator.hpp
@@ -39,9 +39,9 @@ struct column_parameters
 {
     std::string      const header;
     std::string      const widest_text;
+    oenum_h_align    const alignment;
     oenum_visibility const visibility;
     oenum_elasticity const elasticity;
-    oenum_h_align    const alignment;
 };
 
 /// Specialized styles for first wx_table_generator ctor argument.



reply via email to

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