mirror of https://github.com/GNOME/gimp.git
require "name" being non-NULL.
2007-01-31 Michael Natterer <mitch@gimp.org> * app/core/gimpitem.c (gimp_item_parasite_detach): require "name" being non-NULL. * app/core/gimpimage-undo-push.c (undo_pop_parasite): removed dead code which handled parasites of the Gimp itself, don't include "gimp-parasites.h". Require "parasite" and "name" being non-NULL in all public parasite undo functions. svn path=/trunk/; revision=21829
This commit is contained in:
parent
d0df7dae38
commit
6072f873b8
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2007-01-31 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/core/gimpitem.c (gimp_item_parasite_detach): require "name"
|
||||||
|
being non-NULL.
|
||||||
|
|
||||||
|
* app/core/gimpimage-undo-push.c (undo_pop_parasite): removed dead
|
||||||
|
code which handled parasites of the Gimp itself, don't include
|
||||||
|
"gimp-parasites.h".
|
||||||
|
|
||||||
|
Require "parasite" and "name" being non-NULL in all public
|
||||||
|
parasite undo functions.
|
||||||
|
|
||||||
2007-01-31 Michael Natterer <mitch@gimp.org>
|
2007-01-31 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/core/gimpmaskundo.c
|
* app/core/gimpmaskundo.c
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#include "base/tile-manager.h"
|
#include "base/tile-manager.h"
|
||||||
|
|
||||||
#include "gimp.h"
|
#include "gimp.h"
|
||||||
#include "gimp-parasites.h"
|
|
||||||
#include "gimpchannelpropundo.h"
|
#include "gimpchannelpropundo.h"
|
||||||
#include "gimpchannelundo.h"
|
#include "gimpchannelundo.h"
|
||||||
#include "gimpdrawablemodundo.h"
|
#include "gimpdrawablemodundo.h"
|
||||||
|
@ -1003,6 +1002,7 @@ gimp_image_undo_push_image_parasite (GimpImage *image,
|
||||||
GimpUndo *new;
|
GimpUndo *new;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||||
|
g_return_val_if_fail (parasite != NULL, NULL);
|
||||||
|
|
||||||
if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO,
|
if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO,
|
||||||
sizeof (ParasiteUndo),
|
sizeof (ParasiteUndo),
|
||||||
|
@ -1035,6 +1035,7 @@ gimp_image_undo_push_image_parasite_remove (GimpImage *image,
|
||||||
GimpUndo *new;
|
GimpUndo *new;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||||
|
g_return_val_if_fail (name != NULL, NULL);
|
||||||
|
|
||||||
if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO,
|
if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO,
|
||||||
sizeof (ParasiteUndo),
|
sizeof (ParasiteUndo),
|
||||||
|
@ -1070,6 +1071,7 @@ gimp_image_undo_push_item_parasite (GimpImage *image,
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||||
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
|
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
|
||||||
g_return_val_if_fail (gimp_item_is_attached (item), NULL);
|
g_return_val_if_fail (gimp_item_is_attached (item), NULL);
|
||||||
|
g_return_val_if_fail (parasite != NULL, NULL);
|
||||||
|
|
||||||
if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO,
|
if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO,
|
||||||
sizeof (ParasiteUndo),
|
sizeof (ParasiteUndo),
|
||||||
|
@ -1104,6 +1106,7 @@ gimp_image_undo_push_item_parasite_remove (GimpImage *image,
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||||
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
|
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
|
||||||
g_return_val_if_fail (gimp_item_is_attached (item), NULL);
|
g_return_val_if_fail (gimp_item_is_attached (item), NULL);
|
||||||
|
g_return_val_if_fail (name != NULL, NULL);
|
||||||
|
|
||||||
if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO,
|
if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO,
|
||||||
sizeof (ParasiteUndo),
|
sizeof (ParasiteUndo),
|
||||||
|
@ -1155,15 +1158,6 @@ undo_pop_parasite (GimpUndo *undo,
|
||||||
else
|
else
|
||||||
gimp_parasite_list_remove (pu->item->parasites, pu->name);
|
gimp_parasite_list_remove (pu->item->parasites, pu->name);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
pu->parasite = gimp_parasite_copy (gimp_parasite_find (undo->image->gimp,
|
|
||||||
pu->name));
|
|
||||||
if (tmp)
|
|
||||||
gimp_parasite_attach (undo->image->gimp, tmp);
|
|
||||||
else
|
|
||||||
gimp_parasite_detach (undo->image->gimp, pu->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tmp)
|
if (tmp)
|
||||||
gimp_parasite_free (tmp);
|
gimp_parasite_free (tmp);
|
||||||
|
@ -1179,6 +1173,7 @@ undo_free_parasite (GimpUndo *undo,
|
||||||
|
|
||||||
if (pu->parasite)
|
if (pu->parasite)
|
||||||
gimp_parasite_free (pu->parasite);
|
gimp_parasite_free (pu->parasite);
|
||||||
|
|
||||||
if (pu->name)
|
if (pu->name)
|
||||||
g_free (pu->name);
|
g_free (pu->name);
|
||||||
|
|
||||||
|
|
|
@ -1173,6 +1173,7 @@ gimp_item_parasite_detach (GimpItem *item,
|
||||||
const GimpParasite *parasite;
|
const GimpParasite *parasite;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_ITEM (item));
|
g_return_if_fail (GIMP_IS_ITEM (item));
|
||||||
|
g_return_if_fail (name != NULL);
|
||||||
|
|
||||||
parasite = gimp_parasite_list_find (item->parasites, name);
|
parasite = gimp_parasite_list_find (item->parasites, name);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue