[gimp] Add more precondition checks to gimp_item_tree_get_insert_pos()
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Add more precondition checks to gimp_item_tree_get_insert_pos()
- Date: Tue, 9 Feb 2010 21:42:01 +0000 (UTC)
commit e83954c49a95721eac9dd9b6ada7b98024986e4d
Author: Michael Natterer <mitch gimp org>
Date: Tue Feb 9 00:33:41 2010 +0100
Add more precondition checks to gimp_item_tree_get_insert_pos()
app/core/gimpitemtree.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpitemtree.c b/app/core/gimpitemtree.c
index 388a098..9623516 100644
--- a/app/core/gimpitemtree.c
+++ b/app/core/gimpitemtree.c
@@ -337,6 +337,23 @@ gimp_item_tree_get_insert_pos (GimpItemTree *tree,
private = GIMP_ITEM_TREE_GET_PRIVATE (tree);
+ g_return_val_if_fail (parent == NULL ||
+ parent == GIMP_IMAGE_ACTIVE_PARENT ||
+ G_TYPE_CHECK_INSTANCE_TYPE (parent, private->item_type),
+ FALSE);
+ g_return_val_if_fail (parent == NULL ||
+ parent == GIMP_IMAGE_ACTIVE_PARENT ||
+ gimp_item_is_attached (parent), FALSE);
+ g_return_val_if_fail (parent == NULL ||
+ parent == GIMP_IMAGE_ACTIVE_PARENT ||
+ gimp_item_get_image (parent) == private->image,
+ FALSE);
+ g_return_val_if_fail (parent == NULL ||
+ parent == GIMP_IMAGE_ACTIVE_PARENT ||
+ gimp_viewable_get_children (GIMP_VIEWABLE (parent)),
+ FALSE);
+ g_return_val_if_fail (position != NULL, NULL);
+
/* if we want to insert in the active item's parent container */
if (parent == GIMP_IMAGE_ACTIVE_PARENT)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]