diff options
| author | Martin Owens <doctormo@gmail.com> | 2013-06-15 13:29:48 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2013-06-15 13:29:48 +0000 |
| commit | c403397e07cf418588296f1f6fb479aca862c518 (patch) | |
| tree | 5a522fec44249f8178394e6db9a93b21a6714c83 /src/selection-chemistry.cpp | |
| parent | Allow svg elements to be ungrouped (diff) | |
| download | inkscape-c403397e07cf418588296f1f6fb479aca862c518.tar.gz inkscape-c403397e07cf418588296f1f6fb479aca862c518.zip | |
Big change in symbols ui and selection chemistry.
(bzr r12374)
Diffstat (limited to 'src/selection-chemistry.cpp')
| -rw-r--r-- | src/selection-chemistry.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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 <use> that references a <symbol>. - 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 <b>symbol</b> 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 <g> next to <use> (easier to find) + // So we insert <g> inside the current layer + SPObject *parent = desktop->currentLayer(); // Need to delete <symbol>; all other <use> elements that referenced <symbol> should // auto-magically reference <g>. 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<SPItem *>(sp_desktop_document(desktop)->getObjectByRepr(group)); Inkscape::GC::release(group); |
