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/document-undo.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/document-undo.cpp') diff --git a/src/document-undo.cpp b/src/document-undo.cpp index 47d56ca66..f37b53f89 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -201,7 +201,9 @@ void finish_incomplete_transaction(SPDocument &doc) { g_warning ("Incomplete undo transaction:"); priv.partial = sp_repr_coalesce_log(priv.partial, log); sp_repr_debug_print_log(priv.partial); - priv.undo = g_slist_prepend(priv.undo, new Inkscape::Event(priv.partial)); + Inkscape::Event *event = new Inkscape::Event(priv.partial); + priv.undo = g_slist_prepend(priv.undo, event); + priv.undoStackObservers.notifyUndoCommitEvent(event); priv.partial = NULL; } } @@ -303,6 +305,9 @@ sp_document_redo (SPDocument *doc) void sp_document_clear_undo (SPDocument *doc) { + if (doc->priv->undo) + doc->priv->undoStackObservers.notifyClearUndoEvent(); + while (doc->priv->undo) { GSList *current; @@ -318,6 +323,9 @@ sp_document_clear_undo (SPDocument *doc) void sp_document_clear_redo (SPDocument *doc) { + if (doc->priv->redo) + doc->priv->undoStackObservers.notifyClearRedoEvent(); + while (doc->priv->redo) { GSList *current; -- cgit v1.2.3