diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-06-25 16:15:05 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-06-25 16:15:05 +0000 |
| commit | 5c2d982cc636ee4e2bc12703c01c86e245dd821f (patch) | |
| tree | 6e6f22800c7d38314e14eccd486b65c3c4286d81 /src/document-undo.cpp | |
| parent | update to trunk (diff) | |
| parent | Fix for the bug 1468396 (diff) | |
| download | inkscape-5c2d982cc636ee4e2bc12703c01c86e245dd821f.tar.gz inkscape-5c2d982cc636ee4e2bc12703c01c86e245dd821f.zip | |
update to trunk
(bzr r13645.1.94)
Diffstat (limited to 'src/document-undo.cpp')
| -rw-r--r-- | src/document-undo.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/document-undo.cpp b/src/document-undo.cpp index d4015bafb..59e060cd5 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -217,6 +217,25 @@ static void finish_incomplete_transaction(SPDocument &doc) { } } +static void perform_document_update(SPDocument &doc) { + sp_repr_begin_transaction(doc.rdoc); + doc.ensureUpToDate(); + + Inkscape::XML::Event *update_log=sp_repr_commit_undoable(doc.rdoc); + if (update_log != NULL) { + g_warning("Document was modified while being updated after undo operation"); + sp_repr_debug_print_log(update_log); + + //Coalesce the update changes with the last action performed by user + Inkscape::Event* undo_stack_top = (Inkscape::Event *)doc.priv->undo->data; + if (undo_stack_top) { + undo_stack_top->event = sp_repr_coalesce_log(undo_stack_top->event, update_log); + } else { + sp_repr_free_log(update_log); + } + } +} + gboolean Inkscape::DocumentUndo::undo(SPDocument *doc) { using Inkscape::Debug::EventTracker; @@ -241,7 +260,8 @@ gboolean Inkscape::DocumentUndo::undo(SPDocument *doc) Inkscape::Event *log=(Inkscape::Event *)doc->priv->undo->data; doc->priv->undo = g_slist_remove (doc->priv->undo, log); sp_repr_undo_log (log->event); - //doc->_updateDocument(); + perform_document_update(*doc); + doc->priv->redo = g_slist_prepend (doc->priv->redo, log); doc->setModifiedSinceSave(); |
