From a1d971856661b0655ed798941195f100aadf3dc4 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Fri, 14 Jun 2013 06:39:11 -0400 Subject: Allow svg elements to be ungrouped Fixed bugs: - https://launchpad.net/bugs/166327 (bzr r12373) --- src/selection-chemistry.cpp | 6 ++++-- src/sp-item-group.cpp | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index cd0001175..0fea43e30 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -784,8 +784,10 @@ void sp_selection_ungroup(SPDesktop *desktop) continue; } - /* We do not allow ungrouping etc. (lauris) */ - if (strcmp(group->getRepr()->name(), "svg:g") && strcmp(group->getRepr()->name(), "svg:switch")) { + // This check reflects the g_return_if_fail in sp_item_group_ungroup and + // may be a redundent. It also allows ungrouping of 'a' tags and we dont + if (strcmp(group->getRepr()->name(), "svg:g") && strcmp(group->getRepr()->name(), "svg:switch") && + strcmp(group->getRepr()->name(), "svg:svg")) { // keep the non-group item in the new selection new_select = g_slist_append(new_select, group); continue; diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 3ba1ecd5f..a2eda6625 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -324,7 +324,10 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) SPItem *gitem = group; Inkscape::XML::Node *grepr = gitem->getRepr(); - g_return_if_fail (!strcmp (grepr->name(), "svg:g") || !strcmp (grepr->name(), "svg:a") || !strcmp (grepr->name(), "svg:switch")); + g_return_if_fail (!strcmp (grepr->name(), "svg:g") + || !strcmp (grepr->name(), "svg:a") + || !strcmp (grepr->name(), "svg:switch") + || !strcmp (grepr->name(), "svg:svg")); // this converts the gradient/pattern fill/stroke on the group, if any, to userSpaceOnUse gitem->adjust_paint_recursive (Geom::identity(), Geom::identity(), false); -- cgit v1.2.3