[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 0b6a3b69 02/27: Avoid writing " \n"
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 0b6a3b69 02/27: Avoid writing " \n" |
Date: |
Mon, 25 Apr 2022 12:56:13 -0400 (EDT) |
branch: master
commit 0b6a3b690364031f88634397b93df9276e475ef6
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Avoid writing " \n"
---
ledger_text_formats.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/ledger_text_formats.cpp b/ledger_text_formats.cpp
index 67d4c824..85a96e05 100644
--- a/ledger_text_formats.cpp
+++ b/ledger_text_formats.cpp
@@ -185,6 +185,11 @@
calculation_summary_formatter::calculation_summary_formatter
}
}
+std::string prepend_space_if_not_empty(std::string const& s)
+{
+ return s.empty() ? s : " " + s;
+}
+
std::string calculation_summary_formatter::top_note
(std::string const& line_break
) const
@@ -199,8 +204,8 @@ std::string calculation_summary_formatter::top_note
else
{
oss
- << "Calculation summary for: "
- << invar_.Insured1
+ << "Calculation summary for:"
+ << prepend_space_if_not_empty(invar_.Insured1)
<< line_break
<< invar_.Gender << ", " << invar_.Smoker
<< std::setprecision(0)
- [lmi-commits] [lmi] master 174198af 12/27: Reformat, (continued)
- [lmi-commits] [lmi] master 174198af 12/27: Reformat, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master dcbe9418 14/27: Change currency fields in ledger to integral cents, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master af0666c3 24/27: Distinguish two ledger formats, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 7b30e2d8 03/27: Filter unexpectedly small system-test discrepancies, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master d7ab80c6 04/27: Clean up beforehand, not afterward, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 12192723 06/27: Add two new ledger emission options, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 119df7a9 13/27: Add a 'divisor' argument to LedgerBase::value_str(), Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 2b108ed7 18/27: Avoid unnecessary rounding, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master b7c61b4d 20/27: Regularize format names, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 8de190ce 17/27: Regularize whitespace, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 0b6a3b69 02/27: Avoid writing " \n",
Greg Chicares <=
- [lmi-commits] [lmi] master 95b4e917 19/27: Remove an unnecessary comment, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 61f6a237 21/27: Reorder format-style map, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 299cc249 22/27: Improve documentation, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 6f50ad93 23/27: Transpose a ledger format, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 00289fa7 25/27: Rearrange ledger formats, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 16898eb9 26/27: Use a more reasonable format for an unused field, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 09e00258 27/27: Mark or expunge unused fields, Greg Chicares, 2022/04/25