Commit aa70c13f authored by Michael Natterer's avatar Michael Natterer 😴

Keep the PDB from changing locks that can't be changed

parent af794539
......@@ -770,7 +770,10 @@ drawable_set_lock_content_invoker (GimpProcedure *procedure,
if (success)
{
gimp_item_set_lock_content (GIMP_ITEM (drawable), lock_content, TRUE);
if (gimp_item_can_lock_content (GIMP_ITEM (drawable)))
gimp_item_set_lock_content (GIMP_ITEM (drawable), lock_content, TRUE);
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
......
......@@ -729,7 +729,10 @@ layer_set_lock_alpha_invoker (GimpProcedure *procedure,
if (success)
{
gimp_layer_set_lock_alpha (layer, lock_alpha, TRUE);
if (gimp_layer_can_lock_alpha (layer))
gimp_layer_set_lock_alpha (layer, lock_alpha, TRUE);
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
......
......@@ -413,7 +413,10 @@ vectors_set_lock_content_invoker (GimpProcedure *procedure,
if (success)
{
gimp_item_set_lock_content (GIMP_ITEM (vectors), lock_content, TRUE);
if (gimp_item_can_lock_content (GIMP_ITEM (vectors)))
gimp_item_set_lock_content (GIMP_ITEM (vectors), lock_content, TRUE);
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
......
......@@ -906,7 +906,10 @@ sub drawable_set_lock_content {
%invoke = (
code => <<'CODE'
{
gimp_item_set_lock_content (GIMP_ITEM (drawable), lock_content, TRUE);
if (gimp_item_can_lock_content (GIMP_ITEM (drawable)))
gimp_item_set_lock_content (GIMP_ITEM (drawable), lock_content, TRUE);
else
success = FALSE;
}
CODE
);
......
......@@ -768,7 +768,10 @@ HELP
%invoke = (
code => <<'CODE'
{
gimp_layer_set_lock_alpha (layer, lock_alpha, TRUE);
if (gimp_layer_can_lock_alpha (layer))
gimp_layer_set_lock_alpha (layer, lock_alpha, TRUE);
else
success = FALSE;
}
CODE
);
......
......@@ -363,7 +363,10 @@ sub vectors_set_lock_content {
%invoke = (
code => <<"CODE"
{
gimp_item_set_lock_content (GIMP_ITEM (vectors), lock_content, TRUE);
if (gimp_item_can_lock_content (GIMP_ITEM (vectors)))
gimp_item_set_lock_content (GIMP_ITEM (vectors), lock_content, TRUE);
else
success = FALSE;
}
CODE
);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment