From 1f8763829db5d6599ff0dc5afa9848e56cb49950 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 26 Apr 2014 11:53:34 -0700 Subject: [PATCH] CmdUndo - Converted from A3 to A3t. --- src/commands/CmdUndo.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/commands/CmdUndo.cpp b/src/commands/CmdUndo.cpp index 2a48b571a..b3ff41cb9 100644 --- a/src/commands/CmdUndo.cpp +++ b/src/commands/CmdUndo.cpp @@ -44,9 +44,11 @@ CmdUndo::CmdUndo () //////////////////////////////////////////////////////////////////////////////// int CmdUndo::execute (std::string& output) { - // Detect attemps to modify the task. - if (context.a3.extract_modifications ().size () > 0) - throw std::string (STRING_CMD_UNDO_MODS); + // Detect attempts to modify the task. + std::vector ::iterator i; + for (i = context.a3t.tree ()->_branches.begin (); i != context.a3t.tree ()->_branches.end (); ++i) + if ((*i)->hasTag ("MODIFICATION")) + throw std::string (STRING_CMD_UNDO_MODS); context.tdb2.revert (); context.tdb2.commit ();