From d39e45841d4521cdd413bbb44571cbd3770ccafa Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 4 Aug 2009 16:59:12 -0600 Subject: [PATCH] Bug Fix - Bug #241 - Fixed bug #241 that caused redirected output to retain color control codes for colored header and footnotes (thanks to John Florian). --- ChangeLog | 2 ++ src/Context.cpp | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f8ba59a9..b74e3532b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ + Fixed bug that allowed a recurring task to be added without a due date. + Fixed bug #243 that caused exported due dates to be quoted, which then confused a subsequent import (thanks to John Florian). + + Fixed bug #241 that caused redirected output to retain color control codes + for colored header and footnotes (thanks to John Florian). ------ old releases ------------------------------ diff --git a/src/Context.cpp b/src/Context.cpp index 3ba39f716..cc2a472c6 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -148,18 +148,27 @@ int Context::run () // Dump all debug messages. if (config.get (std::string ("debug"), false)) foreach (d, debugMessages) - std::cout << colorizeDebug (*d) << std::endl; + if (config.get ("color", true) || config.get (std::string ("_forcecolor"), false)) + std::cout << colorizeDebug (*d) << std::endl; + else + std::cout << *d << std::endl; // Dump all headers. foreach (h, headers) - std::cout << colorizeHeader (*h) << std::endl; + if (config.get ("color", true) || config.get (std::string ("_forcecolor"), false)) + std::cout << colorizeHeader (*h) << std::endl; + else + std::cout << *h << std::endl; // Dump the report output. std::cout << output; // Dump all footnotes. foreach (f, footnotes) - std::cout << colorizeFootnote (*f) << std::endl; + if (config.get ("color", true) || config.get (std::string ("_forcecolor"), false)) + std::cout << colorizeFootnote (*f) << std::endl; + else + std::cout << *f << std::endl; return 0; }