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 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/selection-chemistry.cpp') 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; -- cgit v1.2.3 From c403397e07cf418588296f1f6fb479aca862c518 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 15 Jun 2013 09:29:48 -0400 Subject: Big change in symbols ui and selection chemistry. (bzr r12374) --- src/selection-chemistry.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 0fea43e30..56923859b 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -3032,19 +3032,17 @@ void sp_selection_unsymbol(SPDesktop *desktop) return; } - SPObject* use = selection->single(); + SPObject* symbol = selection->single(); // Make sure we have only one object in selection. // Require that we really have a that references a . - if( use == NULL || ( !SP_IS_USE( use ) && !SP_IS_SYMBOL( use->firstChild() ))) { + if( symbol == NULL || !SP_IS_SYMBOL( symbol )) { desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select only one symbol to convert to group.")); return; } doc->ensureUpToDate(); - SPObject* symbol = use->firstChild(); - Inkscape::XML::Node *group = xml_doc->createElement("svg:g"); group->setAttribute("style", symbol->getAttribute("style")); group->setAttribute("title", symbol->getAttribute("title")); @@ -3062,14 +3060,14 @@ void sp_selection_unsymbol(SPDesktop *desktop) child->deleteObject(true); } - SPObject* parent = use->parent; // So we insert next to (easier to find) + // So we insert inside the current layer + SPObject *parent = desktop->currentLayer(); // Need to delete ; all other elements that referenced should // auto-magically reference . symbol->deleteObject(true); group->setAttribute("id",id.c_str()); // After we delete symbol with same id. parent->getRepr()->appendChild(group); - //use->deleteObject(true); SPItem *group_item = static_cast(sp_desktop_document(desktop)->getObjectByRepr(group)); Inkscape::GC::release(group); -- cgit v1.2.3