mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-25 03:52:45 +01:00
Merge branch 'ppt95-text' into ppt95-shapes
This commit is contained in:
commit
91032e78b0
2 files changed
+8
-3
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user