diff --git a/src/lib/component/controller/CodeController.cpp b/src/lib/component/controller/CodeController.cpp index ff0fb2b4..c35cb9c5 100644 --- a/src/lib/component/controller/CodeController.cpp +++ b/src/lib/component/controller/CodeController.cpp @@ -224,7 +224,7 @@ void CodeController::handleMessage(MessageFocusOut* message) void CodeController::handleMessage(MessageScrollCode* message) { - if (!message->isFresh()) + if (message->isReplayed()) { getView()->scrollToValue(message->value); } @@ -287,7 +287,7 @@ CodeView* CodeController::getView() void CodeController::showContents(MessageBase* message) { - if (message->undoRedoType == MessageBase::UNDOTYPE_NORMAL) + if (!message->isReplayed()) { getView()->showContents(); } diff --git a/src/lib/component/controller/GraphController.cpp b/src/lib/component/controller/GraphController.cpp index 2dfc4698..fe8243a6 100644 --- a/src/lib/component/controller/GraphController.cpp +++ b/src/lib/component/controller/GraphController.cpp @@ -151,13 +151,13 @@ void GraphController::handleMessage(MessageGraphNodeMove* message) { node->position += message->delta; - if (message->isFresh()) + if (message->isReplayed()) { - getView()->resizeView(); + buildGraph(message); } else { - buildGraph(message); + getView()->resizeView(); } } } @@ -1176,7 +1176,7 @@ DummyNode* GraphController::findDummyNodeAccessRecursive( void GraphController::buildGraph(MessageBase* message) { - if (message->undoRedoType == MessageBase::UNDOTYPE_NORMAL) + if (!message->isReplayed()) { getView()->rebuildGraph(m_graph, m_dummyNodes, m_dummyEdges); m_graph.reset(); diff --git a/src/lib/component/controller/UndoRedoController.cpp b/src/lib/component/controller/UndoRedoController.cpp index 44cd8f64..78d84aad 100644 --- a/src/lib/component/controller/UndoRedoController.cpp +++ b/src/lib/component/controller/UndoRedoController.cpp @@ -10,8 +10,8 @@ UndoRedoController::UndoRedoController(StorageAccess* storageAccess) : m_activationTranslator(storageAccess) - , m_lastCommand(nullptr, 0) { + m_iterator = m_list.end(); } UndoRedoController::~UndoRedoController() @@ -23,7 +23,7 @@ UndoRedoView* UndoRedoController::getView() return Controller::getView(); } -UndoRedoController::Command::Command(std::shared_ptr message, size_t order) +UndoRedoController::Command::Command(std::shared_ptr message, Order order) : message(message) , order(order) { @@ -31,105 +31,115 @@ UndoRedoController::Command::Command(std::shared_ptr message, size_ void UndoRedoController::handleMessage(MessageActivateEdge* message) { - if (m_lastCommand.message && m_lastCommand.message->getType() == message->getType() && - static_cast(m_lastCommand.message.get())->getFullName() == message->getFullName()) + if (sameMessageTypeAsLast(message) && + static_cast(lastMessage())->getFullName() == message->getFullName()) { return; } - Command command(std::make_shared(*message), (message->isAggregation() ? 0 : 1)); + Command command( + std::make_shared(*message), + (message->isAggregation() ? Command::ORDER_ACTIVATE : Command::ORDER_ADAPT) + ); processCommand(command); } void UndoRedoController::handleMessage(MessageActivateFile* message) { - if (m_lastCommand.message && m_lastCommand.message->getType() == message->getType() && - static_cast(m_lastCommand.message.get())->filePath == message->filePath) + if (sameMessageTypeAsLast(message) && + static_cast(lastMessage())->filePath == message->filePath) { return; } - Command command(std::make_shared(*message), 0); + Command command(std::make_shared(*message), Command::ORDER_ACTIVATE); + processCommand(command); +} + +void UndoRedoController::handleMessage(MessageActivateLocalSymbols* message) +{ + if (sameMessageTypeAsLast(message)) + { + static_cast(lastMessage())->symbolIds = message->symbolIds; + return; + } + + Command command(std::make_shared(*message), Command::ORDER_VIEW); processCommand(command); } void UndoRedoController::handleMessage(MessageActivateNodes* message) { - if (m_lastCommand.message && - m_lastCommand.message->getType() == message->getType() && + if (sameMessageTypeAsLast(message) && message->nodes.size() && - static_cast(m_lastCommand.message.get())->nodes.size() == message->nodes.size() && - static_cast(m_lastCommand.message.get())->nodes[0].nameHierarchy.getQualifiedNameWithSignature() == + static_cast(lastMessage())->nodes.size() == message->nodes.size() && + static_cast(lastMessage())->nodes[0].nameHierarchy.getQualifiedNameWithSignature() == message->nodes[0].nameHierarchy.getQualifiedNameWithSignature()) { return; } - Command command(std::make_shared(*message), 0); + Command command(std::make_shared(*message), Command::ORDER_ACTIVATE); processCommand(command); } void UndoRedoController::handleMessage(MessageActivateTokenIds* message) { - if (m_lastCommand.message && m_lastCommand.message->getType() == message->getType() && message->tokenIds.size() && - static_cast(m_lastCommand.message.get())->tokenIds == message->tokenIds) + if (sameMessageTypeAsLast(message) && message->tokenIds.size() && + static_cast(lastMessage())->tokenIds == message->tokenIds) { return; } - Command command(std::make_shared(*message), 0); + Command command(std::make_shared(*message), Command::ORDER_ACTIVATE); processCommand(command); } void UndoRedoController::handleMessage(MessageChangeFileView* message) { - Command command(std::make_shared(*message), 1); + Command command(std::make_shared(*message), Command::ORDER_ADAPT); processCommand(command); } void UndoRedoController::handleMessage(MessageDeactivateEdge* message) { - MessageBase* m = nullptr; - - if (m_lastCommand.message && m_lastCommand.order == 0) + if (m_iterator == m_list.begin()) { - m = m_lastCommand.message.get(); - } - else if (m_undo.size()) - { - int i = m_undo.size() - 1; - while (i >= 0 && m_undo[i].order > 0) - { - i--; - } - m = m_undo[i].message.get(); + return; } - if (m) + std::list::iterator it = m_iterator; + do { - bool keepContent = m->keepContent(); - m->undoRedoType = MessageBase::UNDOTYPE_NORMAL; - m->setKeepContent(true); - m->dispatch(); - m->setKeepContent(keepContent); + std::advance(it, -1); } + while (it != m_list.begin() && it->order != Command::ORDER_ACTIVATE); + + MessageBase* m = it->message.get(); + bool keepContent = m->keepContent(); + + m->setIsReplayed(false); + m->setKeepContent(true); + m->dispatch(); + + m->setKeepContent(keepContent); } void UndoRedoController::handleMessage(MessageGraphNodeBundleSplit* message) { - Command command(std::make_shared(*message), 1); + Command command(std::make_shared(*message), Command::ORDER_ADAPT); processCommand(command); } void UndoRedoController::handleMessage(MessageGraphNodeExpand* message) { - Command command(std::make_shared(*message), 1); + Command command(std::make_shared(*message), Command::ORDER_ADAPT); processCommand(command); } void UndoRedoController::handleMessage(MessageGraphNodeMove* message) { - Command command(std::make_shared(*message), 1); + Command command(std::make_shared(*message), Command::ORDER_ADAPT); processCommand(command); } @@ -140,15 +150,28 @@ void UndoRedoController::handleMessage(MessageLoadProject* message) void UndoRedoController::handleMessage(MessageRedo* message) { - if (!m_redo.empty()) + if (m_iterator == m_list.end()) { - std::shared_ptr m = m_redo.back().message; - m_redo.pop_back(); - m->undoRedoType = MessageBase::UNDOTYPE_REDO; - m->dispatch(); - - MessageFlushUpdates().dispatch(); + return; } + + std::list::iterator oldIterator = m_iterator; + + std::advance(m_iterator, 1); + while (m_iterator->order == Command::ORDER_VIEW) + { + std::advance(m_iterator, 1); + } + + getView()->setUndoButtonEnabled(true); + if (m_iterator == m_list.end()) + { + getView()->setRedoButtonEnabled(false); + } + + replayCommands(oldIterator); + + MessageFlushUpdates().dispatch(); } void UndoRedoController::handleMessage(MessageRefresh* message) @@ -166,25 +189,7 @@ void UndoRedoController::handleMessage(MessageRefresh* message) } else { - if (m_lastCommand.order > 0) - { - replayCommands(false); - } - - std::shared_ptr msg = m_lastCommand.message; - - if (m_undo.size() > 0) - { - m_lastCommand = m_undo.back(); - m_undo.pop_back(); - } - else - { - m_lastCommand.message.reset(); - } - - msg->undoRedoType = MessageBase::UNDOTYPE_REDO; - msg->dispatch(); + replayCommands(); MessageFlushUpdates().dispatch(); } @@ -192,197 +197,198 @@ void UndoRedoController::handleMessage(MessageRefresh* message) void UndoRedoController::handleMessage(MessageScrollCode* message) { - if (!m_lastCommand.message) + if (sameMessageTypeAsLast(message)) { + static_cast(lastMessage())->value = message->value; return; } - if (m_lastCommand.subMessage && m_lastCommand.subMessage->getType() == message->getType()) - { - static_cast(m_lastCommand.subMessage.get())->value = message->value; - return; - } - - m_lastCommand.subMessage = std::make_shared(*message); + Command command(std::make_shared(*message), Command::ORDER_VIEW); + processCommand(command); } void UndoRedoController::handleMessage(MessageSearch* message) { - if (m_lastCommand.message && m_lastCommand.message->getType() == message->getType() && - static_cast(m_lastCommand.message.get())->getMatchesAsString() == message->getMatchesAsString()) + if (sameMessageTypeAsLast(message) && + static_cast(lastMessage())->getMatchesAsString() == message->getMatchesAsString()) { return; } - Command command(std::make_shared(*message), 0); + Command command(std::make_shared(*message), Command::ORDER_ACTIVATE); processCommand(command); } void UndoRedoController::handleMessage(MessageShowScope* message) { - Command command(std::make_shared(*message), 1); + Command command(std::make_shared(*message), Command::ORDER_ADAPT); processCommand(command); } void UndoRedoController::handleMessage(MessageUndo* message) { - replayCommands(true); + if (!m_list.size() || std::prev(m_iterator) == m_list.begin()) + { + return; + } + + while (std::prev(m_iterator)->order == Command::ORDER_VIEW) + { + std::advance(m_iterator, -1); + } + std::advance(m_iterator, -1); + + if (std::distance(m_list.begin(), m_iterator) <= 1) + { + getView()->setUndoButtonEnabled(false); + } + getView()->setRedoButtonEnabled(true); + + replayCommands(); MessageFlushUpdates().dispatch(); } -void UndoRedoController::replayCommands(bool removeLast) +void UndoRedoController::replayCommands() { - if (!m_undo.empty()) + std::list::iterator startIterator = m_iterator; + + do { - int i = m_undo.size() - 1; - while (i >= 1 && m_undo[i].order > 0) - { - i--; - } + std::advance(startIterator, -1); + } + while (startIterator != m_list.begin() && startIterator->order != Command::ORDER_ACTIVATE); - std::shared_ptr m; - while (i < int(m_undo.size() - 1)) + replayCommands(startIterator); +} + +void UndoRedoController::replayCommands(std::list::iterator it) +{ + std::vector::iterator> viewCommands; + + std::shared_ptr m; + while (it != m_iterator) + { + m = it->message; + if (it->order != Command::ORDER_VIEW) { - m = m_undo[i].message; - m->undoRedoType = MessageBase::UNDOTYPE_IGNORE; - m->setIsLast(false); + m->setIsReplayed(true); + m->setIsLast(it == std::prev(m_iterator)); m->dispatch(); - i++; - } - m = m_undo.back().message; - - std::shared_ptr sm; - if (m_lastCommand.order == 0) - { - sm = m_undo.back().subMessage; - } - - if (removeLast) - { - m_undo.pop_back(); - m->undoRedoType = MessageBase::UNDOTYPE_UNDO; + viewCommands.clear(); } else { - m->undoRedoType = MessageBase::UNDOTYPE_IGNORE; + viewCommands.push_back(it); } - m->setIsLast(!sm); - m->dispatch(); + std::advance(it, 1); + } - if (sm) + std::set messageTypes; + std::vector::iterator> lastViewCommands; + + for (size_t i = viewCommands.size(); i > 0; i--) + { + it = viewCommands[i - 1]; + if (messageTypes.find(it->message->getType()) == messageTypes.end()) { - sm->undoRedoType = MessageBase::UNDOTYPE_IGNORE; - sm->setIsLast(true); - sm->dispatch(); + messageTypes.insert(it->message->getType()); + lastViewCommands.push_back(it); } } + + for (size_t i = lastViewCommands.size(); i > 0; i--) + { + it = lastViewCommands[i - 1]; + m = it->message; + m->setIsReplayed(true); + m->setIsLast(it == std::prev(m_iterator)); + m->dispatch(); + } } void UndoRedoController::processCommand(Command command) { - if (command.order == 0 && command.message->keepContent()) + if (command.order == Command::ORDER_ACTIVATE && command.message->keepContent()) { - command.order = 1; + command.order = Command::ORDER_ADAPT; } - switch (command.message->undoRedoType) + if (!command.message->isReplayed()) { - case MessageBase::UNDOTYPE_NORMAL: - processNormalCommand(command); - break; - case MessageBase::UNDOTYPE_REDO: - processRedoCommand(command); - break; - case MessageBase::UNDOTYPE_UNDO: - processUndoCommand(command); - break; - case MessageBase::UNDOTYPE_IGNORE: - break; - } -} + if (command.order == Command::ORDER_ACTIVATE) + { + m_iterator = m_list.erase(m_iterator, m_list.end()); + } + else if (command.order == Command::ORDER_ADAPT) + { + std::list::iterator end = m_iterator; + while (end != m_list.end()) + { + if (end->order == Command::ORDER_ACTIVATE) + { + break; + } + std::advance(end, 1); + } -void UndoRedoController::processNormalCommand(const Command& command) -{ - if (m_lastCommand.message) - { - m_undo.push_back(m_lastCommand); - getView()->setUndoButtonEnabled(true); - } + m_iterator = m_list.erase(m_iterator, end); + } - m_lastCommand = command; + m_list.insert(m_iterator, command); - m_redo.clear(); - getView()->setRedoButtonEnabled(false); -} + if (command.order != Command::ORDER_VIEW) + { + if (m_list.begin() != std::prev(m_iterator)) + { + getView()->setUndoButtonEnabled(true); + } -void UndoRedoController::processRedoCommand(const Command& command) -{ - if (m_lastCommand.message) - { - m_undo.push_back(m_lastCommand); - getView()->setUndoButtonEnabled(true); - } - - m_lastCommand = command; - - if (m_redo.empty()) - { - getView()->setRedoButtonEnabled(false); - } -} - -void UndoRedoController::processUndoCommand(const Command& command) -{ - if (m_lastCommand.message) - { - m_redo.push_back(m_lastCommand); - getView()->setRedoButtonEnabled(true); - } - - m_lastCommand = command; - - if (m_undo.empty()) - { - getView()->setUndoButtonEnabled(false); + if (m_list.end() == m_iterator) + { + getView()->setRedoButtonEnabled(false); + } + } } } void UndoRedoController::clear() { - m_lastCommand = Command(nullptr, 0); - - m_undo.clear(); - m_redo.clear(); + m_list.clear(); + m_iterator = m_list.end(); getView()->setUndoButtonEnabled(false); getView()->setRedoButtonEnabled(false); } +bool UndoRedoController::sameMessageTypeAsLast(MessageBase* message) const +{ + if (!m_list.size() || m_list.begin() == m_iterator) + { + return false; + } + + return std::prev(m_iterator)->message->getType() == message->getType(); +} + +MessageBase* UndoRedoController::lastMessage() const +{ + return std::prev(m_iterator)->message.get(); +} + bool UndoRedoController::requiresActivateFallbackToken() const { - bool activateFallbackToken = true; - if (m_lastCommand.message) + std::list::iterator it = m_iterator; + + do { - if (m_lastCommand.order == 0) - { - activateFallbackToken = !checkCommandCausesTokenActivation(m_lastCommand); - } - else - { - for (int i = m_undo.size() - 1; i >= 0; i--) - { - if (m_undo[i].order == 0) - { - activateFallbackToken = !checkCommandCausesTokenActivation(m_undo[i]); - break; - } - } - } + std::advance(it, -1); } - return activateFallbackToken; + while (it != m_list.begin() && it->order != Command::ORDER_ACTIVATE); + + return !checkCommandCausesTokenActivation(*it); } bool UndoRedoController::checkCommandCausesTokenActivation(const Command& command) const @@ -403,7 +409,7 @@ bool UndoRedoController::checkCommandCausesTokenActivation(const Command& comman else if (commandMessageTypeString == MessageActivateNodes::getStaticType()) { MessageActivateNodes inputMessage(*dynamic_cast(commandMessage)); - inputMessage.undoRedoType = MessageBase::UNDOTYPE_REDO; + inputMessage.setIsReplayed(true); m = m_activationTranslator.translateMessage(&inputMessage); } else if (commandMessageTypeString == MessageSearch::getStaticType()) diff --git a/src/lib/component/controller/UndoRedoController.h b/src/lib/component/controller/UndoRedoController.h index cce664bd..b97cdaa1 100644 --- a/src/lib/component/controller/UndoRedoController.h +++ b/src/lib/component/controller/UndoRedoController.h @@ -1,12 +1,13 @@ #ifndef UNDO_REDO_CONTROLLER_H #define UNDO_REDO_CONTROLLER_H -#include +#include #include "utility/messaging/MessageBase.h" #include "utility/messaging/MessageListener.h" #include "utility/messaging/type/MessageActivateEdge.h" #include "utility/messaging/type/MessageActivateFile.h" +#include "utility/messaging/type/MessageActivateLocalSymbols.h" #include "utility/messaging/type/MessageActivateNodes.h" #include "utility/messaging/type/MessageActivateTokenIds.h" #include "utility/messaging/type/MessageChangeFileView.h" @@ -32,6 +33,7 @@ class UndoRedoController : public Controller , public MessageListener , public MessageListener + , public MessageListener , public MessageListener , public MessageListener , public MessageListener @@ -56,15 +58,22 @@ public: private: struct Command { - Command(std::shared_ptr message, size_t order); + enum Order + { + ORDER_ACTIVATE, + ORDER_ADAPT, + ORDER_VIEW + }; + + Command(std::shared_ptr message, Order order); std::shared_ptr message; - std::shared_ptr subMessage; - size_t order; + Order order; }; virtual void handleMessage(MessageActivateEdge* message); virtual void handleMessage(MessageActivateFile* message); + virtual void handleMessage(MessageActivateLocalSymbols* message); virtual void handleMessage(MessageActivateNodes* message); virtual void handleMessage(MessageActivateTokenIds* message); virtual void handleMessage(MessageChangeFileView* message); @@ -80,24 +89,23 @@ private: virtual void handleMessage(MessageShowScope* message); virtual void handleMessage(MessageUndo* message); - void replayCommands(bool removeLast); + void replayCommands(); + void replayCommands(std::list::iterator iterator); void processCommand(Command command); - void processNormalCommand(const Command& command); - void processRedoCommand(const Command& command); - void processUndoCommand(const Command& command); void clear(); + bool sameMessageTypeAsLast(MessageBase* message) const; + MessageBase* lastMessage() const; + bool requiresActivateFallbackToken() const; bool checkCommandCausesTokenActivation(const Command& command) const; ActivationTranslator m_activationTranslator; - Command m_lastCommand; - - std::deque m_undo; - std::deque m_redo; + std::list m_list; + std::list::iterator m_iterator; }; #endif // UNDO_REDO_CONTROLLER_H diff --git a/src/lib/component/controller/helper/ActivationTranslator.cpp b/src/lib/component/controller/helper/ActivationTranslator.cpp index 08212ae4..9b75f97d 100644 --- a/src/lib/component/controller/helper/ActivationTranslator.cpp +++ b/src/lib/component/controller/helper/ActivationTranslator.cpp @@ -36,7 +36,7 @@ std::shared_ptr ActivationTranslator::translateMessage(co { Id edgeId = message->tokenId; - if (!message->isFresh()) + if (message->isReplayed()) { edgeId = m_storageAccess->getIdForEdge(message->type, message->fromNameHierarchy, message->toNameHierarchy); } @@ -63,7 +63,7 @@ std::shared_ptr ActivationTranslator::translateMessage(co false, nullptr ); - msg.undoRedoType = message->undoRedoType; + msg.setIsReplayed(message->isReplayed()); msg.setKeepContent(message->keepContent()); msg.dispatch(); return nullptr; @@ -75,7 +75,7 @@ std::shared_ptr ActivationTranslator::translateMessage(co std::shared_ptr ActivationTranslator::translateMessage(const MessageActivateNodes* message) const { std::vector nodeIds; - if (message->isFresh()) + if (!message->isReplayed()) { for (const MessageActivateNodes::ActiveNode& node : message->nodes) { @@ -115,7 +115,7 @@ std::shared_ptr ActivationTranslator::translateMessage(co match.getFullName() == SearchMatch::getCommandName(SearchMatch::COMMAND_ALL)) { MessageActivateAll msg; - msg.undoRedoType = message->undoRedoType; + msg.setIsReplayed(message->isReplayed()); msg.dispatchImmediately(); return nullptr; } @@ -123,7 +123,7 @@ std::shared_ptr ActivationTranslator::translateMessage(co match.getFullName() == SearchMatch::getCommandName(SearchMatch::COMMAND_ERROR)) { MessageShowErrors msg(ErrorCountInfo(-1, 0)); - msg.undoRedoType = message->undoRedoType; + msg.setIsReplayed(message->isReplayed()); msg.dispatchImmediately(); return nullptr; } @@ -132,7 +132,7 @@ std::shared_ptr ActivationTranslator::translateMessage(co std::vector tokenIds = m_storageAccess->getTokenIdsForMatches(matches); std::shared_ptr m = std::make_shared(message, tokenIds); - if (message->isFresh()) + if (!message->isReplayed()) { m->isFromSearch = true; } diff --git a/src/lib/data/Storage.cpp b/src/lib/data/Storage.cpp index 016ce05c..1e5037e3 100644 --- a/src/lib/data/Storage.cpp +++ b/src/lib/data/Storage.cpp @@ -538,7 +538,10 @@ std::vector Storage::getTokenIdsForMatches(const std::vector& m std::vector ids; for (std::set::const_iterator it = idSet.begin(); it != idSet.end(); it++) { - ids.push_back(*it); + if (*it != 0) + { + ids.push_back(*it); + } } return ids; diff --git a/src/lib/utility/messaging/MessageBase.h b/src/lib/utility/messaging/MessageBase.h index 4e7823e1..fb597ec2 100644 --- a/src/lib/utility/messaging/MessageBase.h +++ b/src/lib/utility/messaging/MessageBase.h @@ -7,16 +7,8 @@ class MessageBase { public: - enum UndoType - { - UNDOTYPE_NORMAL, - UNDOTYPE_REDO, - UNDOTYPE_UNDO, - UNDOTYPE_IGNORE - }; - MessageBase() - : undoRedoType(UNDOTYPE_NORMAL) + : m_isReplayed(false) , m_sendAsTask(true) , m_keepContent(false) , m_cancelled(false) @@ -42,9 +34,14 @@ public: m_sendAsTask = sendAsTask; } - bool isFresh() const + bool isReplayed() const { - return (undoRedoType == UNDOTYPE_NORMAL); + return m_isReplayed; + } + + void setIsReplayed(bool isReplayed) + { + m_isReplayed = isReplayed; } bool isLast() const @@ -97,9 +94,8 @@ public: return ss.str(); } - UndoType undoRedoType; - private: + bool m_isReplayed; bool m_sendAsTask; bool m_keepContent; bool m_cancelled; diff --git a/src/lib/utility/messaging/type/MessageActivateTokens.h b/src/lib/utility/messaging/type/MessageActivateTokens.h index a3f0f2be..abadba51 100644 --- a/src/lib/utility/messaging/type/MessageActivateTokens.h +++ b/src/lib/utility/messaging/type/MessageActivateTokens.h @@ -15,7 +15,7 @@ public: , isFromSystem(false) , isFromSearch(false) { - undoRedoType = other->undoRedoType; + setIsReplayed(other->isReplayed()); setKeepContent(other->keepContent()); setIsLast(other->isLast()); } diff --git a/src/lib_gui/qt/element/QtCodeFile.cpp b/src/lib_gui/qt/element/QtCodeFile.cpp index c2d892af..f19bcdab 100644 --- a/src/lib_gui/qt/element/QtCodeFile.cpp +++ b/src/lib_gui/qt/element/QtCodeFile.cpp @@ -429,7 +429,8 @@ void QtCodeFile::requestSnippets() const hasErrors(), m_locationFile ); - msg.undoRedoType = MessageBase::UNDOTYPE_IGNORE; + + msg.setIsReplayed(true); msg.dispatch(); }