[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 ();
- [lmi-commits] [lmi] master updated (e13aa72 -> bd7e567), Greg Chicares, 2017/07/31
- [lmi-commits] [lmi] master 6ceeaf8 1/8: Say why headers are included if not obvious, Greg Chicares, 2017/07/31
- [lmi-commits] [lmi] master 8aea003 2/8: Fix defect introduced 20050114T1947Z: range error, Greg Chicares, 2017/07/31
- [lmi-commits] [lmi] master 5df1ad4 4/8: Resolve several marked defects [384],
Greg Chicares <=
- [lmi-commits] [lmi] master 9051064 3/8: Improve label on age-70 row in Numeric Summary [388], Greg Chicares, 2017/07/31
- [lmi-commits] [lmi] master 9edce5a 5/8: Crudely paginate text output, Greg Chicares, 2017/07/31
- [lmi-commits] [lmi] master 615758f 6/8: Improve const-correctness, Greg Chicares, 2017/07/31
- [lmi-commits] [lmi] master bd7e567 8/8: Show lapse years in Numeric Summary, Greg Chicares, 2017/07/31
- [lmi-commits] [lmi] master 1622e2f 7/8: Locally cache certain values, Greg Chicares, 2017/07/31