From 37c7cc705d4e6a4cfee61699363ad146175af431 Mon Sep 17 00:00:00 2001 From: Thomas Lauf Date: Fri, 16 Nov 2018 16:33:20 +0100 Subject: [PATCH] Use local variable for indent string --- src/commands/CmdChart.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/commands/CmdChart.cpp b/src/commands/CmdChart.cpp index 1920ad82..7c2b4418 100644 --- a/src/commands/CmdChart.cpp +++ b/src/commands/CmdChart.cpp @@ -129,15 +129,19 @@ int renderChart ( int last_hour = 23; determineHourRange (type, rules, filter, tracked, first_hour, last_hour); + auto indent = std::string (getIndentSize (type, rules), ' '); + // Render the axis. std::cout << '\n'; if (rules.get ("reports." + type + ".axis") != "internal") + { renderAxis (type, rules, palette, - std::string (getIndentSize (type, rules), ' '), + indent, first_hour, last_hour); + } // For rendering labels on edge detection. Datetime previous {0}; @@ -147,7 +151,6 @@ int renderChart ( bool ids = findHint (cli, ":ids"); // Determine how much space is occupied by the left-margin labels. - auto indent = getIndentSize (type, rules); auto cell = rules.getInteger ("reports." + type + ".cell"); if (cell < 1) @@ -201,7 +204,7 @@ int renderChart ( if (lines.size () > 1) for (unsigned int i = 1; i < lines.size (); ++i) std::cout << "\n" - << std::string (indent, ' ') + << indent << lines[i].str (); std::cout << renderTotal (type, rules, work) @@ -213,7 +216,7 @@ int renderChart ( std::cout << renderSubTotal (type, rules, first_hour, last_hour, total_work) << renderHolidays (type, rules, filter) - << renderSummary (type, rules, std::string (indent, ' '), filter, exclusions, tracked, blank); + << renderSummary (type, rules, indent, filter, exclusions, tracked, blank); return 0; }