From 7fe5fc80e910f817c1c83a16ea7f73be3e5ec2f9 Mon Sep 17 00:00:00 2001 From: Uli Martens Date: Mon, 13 Feb 2012 06:15:27 -0500 Subject: [PATCH] Bug #636 - Fixed bug #636, which causes the burndown reports to not honor the _forcecolor=off setting (thanks to Steve Rader, Uli Martens). Signed-off-by: Paul Beckingham --- ChangeLog | 2 ++ src/commands/CmdBurndown.cpp | 50 ++++++++++++++++++++++++------------ 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c28ae803..d34bcf8b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -131,6 +131,8 @@ handling and a formatting bug (thanks to Steve Rader). + Fixed bug #605, which gave misleading project completion percentages under certain circumstances (thanks to Steve Rader). + + Fixed bug #636, which causes the burndown reports to not honor the + _forcecolor=off setting (thanks to Steve Rader, Uli Martens). + Fixed bug #645 & #660, which prevented logically combining report filters (thanks to Bryce Harrington). + Fixed bug #683, in which the 'config' command sometimes edited comments diff --git a/src/commands/CmdBurndown.cpp b/src/commands/CmdBurndown.cpp index fa8a76c48..e34498f0c 100644 --- a/src/commands/CmdBurndown.cpp +++ b/src/commands/CmdBurndown.cpp @@ -129,11 +129,11 @@ Bar::~Bar () // DD 1 1 1 1 1 1 1 // -- ------------------------------------ // -// 5 | SS DD DD DD DD -// 4 | SS SS DD DD DD SS SS SS -// 3 | PP PP SS SS SS PP PP PP -// 2 | PP PP PP PP PP PP PP PP PP -// 1 | PP PP PP PP PP PP PP PP PP PP +// 5 | SS DD DD DD DD +// 4 | SS SS DD DD DD SS SS SS +// 3 | PP PP SS SS SS PP PP PP +// 2 | PP PP PP PP PP PP PP PP PP +// 1 | PP PP PP PP PP PP PP PP PP PP // 0 +------------------------------------- // 30 31 01 02 03 04 05 06 07 08 09 10 // Oct Nov @@ -560,21 +560,37 @@ std::string Chart::render () optimizeGrid (); - // Colorize the grid. - Color color_pending (context.config.get ("color.burndown.pending")); - Color color_done (context.config.get ("color.burndown.done")); - Color color_started (context.config.get ("color.burndown.started")); + if (context.color ()) + { + // Colorize the grid. + Color color_pending (context.config.get ("color.burndown.pending")); + Color color_done (context.config.get ("color.burndown.done")); + Color color_started (context.config.get ("color.burndown.started")); - // Replace DD, SS, PP with colored strings. - std::string::size_type i; - while ((i = grid.find ("PP")) != std::string::npos) - grid.replace (i, 2, color_pending.colorize (" ")); + // Replace DD, SS, PP with colored strings. + std::string::size_type i; + while ((i = grid.find ("PP")) != std::string::npos) + grid.replace (i, 2, color_pending.colorize (" ")); - while ((i = grid.find ("SS")) != std::string::npos) - grid.replace (i, 2, color_started.colorize (" ")); + while ((i = grid.find ("SS")) != std::string::npos) + grid.replace (i, 2, color_started.colorize (" ")); - while ((i = grid.find ("DD")) != std::string::npos) - grid.replace (i, 2, color_done.colorize (" ")); + while ((i = grid.find ("DD")) != std::string::npos) + grid.replace (i, 2, color_done.colorize (" ")); + } + else + { + // Replace DD, SS, PP with ./+/X strings. + std::string::size_type i; + while ((i = grid.find ("PP")) != std::string::npos) + grid.replace (i, 2, " X"); + + while ((i = grid.find ("SS")) != std::string::npos) + grid.replace (i, 2, " +"); + + while ((i = grid.find ("DD")) != std::string::npos) + grid.replace (i, 2, " ."); + } return grid; }