Skip to content

ods: preserve displayed text for cached error cells - #739

Merged
jmcnamara merged 2 commits into
tafia:masterfrom
sjh9714:codex/20261014-720-ods-error-text
Oct 29, 2026
Merged

jmcnamara merged 2 commits into
tafia:masterfrom
sjh9714:codex/20261014-720-ods-error-text

Conversation

@sjh9714

@sjh9714 sjh9714 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #720.

LibreOffice error cells can have an empty office:string-value while their displayed error is stored in <text:p>. Read that text when calcext:value-type="error" is present, preserving values such as #DIV/0! as Data::String instead of returning an empty string.

Changes

  • Use the existing text reader for marked error cells with an empty cached string. Ordinary empty strings and nonempty cached values keep their current behavior.
  • Add an in-memory ODS regression covering both attribute orders, unaffected string values, and formula preservation.

Testing

  • cargo test --all-features --test test ods_cached_error_text
  • cargo test --all-features
  • cargo build
  • cargo fmt -- --check
  • cargo clippy --all-targets --all-features -- -Dwarnings

Run locally on macOS arm64 with Rust 1.95.0. The existing ignored test remains ignored; other toolchains and the WASM CI target were not run locally.

@jmcnamara jmcnamara self-assigned this Oct 17, 2026
@jmcnamara jmcnamara added the needs work for merge The PR needs some rework or clarification. No suitable for merge, yet. label Oct 17, 2026
@jmcnamara

Copy link
Copy Markdown
Collaborator

Is this related to #744?

Comment thread tests/test.rs Resolved
@sjh9714

sjh9714 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Moved the regression to tests/cached_error_text.ods and the existing wb/range_eq! test style in 241145e. It retains both attribute orders, ordinary empty strings, nonempty cached strings, and formula checks.

#744 fixes a separate issue: XML whitespace between cells in read_row. This PR handles empty cached error strings in get_datatype; the fixture has no whitespace between cell elements and passes without #744.

Verified that the fixture test fails on the original reader and passes with this fix. These commands pass locally:

  • cargo test --locked --all-features --test test ods_cached_error_text
  • cargo test --locked --all-features
  • cargo build --locked
  • cargo fmt -- --check
  • cargo clippy --locked --all-targets --all-features -- -Dwarnings

@jmcnamara jmcnamara added next release and removed needs work for merge The PR needs some rework or clarification. No suitable for merge, yet. labels Oct 29, 2026
@jmcnamara
jmcnamara merged commit f2b5654 into tafia:master Oct 29, 2026
6 checks passed
@jmcnamara

Copy link
Copy Markdown
Collaborator

Merged. Thanks.

@jmcnamara

Copy link
Copy Markdown
Collaborator

Fixed/merged upstream in v0.38.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ods: a cell whose cached value is an error reads as an empty string

2 participants