diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2015-05-09 12:59:00 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2015-05-09 12:59:00 +0000 |
| commit | 9b1d6715ff2a56c9f1b94c0f8474c3e4efd48539 (patch) | |
| tree | 79f7fb25fb74141a6c1c9d9fccf2ae4c718a9d0c /src/verbs.cpp | |
| parent | fix crash introduces by recent rev when clipping (diff) | |
| download | inkscape-9b1d6715ff2a56c9f1b94c0f8474c3e4efd48539.tar.gz inkscape-9b1d6715ff2a56c9f1b94c0f8474c3e4efd48539.zip | |
duplicating layers now respect prefs for clone relinking
Fixed bugs:
- https://launchpad.net/bugs/267565
(bzr r14134)
Diffstat (limited to 'src/verbs.cpp')
| -rw-r--r-- | src/verbs.cpp | 36 |
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")); |
