mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 09:53:08 +02:00
Only set contextTask if not adding a new task
When adding a new task, the current task is empty, so there is no context in which to evaluate DOM references. #2683 will address this in a more robust fashion.
This commit is contained in:
parent
2812a8c77a
commit
8d3953183a
7 changed files with 21 additions and 7 deletions
|
@ -121,7 +121,9 @@ void ColumnProject::modify (Task& task, const std::string& value)
|
|||
{
|
||||
Eval e;
|
||||
e.addSource (domSource);
|
||||
contextTask = &task;
|
||||
if (!task.is_empty ()) {
|
||||
contextTask = &task;
|
||||
}
|
||||
|
||||
Variant v;
|
||||
e.evaluateInfixExpression (value, v);
|
||||
|
|
|
@ -108,7 +108,9 @@ void ColumnRecur::modify (Task& task, const std::string& value)
|
|||
{
|
||||
Eval e;
|
||||
e.addSource (domSource);
|
||||
contextTask = &task;
|
||||
if (!task.is_empty ()) {
|
||||
contextTask = &task;
|
||||
}
|
||||
e.evaluateInfixExpression (value, evaluatedValue);
|
||||
}
|
||||
|
||||
|
|
|
@ -162,7 +162,9 @@ void ColumnTags::modify (Task& task, const std::string& value)
|
|||
{
|
||||
Eval e;
|
||||
e.addSource (domSource);
|
||||
contextTask = &task;
|
||||
if (!task.is_empty ()) {
|
||||
contextTask = &task;
|
||||
}
|
||||
|
||||
Variant v;
|
||||
e.evaluateInfixExpression (value, v);
|
||||
|
|
|
@ -213,7 +213,9 @@ void ColumnTypeDate::modify (Task& task, const std::string& value)
|
|||
{
|
||||
Eval e;
|
||||
e.addSource (domSource);
|
||||
contextTask = &task;
|
||||
if (!task.is_empty ()) {
|
||||
contextTask = &task;
|
||||
}
|
||||
e.evaluateInfixExpression (value, evaluatedValue);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,9 @@ void ColumnTypeDuration::modify (Task& task, const std::string& value)
|
|||
{
|
||||
Eval e;
|
||||
e.addSource (domSource);
|
||||
contextTask = &task;
|
||||
if (!task.is_empty ()) {
|
||||
contextTask = &task;
|
||||
}
|
||||
e.evaluateInfixExpression (value, evaluatedValue);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,9 @@ void ColumnTypeNumeric::modify (Task& task, const std::string& value)
|
|||
{
|
||||
Eval e;
|
||||
e.addSource (domSource);
|
||||
contextTask = &task;
|
||||
if (!task.is_empty ()) {
|
||||
contextTask = &task;
|
||||
}
|
||||
e.evaluateInfixExpression (value, evaluatedValue);
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,9 @@ void ColumnTypeString::modify (Task& task, const std::string& value)
|
|||
{
|
||||
Eval e;
|
||||
e.addSource (domSource);
|
||||
contextTask = &task;
|
||||
if (!task.is_empty ()) {
|
||||
contextTask = &task;
|
||||
}
|
||||
|
||||
Variant v;
|
||||
e.evaluateInfixExpression (value, v);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue