cleaned up sanity checks and handling of undo groups. Fixes bug #395798.

2007-01-15  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/curve_bend.c: cleaned up sanity checks and
	handling of undo groups. Fixes bug #395798.


svn path=/trunk/; revision=21711
This commit is contained in:
Sven Neumann 2007-01-15 10:35:58 +00:00 committed by Sven Neumann
parent ac2ee350d3
commit a168e833f2
2 changed files with 12 additions and 25 deletions

View File

@ -1,3 +1,8 @@
2007-01-15 Sven Neumann <sven@gimp.org>
* plug-ins/common/curve_bend.c: cleaned up sanity checks and
handling of undo groups. Fixes bug #395798.
2007-01-15 Sven Neumann <sven@gimp.org>
* plug-ins/imagemap/imap_csim_lex.c

View File

@ -671,8 +671,6 @@ run (const gchar *name,
l_image_id = param[1].data.d_int32;
l_layer_id = param[2].data.d_drawable;
gimp_image_undo_group_start (l_image_id);
if (! gimp_drawable_is_layer (l_layer_id))
{
g_message (_("Can operate on layers only (but was called on channel or mask)."));
@ -683,19 +681,8 @@ run (const gchar *name,
l_layer_mask_id = gimp_layer_get_mask (l_layer_id);
if (l_layer_mask_id >= 0)
{
/* apply the layermask
* some transitions (especially rotate) cant operate proper on
* layers with masks !
*/
if (run_mode == GIMP_RUN_NONINTERACTIVE)
{
gimp_layer_remove_mask (l_layer_id, 0 /* 0==APPLY */ );
}
else
{
g_message (_("Cannot operate on layers with masks."));
status = GIMP_PDB_EXECUTION_ERROR;
}
g_message (_("Cannot operate on layers with masks."));
status = GIMP_PDB_EXECUTION_ERROR;
}
/* if there is a selection, make it the floating selection layer */
@ -705,11 +692,8 @@ run (const gchar *name,
/* could not float the selection because selection rectangle
* is completely empty return GIMP_PDB_EXECUTION_ERROR
*/
g_message (_("Cannot operate on empty selections."));
status = GIMP_PDB_EXECUTION_ERROR;
if (run_mode != GIMP_RUN_NONINTERACTIVE)
{
g_message (_("Cannot operate on empty selections."));
}
}
else
{
@ -796,8 +780,12 @@ run (const gchar *name,
if (cd->run)
{
gimp_image_undo_group_start (l_image_id);
l_bent_layer_id = p_main_bend (cd, cd->drawable, cd->work_on_copy);
gimp_image_undo_group_end (l_image_id);
/* Store variable states for next run */
if (run_mode == GIMP_RUN_INTERACTIVE)
{
@ -809,15 +797,9 @@ run (const gchar *name,
status = GIMP_PDB_CANCEL;
}
gimp_image_undo_group_end (l_image_id);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
}
else
{
gimp_image_undo_group_end (l_image_id);
}
values[0].data.d_status = status;
values[1].data.d_int32 = l_bent_layer_id; /* return the id of handled layer */