refactor(pptx): delegate empty-timing check to timing::timing

This commit is contained in:
Neil Cawse committed 2026-11-08 13:41:07 +00:00
1 parent 8c85789cb1
commit c6e21c4fb5
1 file changed
+1 -16
+1 -16
View File
@@ -813,22 +813,7 @@ fn slide_xml(x: &mut Exp, o: &mut Out, s: &Slide, comment_rel: Option<&str>) ->
if let Some(t) = &s.transition {
timing::transition(&mut w, x, o, t);
}
if !s.animations.is_empty()
|| s.shapes.iter().any(|shape| {
fn has_nondefault(shape: &deckcraft_model::Shape) -> bool {
match &shape.kind {
deckcraft_model::ShapeKind::Media(c) => {
c.autoplay || (c.volume - 1.0).abs() > 1e-6 || c.hide_while_not_playing || c.loop_play || c.full_screen
}
deckcraft_model::ShapeKind::Group { children, .. } => children.iter().any(has_nondefault),
_ => false,
}
}
has_nondefault(shape)
})
{
timing::timing(&mut w, x, &s.animations, &s.shapes, &ids);
}
timing::timing(&mut w, x, &s.animations, &s.shapes, &ids);
slide_ext_list(&mut w, s.raw_ext.as_deref(), comment_rel);
w.close("p:sld");
w.finish()