summaryrefslogtreecommitdiffstats
path: root/src/document-undo.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-07-24 18:45:27 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-07-24 18:45:27 +0000
commit50115a1e39ed4414dd9e684709253167072b29ee (patch)
treea37ac591208a0f52e64ad7f5bddd45e773f138ee /src/document-undo.cpp
parentfix minor bug (diff)
parentFix a bug continuing a bezier path whith a LPE one like spiro or bspline on a... (diff)
downloadinkscape-50115a1e39ed4414dd9e684709253167072b29ee.tar.gz
inkscape-50115a1e39ed4414dd9e684709253167072b29ee.zip
update to trunk
(bzr r13708.1.37)
Diffstat (limited to 'src/document-undo.cpp')
-rw-r--r--src/document-undo.cpp22
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();