lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6591] Format totals and averages as other data are format


From: gchicares
Subject: [lmi-commits] [6591] Format totals and averages as other data are formatted (VZ)
Date: Mon, 16 May 2016 15:56:19 +0000 (UTC)

Revision: 6591
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6591
Author:   chicares
Date:     2016-05-16 15:56:18 +0000 (Mon, 16 May 2016)
Log Message:
-----------
Format totals and averages as other data are formatted (VZ)

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

Modified: lmi/trunk/group_quote_pdf_gen_wx.cpp
===================================================================
--- lmi/trunk/group_quote_pdf_gen_wx.cpp        2016-05-13 14:14:39 UTC (rev 
6590)
+++ lmi/trunk/group_quote_pdf_gen_wx.cpp        2016-05-16 15:56:18 UTC (rev 
6591)
@@ -1446,21 +1446,19 @@
         table_gen.output_highlighted_cell
             (col
             ,y
-            ,"$"
-            ,ledger_format(totals_.total(col), f)
+            ,'$' + ledger_format(totals_.total(col), f)
             );
 
         // Only premium columns have averages, but we must output something for
         // all cells to ensure that we use homogeneous background.
         double const average = averages_.mean(col);
-        std::string lhs, rhs;
+        std::string average_text;
         if(average != 0.0)
             {
-            lhs = "$";
-            rhs = ledger_format(average, f);
+            average_text = '$' + ledger_format(average, f);
             }
 
-        table_gen.output_highlighted_cell(col, y_next, lhs, rhs);
+        table_gen.output_highlighted_cell(col, y_next, average_text);
         }
 
     table_gen.output_vert_separator(e_col_max, y);

Modified: lmi/trunk/wx_table_generator.cpp
===================================================================
--- lmi/trunk/wx_table_generator.cpp    2016-05-13 14:14:39 UTC (rev 6590)
+++ lmi/trunk/wx_table_generator.cpp    2016-05-16 15:56:18 UTC (rev 6591)
@@ -354,8 +354,7 @@
 void wx_table_generator::output_highlighted_cell
     (std::size_t        column
     ,int                y
-    ,std::string const& lhs
-    ,std::string const& rhs
+    ,std::string const& value
     )
 {
     if(columns_.at(column).is_hidden())
@@ -369,9 +368,7 @@
     dc_.DrawRectangle(cell_rect(column, y));
     }
 
-    wxRect const r = text_rect(column, y);
-    dc_.DrawLabel(lhs, r, wxALIGN_LEFT);
-    dc_.DrawLabel(rhs, r, wxALIGN_RIGHT);
+    dc_.DrawLabel(value, text_rect(column, y), wxALIGN_CENTER_HORIZONTAL);
 
     output_vert_separator(column, y);
 }

Modified: lmi/trunk/wx_table_generator.hpp
===================================================================
--- lmi/trunk/wx_table_generator.hpp    2016-05-13 14:14:39 UTC (rev 6590)
+++ lmi/trunk/wx_table_generator.hpp    2016-05-16 15:56:18 UTC (rev 6591)
@@ -74,14 +74,11 @@
     void output_row(int* pos_y, std::string const* values);
 
     // Render a single highlighted (by shading its background) cell with the
-    // given strings displayed in it left and right-aligned respectively.
-    // This is used for aggregate amounts display currently, so the LHS string
-    // is always just "$" currently.
+    // given string displayed in it (always centered).
     void output_highlighted_cell
         (std::size_t        column
         ,int                y
-        ,std::string const& lhs
-        ,std::string const& rhs
+        ,std::string const& value
         );
 
     // Return the height of a single table row.




reply via email to

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