move use of contextTask out of columns, into commands

This commit is contained in:
Dustin J. Mitchell
2021-12-18 01:49:48 +00:00
committed by Tomas Babej
parent e98b61f2b5
commit 6e9ad1048d
17 changed files with 44 additions and 35 deletions

View File

@@ -36,8 +36,6 @@
#include <utf8.h>
#include <util.h>
extern Task* contextTask;
////////////////////////////////////////////////////////////////////////////////
ColumnProject::ColumnProject ()
{
@@ -121,9 +119,6 @@ void ColumnProject::modify (Task& task, const std::string& value)
{
Eval e;
e.addSource (domSource);
if (!task.is_empty ()) {
contextTask = &task;
}
Variant v;
e.evaluateInfixExpression (value, v);

View File

@@ -36,8 +36,6 @@
#include <format.h>
#include <utf8.h>
extern Task* contextTask;
////////////////////////////////////////////////////////////////////////////////
ColumnRecur::ColumnRecur ()
{
@@ -108,9 +106,6 @@ void ColumnRecur::modify (Task& task, const std::string& value)
{
Eval e;
e.addSource (domSource);
if (!task.is_empty ()) {
contextTask = &task;
}
e.evaluateInfixExpression (value, evaluatedValue);
}

View File

@@ -36,8 +36,6 @@
#include <utf8.h>
#include <main.h>
extern Task* contextTask;
////////////////////////////////////////////////////////////////////////////////
ColumnTags::ColumnTags ()
{
@@ -162,9 +160,6 @@ void ColumnTags::modify (Task& task, const std::string& value)
{
Eval e;
e.addSource (domSource);
if (!task.is_empty ()) {
contextTask = &task;
}
Variant v;
e.evaluateInfixExpression (value, v);

View File

@@ -34,8 +34,6 @@
#include <Filter.h>
#include <format.h>
extern Task* contextTask;
////////////////////////////////////////////////////////////////////////////////
ColumnTypeDate::ColumnTypeDate ()
{
@@ -213,9 +211,6 @@ void ColumnTypeDate::modify (Task& task, const std::string& value)
{
Eval e;
e.addSource (domSource);
if (!task.is_empty ()) {
contextTask = &task;
}
e.evaluateInfixExpression (value, evaluatedValue);
}

View File

@@ -32,8 +32,6 @@
#include <Filter.h>
#include <format.h>
extern Task* contextTask;
////////////////////////////////////////////////////////////////////////////////
ColumnTypeDuration::ColumnTypeDuration ()
{
@@ -55,9 +53,6 @@ void ColumnTypeDuration::modify (Task& task, const std::string& value)
{
Eval e;
e.addSource (domSource);
if (!task.is_empty ()) {
contextTask = &task;
}
e.evaluateInfixExpression (value, evaluatedValue);
}

View File

@@ -32,8 +32,6 @@
#include <Filter.h>
#include <format.h>
extern Task* contextTask;
////////////////////////////////////////////////////////////////////////////////
ColumnTypeNumeric::ColumnTypeNumeric ()
{
@@ -55,9 +53,6 @@ void ColumnTypeNumeric::modify (Task& task, const std::string& value)
{
Eval e;
e.addSource (domSource);
if (!task.is_empty ()) {
contextTask = &task;
}
e.evaluateInfixExpression (value, evaluatedValue);
}

View File

@@ -34,8 +34,6 @@
#define STRING_INVALID_MOD "The '{1}' attribute does not allow a value of '{2}'."
extern Task* contextTask;
////////////////////////////////////////////////////////////////////////////////
ColumnTypeString::ColumnTypeString ()
{
@@ -67,9 +65,6 @@ void ColumnTypeString::modify (Task& task, const std::string& value)
{
Eval e;
e.addSource (domSource);
if (!task.is_empty ()) {
contextTask = &task;
}
Variant v;
e.evaluateInfixExpression (value, v);