[gimp] Make sure we don't try to reorder items into their children



commit 430588ac38b060c24cfb2858154c5a2af411ec90
Author: Michael Natterer <mitch gimp org>
Date:   Mon Feb 8 00:47:57 2010 +0100

    Make sure we don't try to reorder items into their children

 app/core/gimpitemtree.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpitemtree.c b/app/core/gimpitemtree.c
index af9217c..c581741 100644
--- a/app/core/gimpitemtree.c
+++ b/app/core/gimpitemtree.c
@@ -512,6 +512,11 @@ gimp_item_tree_reorder_item (GimpItemTree *tree,
   g_return_val_if_fail (new_parent == NULL ||
                         gimp_viewable_get_children (GIMP_VIEWABLE (new_parent)),
                         FALSE);
+  g_return_val_if_fail (item != new_parent, FALSE);
+  g_return_val_if_fail (new_parent == NULL ||
+                        ! gimp_viewable_is_ancestor (GIMP_VIEWABLE (item),
+                                                     GIMP_VIEWABLE (new_parent)),
+                        FALSE);
 
   container = gimp_item_get_container (item);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]