mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-10 12:29:58 -06:00
Form controls: the object commands leave a locked control on a protected sheet alone
control.format and control.assign refused to change a locked control on a protected sheet, but object.move, object.delete, object.setAnchorMode, arrange.bringForward, arrange.sendBackward and arrange.align changed it all the same. They now refuse it with the same message; an unlocked control still moves, and other kinds of objects are unchanged.
This commit is contained in:
@@ -1187,6 +1187,8 @@ fn object_param(s: &Session, p: &Json, cmd: &str) -> Result<(usize, ObjRef)> {
|
||||
if !d.wb.sheet(sheet).is_some_and(|sh| sh.has_object(o)) {
|
||||
return Err(bad(cmd, "no such object"));
|
||||
}
|
||||
// A locked form control on a protected sheet stays as it is.
|
||||
super::controls::check_objects_unlocked(s, sheet, kind, &[id])?;
|
||||
Ok((sheet, o))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user