summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-05-09 01:14:55 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-05-09 01:14:55 +0000
commitf56b23d79e2947fdb916f3c641a2d3bbe365944c (patch)
treeb9f7d2c85381b8b3f8e8702ce28c7a83481823b5 /src/selection-chemistry.cpp
parentupdate changelog (diff)
downloadinkscape-f56b23d79e2947fdb916f3c641a2d3bbe365944c.tar.gz
inkscape-f56b23d79e2947fdb916f3c641a2d3bbe365944c.zip
patch from Niko Kiirala for bug 1482973
(bzr r781)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index a1363850d..2be0b9282 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -1230,7 +1230,13 @@ void sp_selection_to_next_layer ()
GSList *temp_clip = NULL;
sp_selection_copy_impl (items, &temp_clip, NULL, NULL); // we're in the same doc, so no need to copy defs
sp_selection_delete_impl (items);
- GSList *copied = sp_selection_paste_impl (sp_desktop_document (dt), next, &temp_clip, NULL);
+ next=Inkscape::next_layer(dt->currentRoot(), dt->currentLayer()); // Fixes bug 1482973: crash while moving layers
+ GSList *copied;
+ if(next) {
+ copied = sp_selection_paste_impl (sp_desktop_document (dt), next, &temp_clip, NULL);
+ } else {
+ copied = sp_selection_paste_impl (sp_desktop_document (dt), dt->currentLayer(), &temp_clip, NULL);
+ }
selection->setReprList((GSList const *) copied);
g_slist_free (copied);
if (temp_clip) g_slist_free (temp_clip);
@@ -1262,7 +1268,13 @@ void sp_selection_to_prev_layer ()
GSList *temp_clip = NULL;
sp_selection_copy_impl (items, &temp_clip, NULL, NULL); // we're in the same doc, so no need to copy defs
sp_selection_delete_impl (items);
- GSList *copied = sp_selection_paste_impl (sp_desktop_document (dt), next, &temp_clip, NULL);
+ next=Inkscape::previous_layer(dt->currentRoot(), dt->currentLayer()); // Fixes bug 1482973: crash while moving layers
+ GSList *copied;
+ if(next) {
+ copied = sp_selection_paste_impl (sp_desktop_document (dt), next, &temp_clip, NULL);
+ } else {
+ copied = sp_selection_paste_impl (sp_desktop_document (dt), dt->currentLayer(), &temp_clip, NULL);
+ }
selection->setReprList((GSList const *) copied);
g_slist_free (copied);
if (temp_clip) g_slist_free (temp_clip);