From c905425451f756e070a2f0991892d397ba84ed24 Mon Sep 17 00:00:00 2001 From: gustav_b Date: Thu, 29 Mar 2007 23:02:20 +0000 Subject: Notify UndoStackObservers on commited incomplete transactions and sp_document_{undo,redo}_clear, see #1684042. (bzr r2780) --- src/composite-undo-stack-observer.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/composite-undo-stack-observer.cpp') diff --git a/src/composite-undo-stack-observer.cpp b/src/composite-undo-stack-observer.cpp index 85d7aed13..03e4796bd 100644 --- a/src/composite-undo-stack-observer.cpp +++ b/src/composite-undo-stack-observer.cpp @@ -79,6 +79,30 @@ CompositeUndoStackObserver::notifyUndoCommitEvent(Event* log) this->_unlock(); } +void +CompositeUndoStackObserver::notifyClearUndoEvent() +{ + this->_lock(); + for(UndoObserverRecordList::iterator i = this->_active.begin(); i != _active.end(); ++i) { + if (!i->to_remove) { + i->issueClearUndo(); + } + } + this->_unlock(); +} + +void +CompositeUndoStackObserver::notifyClearRedoEvent() +{ + this->_lock(); + for(UndoObserverRecordList::iterator i = this->_active.begin(); i != _active.end(); ++i) { + if (!i->to_remove) { + i->issueClearRedo(); + } + } + this->_unlock(); +} + bool CompositeUndoStackObserver::_remove_one(UndoObserverRecordList& list, UndoStackObserver& o) { -- cgit v1.2.3