Commit 28061c23 authored by Michael Natterer's avatar Michael Natterer 😴

Don't modify locked items from PDB wrappers

* app/pdb/gimppdb-utils.[ch]: add "gboolean writable" parameter to
  gimp_pdb_item_is_attached() because this function is called on
  almost all items where a check for locked is needed.

* tools/pdbgen/pdb/*.pdb: pass writable = TRUE in all checks for items
  that are modified. Add explicit calls to gimp_pdb_item_is_writable()
  in some rare cases.

* app/pdb/*-cmds.c: regenerated.
parent b5c3e5a6
......@@ -66,7 +66,7 @@ brightness_contrast_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable))
success = FALSE;
......@@ -106,7 +106,7 @@ levels_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable) ||
(! gimp_drawable_has_alpha (drawable) &&
channel == GIMP_HISTOGRAM_ALPHA) ||
......@@ -141,7 +141,7 @@ levels_auto_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable))
success = FALSE;
......@@ -168,7 +168,7 @@ levels_stretch_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable))
success = FALSE;
......@@ -197,7 +197,7 @@ posterize_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable))
success = FALSE;
......@@ -224,7 +224,7 @@ desaturate_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
! gimp_drawable_is_rgb (drawable))
success = FALSE;
......@@ -253,7 +253,7 @@ desaturate_full_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
! gimp_drawable_is_rgb (drawable))
success = FALSE;
......@@ -282,7 +282,7 @@ equalize_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable))
success = FALSE;
......@@ -309,7 +309,7 @@ invert_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable))
success = FALSE;
......@@ -342,7 +342,7 @@ curves_spline_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable) || (num_points & 1) ||
(! gimp_drawable_has_alpha (drawable) &&
channel == GIMP_HISTOGRAM_ALPHA) ||
......@@ -380,7 +380,7 @@ curves_explicit_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable) || (num_bytes != 256) ||
(! gimp_drawable_has_alpha (drawable) &&
channel == GIMP_HISTOGRAM_ALPHA) ||
......@@ -422,7 +422,7 @@ color_balance_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable))
success = FALSE;
......@@ -458,7 +458,7 @@ colorize_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
! gimp_drawable_is_rgb (drawable))
success = FALSE;
......@@ -499,7 +499,7 @@ histogram_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error) ||
gimp_drawable_is_indexed (drawable) ||
(! gimp_drawable_has_alpha (drawable) &&
channel == GIMP_HISTOGRAM_ALPHA) ||
......@@ -567,7 +567,7 @@ hue_saturation_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable))
success = FALSE;
......@@ -599,7 +599,7 @@ threshold_invoker (GimpProcedure *procedure,
if (success)
{
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) ||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
gimp_drawable_is_indexed (drawable) ||
(low_threshold > high_threshold))
success = FALSE;
......
......@@ -798,7 +798,7 @@ drawable_mask_bounds_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error))
non_empty = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
else
success = FALSE;
......@@ -840,7 +840,7 @@ drawable_mask_intersect_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error))
non_empty = gimp_drawable_mask_intersect (drawable,
&x, &y, &width, &height);
else
......@@ -879,7 +879,7 @@ drawable_merge_shadow_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
const gchar *undo_desc = _("Plug-In");
......@@ -1036,7 +1036,8 @@ drawable_set_pixel_invoker (GimpProcedure *procedure,
if (success)
{
if (x_coord < gimp_item_get_width (GIMP_ITEM (drawable)) &&
if (gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error) &&
x_coord < gimp_item_get_width (GIMP_ITEM (drawable)) &&
y_coord < gimp_item_get_height (GIMP_ITEM (drawable)) &&
num_channels == gimp_drawable_bytes (drawable))
{
......@@ -1082,7 +1083,10 @@ drawable_fill_invoker (GimpProcedure *procedure,
if (success)
{
gimp_drawable_fill_by_type (drawable, context, (GimpFillType) fill_type);
if (gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error))
gimp_drawable_fill_by_type (drawable, context, (GimpFillType) fill_type);
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
......@@ -1112,7 +1116,7 @@ drawable_offset_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
gimp_drawable_offset (drawable, context, wrap_around, fill_type,
offset_x, offset_y);
else
......@@ -1304,7 +1308,7 @@ drawable_foreground_extract_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error))
gimp_drawable_foreground_extract (drawable, mode, mask, progress);
else
success = FALSE;
......
......@@ -68,7 +68,7 @@ drawable_transform_flip_simple_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -125,7 +125,7 @@ drawable_transform_flip_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -196,7 +196,7 @@ drawable_transform_flip_default_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -285,7 +285,7 @@ drawable_transform_perspective_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -366,7 +366,7 @@ drawable_transform_perspective_default_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -441,7 +441,7 @@ drawable_transform_rotate_simple_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -498,7 +498,7 @@ drawable_transform_rotate_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -573,7 +573,7 @@ drawable_transform_rotate_default_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -658,7 +658,7 @@ drawable_transform_scale_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) && x0 < x1 && y0 < y1);
success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) && x0 < x1 && y0 < y1);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -730,7 +730,7 @@ drawable_transform_scale_default_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) && x0 < x1 && y0 < y1);
success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) && x0 < x1 && y0 < y1);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -808,7 +808,7 @@ drawable_transform_shear_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -876,7 +876,7 @@ drawable_transform_shear_default_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -964,7 +964,7 @@ drawable_transform_2d_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -1043,7 +1043,7 @@ drawable_transform_2d_default_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -1136,7 +1136,7 @@ drawable_transform_matrix_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......@@ -1223,7 +1223,7 @@ drawable_transform_matrix_default_invoker (GimpProcedure *procedure,
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success &&
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
......
......@@ -63,7 +63,7 @@ edit_cut_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
GError *my_error = NULL;
......@@ -108,7 +108,7 @@ edit_copy_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error))
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
GError *my_error = NULL;
......@@ -195,7 +195,7 @@ edit_paste_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp->global_buffer &&
gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
floating_sel = gimp_edit_paste (gimp_item_get_image (GIMP_ITEM (drawable)),
drawable, gimp->global_buffer,
......@@ -269,7 +269,7 @@ edit_named_cut_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
GError *my_error = NULL;
......@@ -321,7 +321,7 @@ edit_named_copy_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error))
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
GError *my_error = NULL;
......@@ -423,7 +423,7 @@ edit_named_paste_invoker (GimpProcedure *procedure,
{
GimpBuffer *buffer = gimp_pdb_get_buffer (gimp, buffer_name, error);
if (buffer && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (buffer && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
floating_sel = gimp_edit_paste (gimp_item_get_image (GIMP_ITEM (drawable)),
drawable, buffer,
......@@ -498,7 +498,7 @@ edit_clear_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
......@@ -529,7 +529,7 @@ edit_fill_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
......@@ -573,7 +573,7 @@ edit_bucket_fill_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
gboolean do_seed_fill;
......@@ -629,7 +629,7 @@ edit_bucket_fill_full_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
gboolean do_seed_fill;
......@@ -697,7 +697,7 @@ edit_blend_invoker (GimpProcedure *procedure,
if (success)
{
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error);
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
if (success && supersample)
{
......@@ -749,7 +749,7 @@ edit_stroke_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context, TRUE);
......@@ -789,8 +789,8 @@ edit_stroke_vectors_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) &&
gimp_pdb_item_is_attached (GIMP_ITEM (vectors), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
gimp_pdb_item_is_attached (GIMP_ITEM (vectors), FALSE, error))
{
GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context, TRUE);
......
......@@ -152,7 +152,7 @@ floating_sel_attach_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
floating_sel_attach (layer, drawable);
else
success = FALSE;
......
......@@ -304,6 +304,7 @@ gimp_pdb_get_paint_info (Gimp *gimp,
gboolean
gimp_pdb_item_is_attached (GimpItem *item,
gboolean writable,
GError **error)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
......@@ -319,6 +320,9 @@ gimp_pdb_item_is_attached (GimpItem *item,
return FALSE;
}
if (writable)
return gimp_pdb_item_is_writable (item, error);
return TRUE;
}
......@@ -389,7 +393,7 @@ gimp_pdb_layer_is_text_layer (GimpLayer *layer,
return FALSE;
}
return gimp_pdb_item_is_attached (GIMP_ITEM (layer), error);
return gimp_pdb_item_is_attached (GIMP_ITEM (layer), FALSE, error);
}
static const gchar *
......
......@@ -49,6 +49,7 @@ GimpPaintInfo * gimp_pdb_get_paint_info (Gimp *gimp,
GError **error);
gboolean gimp_pdb_item_is_attached (GimpItem *item,
gboolean writable,
GError **error);
gboolean gimp_pdb_item_is_floating (GimpItem *item,
GimpImage *dest_image,
......
......@@ -945,7 +945,7 @@ image_remove_layer_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), FALSE, error))
gimp_image_remove_layer (image, layer, TRUE, NULL);
else
success = FALSE;
......@@ -1137,7 +1137,7 @@ image_remove_channel_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (channel), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (channel), FALSE, error))
gimp_image_remove_channel (image, channel, TRUE, NULL);
else
success = FALSE;
......@@ -1281,7 +1281,7 @@ image_remove_vectors_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (vectors), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (vectors), FALSE, error))
gimp_image_remove_vectors (image, vectors, TRUE, NULL);
else
success = FALSE;
......@@ -1571,7 +1571,7 @@ image_remove_layer_mask_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error) &&
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), mode == GIMP_MASK_APPLY, error) &&
gimp_layer_get_mask (layer))
gimp_layer_apply_mask (layer, mode, TRUE);
else
......
......@@ -232,7 +232,10 @@ layer_add_alpha_invoker (GimpProcedure *procedure,
if (success)
{
gimp_layer_add_alpha (layer);
if (gimp_pdb_item_is_writable (GIMP_ITEM (layer), error))
gimp_layer_add_alpha (layer);
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
......@@ -254,7 +257,10 @@ layer_flatten_invoker (GimpProcedure *procedure,
if (success)
{
gimp_layer_flatten (layer, context);
if (gimp_pdb_item_is_writable (GIMP_ITEM (layer), error))
gimp_layer_flatten (layer, context);
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
......@@ -282,7 +288,7 @@ layer_scale_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
{
if (progress)
gimp_progress_start (progress, _("Scaling"), FALSE);
......@@ -327,7 +333,7 @@ layer_scale_full_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
{
if (progress)
gimp_progress_start (progress, _("Scaling"), FALSE);
......@@ -372,7 +378,7 @@ layer_resize_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
gimp_item_resize (GIMP_ITEM (layer), context,
new_width, new_height, offx, offy);
else
......@@ -398,7 +404,7 @@ layer_resize_to_image_size_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
gimp_layer_resize_to_image (layer, context);
else
success = FALSE;
......@@ -637,7 +643,7 @@ layer_remove_mask_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error) &&
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), mode == GIMP_MASK_APPLY, error) &&
gimp_layer_get_mask (layer))
gimp_layer_apply_mask (layer, mode, TRUE);
else
......
......@@ -116,7 +116,7 @@ airbrush_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-airbrush", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -158,7 +158,7 @@ airbrush_default_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-airbrush", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -204,7 +204,7 @@ clone_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-clone", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -249,7 +249,7 @@ clone_default_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-clone", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -291,7 +291,7 @@ convolve_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-convolve", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -334,7 +334,7 @@ convolve_default_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-convolve", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -378,7 +378,7 @@ dodgeburn_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-dodge-burn", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -422,7 +422,7 @@ dodgeburn_default_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-dodge-burn", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -464,7 +464,7 @@ eraser_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-eraser", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -507,7 +507,7 @@ eraser_default_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-eraser", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -551,7 +551,7 @@ heal_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-heal", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -592,7 +592,7 @@ heal_default_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-heal", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -636,7 +636,7 @@ paintbrush_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-paintbrush", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -682,7 +682,7 @@ paintbrush_default_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-paintbrush", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -720,7 +720,7 @@ pencil_invoker (GimpProcedure *procedure,
{
GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-pencil", error);
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
......@@ -760,7 +760,7 @@ smudge_invoker (GimpProcedure *procedure,
{
<