Merge branch 'ppt95-text' into ppt95-shapes

This commit is contained in:
kiwi4boy
2026-11-20 02:23:26 -05:00
2 changed files with 8 additions and 3 deletions
+3 -3
View File
@@ -198,10 +198,10 @@ pub fn document(stream: &[u8]) -> Option<Rec<'_>> {
}
/// Whether a slide record holds what PowerPoint 95 writes first in every slide, its SlideAtom
/// (1007). One without it kept nothing (a file cut short just after the slide's header): it is left
/// out and named as lost.
/// (1007), whole enough to give the slide's id and its master's. One without it kept nothing (a
/// file cut short just after the slide's header, or the atom's): it is left out and named as lost.
fn kept(slide: &Rec) -> bool {
slide.child(rt::SLIDE_ATOM).is_some()
slide.child(rt::SLIDE_ATOM).and_then(|a| a.u32(4)).is_some()
}
/// The slides a truncated or damaged file lost, by position ("slide 3"): those listed without their
+5
View File
@@ -2497,6 +2497,11 @@ fn slides_the_count_says_are_missing_are_named() {
let second = two.windows(one.len()).rposition(|w| w == one).unwrap();
let (p, lost) = crate::import_checked(&file_of(&two[..second + 16]), &AppDefaults).unwrap();
assert_eq!((p.slides.len(), lost), (1, vec!["slide 2".to_string()]));
// Cut just after its SlideAtom's header, or partway into the atom: still lost.
for cut in [32, 36] {
let (p, lost) = crate::import_checked(&file_of(&two[..second + cut]), &AppDefaults).unwrap();
assert_eq!((p.slides.len(), lost), (1, vec!["slide 2".to_string()]), "cut at {cut}");
}
}
/// Real PowerPoint 95 files, when `CRAFT_PPT95_SAMPLES` names a directory of them (they are not in