[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.
- [lmi-commits] [lmi] master updated (a1f29ab -> 40a94aa), Greg Chicares, 2018/05/22
- [lmi-commits] [lmi] master b219dd9 01/12: Note a possible future return-type change, Greg Chicares, 2018/05/22
- [lmi-commits] [lmi] master b725bcb 05/12: Reorder PDF column parameters,
Greg Chicares <=
- [lmi-commits] [lmi] master 2c95260 07/12: Prefer 'switch' to 'if' for a two-valued enum, Greg Chicares, 2018/05/22
- [lmi-commits] [lmi] master bd86afe 04/12: Shorten an enumerator's name, Greg Chicares, 2018/05/22
- [lmi-commits] [lmi] master 9e1ac25 09/12: Fold a "ternary" conditional into a switch, Greg Chicares, 2018/05/22
- [lmi-commits] [lmi] master 40a94aa 12/12: Explain why width of an elastic column is initialized to zero, Greg Chicares, 2018/05/22
- [lmi-commits] [lmi] master 6b93e91 11/12: Remove an unneeded auxiliary function, Greg Chicares, 2018/05/22
- [lmi-commits] [lmi] master b232274 02/12: Make column elasticity enumerative rather than boolean, Greg Chicares, 2018/05/22
- [lmi-commits] [lmi] master 7e64de5 03/12: Make column alignment enumerative rather than boolean, Greg Chicares, 2018/05/22
- [lmi-commits] [lmi] master e2e4ad6 08/12: Remove a temporary assertion that is no longer useful, Greg Chicares, 2018/05/22
- [lmi-commits] [lmi] master 637d535 06/12: Rework PDF column formatting in terms of "elasticity", Greg Chicares, 2018/05/22
- [lmi-commits] [lmi] master 6076b33 10/12: Simplify code; rewrite documentation, Greg Chicares, 2018/05/22