From 250986a5113de9c1fbe4444247ffa94535c79e26 Mon Sep 17 00:00:00 2001 From: Alexander Brock Date: Sun, 6 Nov 2016 20:02:31 +0100 Subject: Remove duplicate code from unlinkRecursive() and fix issue with clones of groups (bzr r15204.1.4) --- src/selection-chemistry.cpp | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index dbad56b13..694e12f55 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2749,30 +2749,15 @@ bool ObjectSet::unlinkRecursive(const bool skip_undo) { bool unlinked = false; ObjectSet tmp_set(document()); std::vector items_(items().begin(), items().end()); - for (auto& it:items_){ + for (auto& it:items_) { + tmp_set.set(it); + unlinked = tmp_set.unlink(true) || unlinked; + it = tmp_set.singleItem(); if (SP_IS_GROUP(it)) { std::vector c = it->childList(false); tmp_set.setList(c); unlinked = tmp_set.unlinkRecursive(true) || unlinked; } - tmp_set.set(it); - bool has_clip = false; - bool has_mask = false; - Inkscape::URIReference *clip = it->clip_ref; - Inkscape::URIReference *mask = it->mask_ref; - if ((NULL != clip) && (NULL != clip->getObject())) { - tmp_set.unsetMask(true,true); - has_clip = true; - } - if ((NULL != mask) && (NULL != mask->getObject())) { - tmp_set.unsetMask(false,true); - has_mask = true; - } - unlinked = tmp_set.unlink(true) || unlinked; - if (has_mask) - tmp_set.setMask(false,false,true); - if (has_clip) - tmp_set.setMask(true,false,true); } if (!unlinked) { if(desktop()) -- cgit v1.2.3