From 16cee8e26375686eb6b64a1ea7b9294cf7538aa5 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 28 Jul 2015 23:44:20 -0400 Subject: [PATCH] TW-1627: 'mon' is replaced with date in project field - Thanks to James Cline. --- AUTHORS | 1 + ChangeLog | 1 + src/Task.cpp | 30 ++++++------------------------ 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/AUTHORS b/AUTHORS index d92857238..ce9f50968 100644 --- a/AUTHORS +++ b/AUTHORS @@ -264,3 +264,4 @@ suggestions: Florian Petry Lars Beckers Dustin J. Mitchell + James Cline diff --git a/ChangeLog b/ChangeLog index 508550577..b1ca78f85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -71,6 +71,7 @@ - TW-1622 Duration UDA can't take an algebraic expression (thanks to Jeremy John Reeder). - TW-1626 Wrong wait date (thanks to Andrea Rizzi). +- TW-1627 'mon' is replaced with date in project field (thanks to James Cline). - TW-1632 Japanese translation for Taskwarrior(150713) (thanks to ribbon). - TW-1634 due.not: excludes only tasks scheduled at mitnight (thanks to Tomas Babej). diff --git a/src/Task.cpp b/src/Task.cpp index 9acf86266..d0c4811ac 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -2135,39 +2135,21 @@ void Task::modify (modType type, bool text_required /* = false */) ++modCount; } - // String type columns may eval, or may not make sense to eval, and - // the best way to determine this is to try. + // String type columns are not eval'd. else if (column->type () == "string") { - std::string evaluated = value; - try - { - Eval e; - e.addSource (domSource); - e.addSource (namedDates); - contextTask = *this; - - Variant v; - e.evaluateInfixExpression (value, v); - v.cast (Variant::type_string); - evaluated = v.get_string (); - } - - catch (...) { /* NOP */ } - - // Final default action - if (column->validate (evaluated)) + if (column->validate (value)) { if (column->can_modify ()) { - std::string col_value = column->modify (evaluated); - context.debug (label + name + " <-- '" + col_value + "' <-- '" + evaluated + "' <-- '" + value + "'"); + std::string col_value = column->modify (value); + context.debug (label + name + " <-- '" + col_value + "' <-- '" + value + "'"); (*this).set (name, col_value); } else { - context.debug (label + name + " <-- '" + evaluated + "' <-- '" + value + "'"); - (*this).set (name, evaluated); + context.debug (label + name + " <-- '" + value + "'"); + (*this).set (name, value); } ++modCount;