mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-10 20:40:05 -06:00
address review: skip the full recalculation for a no-op unprotect
This commit is contained in:
@@ -184,8 +184,10 @@ fn unprotect_sheet(s: &mut Session, p: &Json) -> Result<Json> {
|
||||
}
|
||||
}
|
||||
edit(s, |cx| {
|
||||
cx.structural = true;
|
||||
cx.sheet_mut(sheet)?.protection = None;
|
||||
// Only removing protection changes what FORMULATEXT reads; a no-op unprotect skips the full recalculation.
|
||||
if cx.sheet_mut(sheet)?.protection.take().is_some() {
|
||||
cx.structural = true;
|
||||
}
|
||||
Ok(Json::Null)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user