lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6555] Refactor to ease maintenance


From: Greg Chicares
Subject: [lmi-commits] [6555] Refactor to ease maintenance
Date: Wed, 04 May 2016 14:48:34 +0000

Revision: 6555
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6555
Author:   chicares
Date:     2016-05-04 14:48:33 +0000 (Wed, 04 May 2016)
Log Message:
-----------
Refactor to ease maintenance

Modified Paths:
--------------
    lmi/trunk/group_quote_pdf_gen_wx.cpp

Modified: lmi/trunk/group_quote_pdf_gen_wx.cpp
===================================================================
--- lmi/trunk/group_quote_pdf_gen_wx.cpp        2016-05-04 10:50:16 UTC (rev 
6554)
+++ lmi/trunk/group_quote_pdf_gen_wx.cpp        2016-05-04 14:48:33 UTC (rev 
6555)
@@ -446,6 +446,8 @@
     ,e_col_max
     };
 
+enum_group_quote_columns const e_first_totalled_column = e_col_face_amount;
+
 struct column_definition
 {
     char const* header_;
@@ -566,7 +568,7 @@
       public:
         totals_data()
             {
-            for(int col = e_col_face_amount; col < e_col_max; ++col)
+            for(int col = e_first_totalled_column; col < e_col_max; ++col)
                 {
                 value(col) = 0.0;
                 }
@@ -583,9 +585,9 @@
             }
 
       private:
-        double& value(int col) { return values_[col - e_col_face_amount]; }
+        double& value(int col) { return values_[col - 
e_first_totalled_column]; }
 
-        double values_[e_col_max - e_col_face_amount];
+        double values_[e_col_max - e_first_totalled_column];
     };
     totals_data totals_;
 
@@ -1215,8 +1217,8 @@
 {
     int& y = *pos_y;
 
-    table_gen.output_horz_separator(e_col_face_amount, e_col_max, y);
-    table_gen.output_vert_separator(e_col_face_amount, y);
+    table_gen.output_horz_separator(e_first_totalled_column, e_col_max, y);
+    table_gen.output_vert_separator(e_first_totalled_column, y);
     table_gen.output_vert_separator(e_col_max, y);
 
     y += table_gen.row_height();
@@ -1239,13 +1241,14 @@
     // one just above anyhow.
     pdf_dc.SetFont(pdf_dc.GetFont().Italic());
 
+    LMI_ASSERT(0 < e_first_totalled_column);
     pdf_dc.DrawLabel
         ("Totals:"
-        ,table_gen.cell_rect(e_col_salary, y_text).Deflate(cell_margin_x, 0)
+        ,table_gen.cell_rect(e_first_totalled_column - 1, 
y_text).Deflate(cell_margin_x, 0)
         ,wxALIGN_RIGHT
         );
 
-    for(int col = e_col_face_amount; col < e_col_max; ++col)
+    for(int col = e_first_totalled_column; col < e_col_max; ++col)
         {
         int const num_dec =
             ((e_col_face_amount                 == col) ? 0




reply via email to

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