lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6268] Refined formatting of totals


From: Greg Chicares
Subject: [lmi-commits] [6268] Refined formatting of totals
Date: Wed, 26 Aug 2015 17:02:45 +0000

Revision: 6268
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6268
Author:   chicares
Date:     2015-08-26 17:02:43 +0000 (Wed, 26 Aug 2015)
Log Message:
-----------
Refined formatting of totals

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

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2015-08-26 16:28:43 UTC (rev 6267)
+++ lmi/trunk/ChangeLog 2015-08-26 17:02:43 UTC (rev 6268)
@@ -36706,3 +36706,9 @@
 Simplify the way PDF file name is set (VZ). See:
   http://lists.nongnu.org/archive/html/lmi/2015-08/msg00035.html
 
+20150826T1702Z <address@hidden> [477]
+
+  group_quote_pdf_gen_wx.cpp
+Refined formatting of totals. See:
+  http://lists.nongnu.org/archive/html/lmi/2015-08/msg00034.html
+

Modified: lmi/trunk/group_quote_pdf_gen_wx.cpp
===================================================================
--- lmi/trunk/group_quote_pdf_gen_wx.cpp        2015-08-26 16:28:43 UTC (rev 
6267)
+++ lmi/trunk/group_quote_pdf_gen_wx.cpp        2015-08-26 17:02:43 UTC (rev 
6268)
@@ -49,6 +49,7 @@
 #include <wx/pdfdc.h>
 
 #include <limits>
+#include <stdexcept>
 #include <utility>                      // std::pair
 #include <vector>
 
@@ -836,9 +837,18 @@
         ,wxALIGN_RIGHT
         );
 
-    std::pair<int, oenum_format_style> const f2(2, oe_format_normal);
     for(int col = e_col_face_amount; col < e_col_max; ++col)
         {
+        int const num_dec =
+            ((e_col_face_amount                 == col) ? 0
+            :(e_col_premium                     == col) ? 2
+            :(e_col_premium_with_waiver         == col) ? 2
+            :(e_col_premium_with_adb            == col) ? 2
+            :(e_col_premium_with_waiver_and_adb == col) ? 2
+            :throw std::logic_error("Invalid column type.")
+            );
+        std::pair<int, oenum_format_style> const f(num_dec, oe_format_normal);
+
         wxRect const cell_rect = table_gen.cell_rect(col, y);
             {
             wxDCPenChanger set_transparent_pen(pdf_dc, *wxTRANSPARENT_PEN);
@@ -859,7 +869,7 @@
             ,wxALIGN_LEFT
             );
         pdf_dc.DrawLabel
-            (ledger_format(totals_.total(col), f2)
+            (ledger_format(totals_.total(col), f)
             ,text_rect
             ,wxALIGN_RIGHT
             );




reply via email to

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