address review: skip the full recalculation for a no-op unprotect

This commit is contained in:
Dylan M. Taylor
2026-11-11 00:30:21 +00:00
parent 3b1ff015ea
commit 2f642d3132
+4 -2
View File
@@ -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)
})
}