From 551eda7e8eed3fe5db97dc1b2742bd93c612bae9 Mon Sep 17 00:00:00 2001 From: prxnvt <53838599+prxnvt@users.noreply.github.com> Date: Fri, 23 Oct 2026 23:08:49 -0400 Subject: [PATCH] Engine: the xlsx copy gets an empty macro list, not a copy of the shared one cleared out.macros shares its list with the workbook being saved, so clear() copied every macro first. --- crates/engine/src/macros/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/macros/mod.rs b/crates/engine/src/macros/mod.rs index 5a779758d..f0c83e549 100644 --- a/crates/engine/src/macros/mod.rs +++ b/crates/engine/src/macros/mod.rs @@ -108,7 +108,8 @@ pub fn with_names(wb: &Workbook) -> crate::Result> { out.names.retain(|n| !stored(n)); let items: Vec<(String, String)> = wb.macros.iter().enumerate().map(|(i, m)| (format!("{MACRO_KEY}{i}"), macro_json(m).to_string())).collect(); stash::set_many(&mut out, &items)?; - out.macros.clear(); + // An empty list of its own, not a copy of the shared one cleared. + out.macros = gridcraft_model::Macros::default(); Ok(Some(out)) }