From 70f07d3a84ebcc213420c8028a2bc3d1dd4110d4 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 4 Mar 2016 20:19:00 +0100 Subject: Fix for bug 415471 and 1553182 related to undo with eraser tool Fixed bugs: - https://launchpad.net/bugs/1553182 (bzr r14688) --- src/path-chemistry.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/path-chemistry.cpp') diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 7b52ac2e1..15d3f0f99 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -52,7 +52,7 @@ inline bool less_than_items(SPItem const *first, SPItem const *second) } void -sp_selected_path_combine(SPDesktop *desktop) +sp_selected_path_combine(SPDesktop *desktop, bool skip_undo) { Inkscape::Selection *selection = desktop->getSelection(); SPDocument *doc = desktop->getDocument(); @@ -172,10 +172,10 @@ sp_selected_path_combine(SPDesktop *desktop) // move to the position of the topmost, reduced by the number of deleted items repr->setPosition(position > 0 ? position : 0); - - DocumentUndo::done(desktop->getDocument(), SP_VERB_SELECTION_COMBINE, - _("Combine")); - + if ( !skip_undo ) { + DocumentUndo::done(desktop->getDocument(), SP_VERB_SELECTION_COMBINE, + _("Combine")); + } selection->set(repr); Inkscape::GC::release(repr); @@ -188,7 +188,7 @@ sp_selected_path_combine(SPDesktop *desktop) } void -sp_selected_path_break_apart(SPDesktop *desktop) +sp_selected_path_break_apart(SPDesktop *desktop, bool skip_undo) { Inkscape::Selection *selection = desktop->getSelection(); @@ -283,8 +283,10 @@ sp_selected_path_break_apart(SPDesktop *desktop) desktop->clearWaitingCursor(); if (did) { - DocumentUndo::done(desktop->getDocument(), SP_VERB_SELECTION_BREAK_APART, - _("Break apart")); + if ( !skip_undo ) { + DocumentUndo::done(desktop->getDocument(), SP_VERB_SELECTION_BREAK_APART, + _("Break apart")); + } } else { desktop->getMessageStack()->flash(Inkscape::ERROR_MESSAGE, _("No path(s) to break apart in the selection.")); } -- cgit v1.2.3