mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug
- Fixed bug in DOM access where the attribute name was not being properly used for UUID-based lookup.
This commit is contained in:
parent
06d905b633
commit
6555811ca5
1 changed files with 10 additions and 4 deletions
14
src/DOM.cpp
14
src/DOM.cpp
|
@ -179,6 +179,8 @@ const std::string DOM::get (const std::string& name)
|
|||
const std::string DOM::get (const std::string& name, const Task& task)
|
||||
{
|
||||
Nibbler n (name);
|
||||
n.save ();
|
||||
|
||||
int id;
|
||||
std::string uuid;
|
||||
std::string canonical;
|
||||
|
@ -189,7 +191,7 @@ const std::string DOM::get (const std::string& name, const Task& task)
|
|||
else if (A3::is_attribute (name, canonical)) return task.get (canonical);
|
||||
|
||||
// <id>.<name>
|
||||
else if (n.getInt (id))
|
||||
if (n.getInt (id))
|
||||
{
|
||||
if (n.skip ('.'))
|
||||
{
|
||||
|
@ -206,10 +208,12 @@ const std::string DOM::get (const std::string& name, const Task& task)
|
|||
else if (attr == "urgency") return format (ref.urgency_c ());
|
||||
else if (A3::is_attribute (attr, canonical)) return ref.get (canonical);
|
||||
}
|
||||
|
||||
n.restore ();
|
||||
}
|
||||
|
||||
// <uuid>.<name>
|
||||
else if (n.getUUID (uuid))
|
||||
if (n.getUUID (uuid))
|
||||
{
|
||||
if (n.skip ('.'))
|
||||
{
|
||||
|
@ -222,10 +226,12 @@ const std::string DOM::get (const std::string& name, const Task& task)
|
|||
std::string attr;
|
||||
n.getUntilEOS (attr);
|
||||
|
||||
if (name == "id") return format (ref.id);
|
||||
else if (name == "urgency") return format (ref.urgency_c (), 4, 3);
|
||||
if (attr == "id") return format (ref.id);
|
||||
else if (attr == "urgency") return format (ref.urgency_c (), 4, 3);
|
||||
else if (A3::is_attribute (attr, canonical)) return ref.get (canonical);
|
||||
}
|
||||
|
||||
n.restore ();
|
||||
}
|
||||
|
||||
// Delegate to the context-free version of DOM::get.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue