From 953ae8d060d7486cbd10632db2a4a3c54eeefe84 Mon Sep 17 00:00:00 2001 From: aiongg <67543387+aiongg@users.noreply.github.com> Date: Wed, 4 Nov 2026 23:44:51 +0000 Subject: [PATCH] Apply review fixes - crates/pptx/src/read/shapes.rs --- crates/pptx/src/read/shapes.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/pptx/src/read/shapes.rs b/crates/pptx/src/read/shapes.rs index b2f058819..c2e9293fc 100644 --- a/crates/pptx/src/read/shapes.rs +++ b/crates/pptx/src/read/shapes.rs @@ -584,12 +584,13 @@ fn smartart(imp: &mut Imp, part: &Part, gd: &El, frame: &Shape, depth: usize) -> let dpart = Part::new(imp.pkg, &drawing_rel, &d); let tree = d.root.child("spTree")?; let mut sub = IdCtx { fresh: true, ..Default::default() }; + let before = imp.smartart_shapes; let children = sp_tree(imp, &dpart, &mut sub, tree, depth + 1); if children.is_empty() { return None; } - // A drawing that frames reuse (or that nests another SmartArt) counts every time it is read. - imp.smartart_shapes = imp.smartart_shapes.saturating_add(count_shapes(&children)); + // Counted once here, nested SmartArt included: a drawing that frames reuse counts every time it is read. + imp.smartart_shapes = before.saturating_add(count_shapes(&children)); let children = smartart_text_rects(imp, &mut sub, tree, children, depth + 1); let mut g = frame.clone(); let x = frame.xfrm.unwrap_or_default();