lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 5df1ad4 4/8: Resolve several marked defects [


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 5df1ad4 4/8: Resolve several marked defects [384]
Date: Mon, 31 Jul 2017 17:24:17 -0400 (EDT)

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

    Resolve several marked defects [384]
    
    Text output is used only as a reference implementation, rather than for
    production, so its aesthetic shortcomings are not defects. It might
    nevertheless be useful to address some of them if that demonstrates
    ways to write code to replace XSL templates.
---
 ledger_text_formats.cpp | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/ledger_text_formats.cpp b/ledger_text_formats.cpp
index 2ef740c..f83e5aa 100644
--- a/ledger_text_formats.cpp
+++ b/ledger_text_formats.cpp
@@ -881,21 +881,26 @@ void PrintLedgerFlatText
 
 // One column of seven characters ('Age 100')
 // plus ten columns of twelve characters each (' 999,999,999')
-// equals 127 columns; a nine-point font can do that on a page
+// equals 127 columns; a nine-point font can print that on a page
 // eight inches wide and still leave about a half-inch margin
 // on both sides.
 //
-// TODO ?? Avoid overflow by scaling everything if anything's $1B or over.
-// TODO ?? Add thousands separators.
+// SOMEDAY !! The formatting of this simple reference implementation
+// could be improved in several ways:
+//   - Avoid overflow by scaling everything if anything's $1B or over.
+//   - Add thousands separators.
+//   - Show at least premiums as dollars and cents.
+//   - Split into numbered pages, adding serial page numbers to footer.
+//   - Wrap long strings.
 namespace
 {
     int g_width = 128;
     std::string center(std::string const& s)
         {
         int z = s.length();
-        // TODO ?? Strings in the input class might be too wide;
-        // absent more graceful handling, at least no attempt is made
-        // to cure that problem with a negative number of spaces.
+        // Strings in the input class might be too wide; absent more
+        // graceful handling, at least no attempt is made to cure that
+        // problem with a negative number of spaces.
         std::string spaces(std::max(0, (g_width - z) / 2), char(' '));
         return spaces + s;
         }
@@ -920,7 +925,6 @@ void FlatTextLedgerPrinter::Print() const
 {
     set_default_format_flags(os_);
 
-    // TODO ?? Split into numbered pages; add page number to footer.
     PrintHeader             ();
     PrintNarrativeSummary   ();
     PrintKeyTerms           ();



reply via email to

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