Skip to content

Commit

Permalink
Merge pull request #467 from schrieveslaach/ignore-annotations
Browse files Browse the repository at this point in the history
Ignore Annotations
  • Loading branch information
tafia authored Oct 3, 2024
2 parents 247c080 + 0d62f7a commit a5922fc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,15 @@ fn get_datatype(
{
return Ok((Data::String(s), formula, true));
}
Ok(Event::Start(ref e)) if e.name() == QName(b"office:annotation") => loop {
match reader.read_event_into(buf) {
Ok(Event::End(ref e)) if e.name() == QName(b"office:annotation") => {
break;
}
Err(e) => return Err(OdsError::Xml(e)),
_ => (),
}
},
Ok(Event::Start(ref e)) if e.name() == QName(b"text:p") => {
if first_paragraph {
first_paragraph = false;
Expand Down
7 changes: 7 additions & 0 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1822,3 +1822,10 @@ fn issue_repeated_empty(#[case] fixture_path: &str) {
]
);
}

#[test]
fn ods_with_annotations() {
let mut ods: Ods<_> = wb("with-annotation.ods");
let range = ods.worksheet_range("table1").unwrap();
range_eq!(range, [[String("cell a.1".to_string())],]);
}
Binary file added tests/with-annotation.ods
Binary file not shown.

0 comments on commit a5922fc

Please sign in to comment.