diff options
| author | Alexander Brock <zaibu@lunar-orbit.de> | 2016-11-06 19:02:31 +0000 |
|---|---|---|
| committer | Alexander Brock <zaibu@lunar-orbit.de> | 2016-11-06 19:02:31 +0000 |
| commit | 250986a5113de9c1fbe4444247ffa94535c79e26 (patch) | |
| tree | 6b40e4801de29fe0953dfc43f7ecf0480d14f4fb /src/selection-chemistry.cpp | |
| parent | Make ObjectSet::unlink() work for clones which are both clipped and masked (diff) | |
| download | inkscape-250986a5113de9c1fbe4444247ffa94535c79e26.tar.gz inkscape-250986a5113de9c1fbe4444247ffa94535c79e26.zip | |
Remove duplicate code from unlinkRecursive() and fix issue with clones of groups
(bzr r15204.1.4)
Diffstat (limited to 'src/selection-chemistry.cpp')
| -rw-r--r-- | src/selection-chemistry.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
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<SPItem*> 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<SPObject*> 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()) |
