From f7fc455b627c058b74413a428de6f66ba33b355b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 8 May 2009 01:09:55 -0400 Subject: [PATCH] Bug Fix - extra line in ghistory report - Fixed bug that added an extra line between header and graph in the ghistory report. --- ChangeLog | 3 +++ html/task.html | 2 ++ src/Table.cpp | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index 849fb30a3..c0fa1c832 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,9 @@ + The "append", and "done" commands now allow modifications to be applied to the task(s) (thanks to David J Patrick). + Improved word wrapping in various output. + + Fixed bug that added an extra line between header and graph in the + ghistory report. + ------ old releases ------------------------------ diff --git a/html/task.html b/html/task.html index 13efc3172..e8a199a35 100644 --- a/html/task.html +++ b/html/task.html @@ -128,6 +128,8 @@
  • The "append", and "done" commands now allow modifications to be applied to the task(s) (thanks to David J Patrick).
  • Improved word wrapping in various output. +
  • Fixed bug that added an extra line between header and graph in the + ghistory report.

    diff --git a/src/Table.cpp b/src/Table.cpp index 0ea6a57cb..6398e0065 100644 --- a/src/Table.cpp +++ b/src/Table.cpp @@ -803,6 +803,27 @@ void Table::optimize (std::string& output) const Much better. */ + char* patterns[] = + { + " \n", + " \n", + " \n", + " \n", + }; + + std::string::size_type trailing; + + for (int i = 0; i < 4; i++) + { + do + { + trailing = output.find (patterns[i]); + if (trailing != std::string::npos) + output.replace (trailing, strlen (patterns[i]), "\n"); + } + while (trailing != std::string::npos); + } + // std::cout << int ((100 * (start - output.length ()) / start)) // << "%" << std::endl; } @@ -1103,6 +1124,7 @@ const std::string Table::render (int maximum /* = 0 */) } } + optimize (output); return output; }