[gimp] Add more precondition checks to vectors import functions
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Add more precondition checks to vectors import functions
- Date: Mon, 10 Aug 2009 11:29:31 +0000 (UTC)
commit ae6828c1cc3aa38a1cb5d1954c736f62d6a8d24d
Author: Michael Natterer <mitch gimp org>
Date: Mon Aug 10 13:28:14 2009 +0200
Add more precondition checks to vectors import functions
(gimp_vectors_import_file)
(gimp_vectors_import_buffer): check the parent item the same
way gimp_image_add_vectors() does.
app/vectors/gimpvectors-import.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/app/vectors/gimpvectors-import.c b/app/vectors/gimpvectors-import.c
index bf0c570..8b305cd 100644
--- a/app/vectors/gimpvectors-import.c
+++ b/app/vectors/gimpvectors-import.c
@@ -209,6 +209,17 @@ gimp_vectors_import_file (GimpImage *image,
g_return_val_if_fail (parent == NULL ||
parent == GIMP_IMAGE_ACTIVE_PARENT ||
GIMP_IS_VECTORS (parent), FALSE);
+ g_return_val_if_fail (parent == NULL ||
+ parent == GIMP_IMAGE_ACTIVE_PARENT ||
+ gimp_item_is_attached (GIMP_ITEM (parent)), FALSE);
+ g_return_val_if_fail (parent == NULL ||
+ parent == GIMP_IMAGE_ACTIVE_PARENT ||
+ gimp_item_get_image (GIMP_ITEM (parent)) == 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 (ret_vectors == NULL || *ret_vectors == NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@@ -246,6 +257,17 @@ gimp_vectors_import_buffer (GimpImage *image,
g_return_val_if_fail (parent == NULL ||
parent == GIMP_IMAGE_ACTIVE_PARENT ||
GIMP_IS_VECTORS (parent), FALSE);
+ g_return_val_if_fail (parent == NULL ||
+ parent == GIMP_IMAGE_ACTIVE_PARENT ||
+ gimp_item_is_attached (GIMP_ITEM (parent)), FALSE);
+ g_return_val_if_fail (parent == NULL ||
+ parent == GIMP_IMAGE_ACTIVE_PARENT ||
+ gimp_item_get_image (GIMP_ITEM (parent)) == 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 (ret_vectors == NULL || *ret_vectors == NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]