summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-07-04 15:27:06 +0000
committerJaviertxo <jtx@jtx.marker.es>2013-07-04 15:27:06 +0000
commitb8ef835cd10460cf7548bae4970b395e9d7767d9 (patch)
tree12e14b42023385cf8bf8192c2ae482a4f59deff1 /src/selection-chemistry.cpp
parentIm not sure what changes are (diff)
parentShape calculations. do not quantize the coordinates. (Bug 168158) (diff)
downloadinkscape-b8ef835cd10460cf7548bae4970b395e9d7767d9.tar.gz
inkscape-b8ef835cd10460cf7548bae4970b395e9d7767d9.zip
Upadate to trunk
(bzr r11950.1.122)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index cd0001175..56923859b 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 <svg> 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;
@@ -3030,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"));
@@ -3060,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);