summaryrefslogtreecommitdiffstats
path: root/src/verbs.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-07-24 23:26:11 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-07-24 23:26:11 +0000
commit7b6ffd82650ee1e20a53b0631d5c2dddef58e8d5 (patch)
tree48cae26bf789b11d79f72efc16a6676f960eaaa6 /src/verbs.cpp
parentupdate to trunk (diff)
parent3D box tool: the shift key must not prevent snapping of the vanishing point. ... (diff)
downloadinkscape-7b6ffd82650ee1e20a53b0631d5c2dddef58e8d5.tar.gz
inkscape-7b6ffd82650ee1e20a53b0631d5c2dddef58e8d5.zip
update to trunk
(bzr r12588.1.45)
Diffstat (limited to 'src/verbs.cpp')
-rw-r--r--src/verbs.cpp36
1 files changed, 3 insertions, 33 deletions
diff --git a/src/verbs.cpp b/src/verbs.cpp
index ea2c06dcf..e0ef27b0d 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -1350,39 +1350,9 @@ void LayerVerb::perform(SPAction *action, void *data)
}
case SP_VERB_LAYER_DUPLICATE: {
if ( dt->currentLayer() != dt->currentRoot() ) {
- // Note with either approach:
- // Any clone masters are duplicated, their clones use the *original*,
- // but the duplicated master is not linked up as master nor clone of the original.
-#if 0
- // Only copies selectable things, honoring locks, visibility, avoids sublayers.
- SPObject *new_layer = Inkscape::create_layer(dt->currentRoot(), dt->currentLayer(), LPOS_BELOW);
- if ( dt->currentLayer()->label() ) {
- gchar* name = g_strdup_printf(_("%s copy"), dt->currentLayer()->label());
- dt->layer_manager->renameLayer( new_layer, name, TRUE );
- g_free(name);
- }
- sp_edit_select_all(dt);
- sp_selection_duplicate(dt, true);
- sp_selection_to_prev_layer(dt, true);
- dt->setCurrentLayer(new_layer);
- sp_edit_select_all(dt);
-#else
- // Copies everything, regardless of locks, visibility, sublayers.
- //XML Tree being directly used here while it shouldn't be.
- Inkscape::XML::Node *selected = dt->currentLayer()->getRepr();
- Inkscape::XML::Node *parent = selected->parent();
- Inkscape::XML::Node *dup = selected->duplicate(parent->document());
- parent->addChild(dup, selected);
- SPObject *new_layer = dt->currentLayer()->next;
- if (new_layer) {
- if (new_layer->label()) {
- gchar* name = g_strdup_printf(_("%s copy"), new_layer->label());
- dt->layer_manager->renameLayer( new_layer, name, TRUE );
- g_free(name);
- }
- dt->setCurrentLayer(new_layer);
- }
-#endif
+
+ sp_selection_duplicate(dt, true, true);
+
DocumentUndo::done(dt->getDocument(), SP_VERB_LAYER_DUPLICATE,
_("Duplicate layer"));