commit 1c0d0df7738aded359ce52683ee38ba4aca361c2
parent 34ee7554c503b841fd9b9bf972b66216ddcfe6e4
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sun, 6 Dec 2015 21:04:33 -0800
use windows-style line breaks in the transaction overview dialog
Diffstat:
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/report.cpp b/src/report.cpp
@@ -8,6 +8,7 @@
using namespace std;
static const string SEP(10, '=');
+static const char *NL = "\r\n";
Report::Report(Transaction *transaction)
: Dialog(IDD_REPORT_DIALOG), m_transaction(transaction)
@@ -26,14 +27,14 @@ void Report::onInit()
<< newPacks << " new packages, "
<< updates << " updates and "
<< errors << " errors"
- << "\n"
+ << NL
;
if(errors)
formatErrors(text);
if(newPacks)
- formatErrors(text);
+ formatNewPackages(text);
if(updates)
formatUpdates(text);
@@ -55,29 +56,29 @@ void Report::onCommand(WPARAM wParam, LPARAM)
void Report::formatNewPackages(ostringstream &text)
{
- text << "\n" << SEP << " New packages: " << SEP << "\n";
+ text << NL << SEP << " New packages: " << SEP << NL;
for(Package *pkg : m_transaction->newPackages())
- text << "\n- " << pkg->lastVersion()->fullName() << "\n";
+ text << NL << "- " << pkg->lastVersion()->fullName() << NL;
}
void Report::formatUpdates(ostringstream &text)
{
- text << "\n" << SEP << " Updates: " << SEP << "\n";
+ text << NL << SEP << " Updates: " << SEP << NL;
for(Package *pkg : m_transaction->updates()) {
Version *ver = pkg->lastVersion();
- text << "\n- " << ver->fullName() << "\n";
+ text << NL << "- " << ver->fullName() << NL;
if(!ver->changelog().empty())
- text << ver->changelog() << "\n";
+ text << ver->changelog() << NL;
}
}
void Report::formatErrors(ostringstream &text)
{
- text << "\n" << SEP << " Errors: " << SEP << "\n";
+ text << NL << SEP << " Errors: " << SEP << NL;
for(const string &msg : m_transaction->errors())
- text << "\n- " << msg << "\n";
+ text << NL << "- " << msg << NL;
}