Repository navigation
Conversation
A cell typed office:value-type="error", or a formula whose cached result is an error (calcext:value-type="error"), opened as the text of its code, so ISERROR said FALSE and the "unsupported values" warning appeared. Its code (the string value, or the cell's text) now becomes the error. A code Excel has no error for (Err:502) stays text, and a string cell that reads like an error stays a string. Fixes storytold#4301.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Upstream PR: storytold#4373 Head: 900f79e
Merges the zcode-pr-transfer branch (61 commits transferring open, not-yet-merged upstream PRs into our fork) into main. Docs (docs/ui-parity.md, docs/file-format-parity.md) resolved in favor of main's current changelog state; code from all transferred PRs carried over cleanly. Commits carried over (21 from this session + 40 earlier transfers): storytold#4408, storytold#4405, storytold#4406, storytold#4386, storytold#4379, storytold#4378, storytold#4376, storytold#4375, storytold#4373, storytold#4370, storytold#4369, storytold#4348, storytold#4347, storytold#4345, storytold#4344, storytold#4343, storytold#4341, storytold#4340, storytold#4337, storytold#4336, storytold#4318, storytold#4316, storytold#4315, storytold#4312, storytold#4310, storytold#4307, storytold#4306, storytold#4305, storytold#4303, storytold#4298, storytold#4295, storytold#4287, storytold#4286, storytold#4257, storytold#4256, storytold#4254, storytold#4252, storytold#4251, storytold#4248, storytold#4244, storytold#4243, storytold#4229, storytold#4228, storytold#4227, storytold#4225, storytold#4221, storytold#4220, storytold#4219, storytold#4217, storytold#4424, storytold#4423, storytold#4420, storytold#4419, storytold#4418, storytold#4414, storytold#3617, storytold#2642, storytold#2556, storytold#2321
Fixes #4301
What was wrong
The ODS reader in
crates/xlsx/src/ods.rsrecognised a cell's error type when it read the attributes, butconverthad no case for it. The value fell back to the cell's displayed text, with the generic "unsupported values" warning. So a typed error cell (office:value-type="error", no formula) opened as the string#DIV/0!, andISERRORon it was FALSE, where Excel reads it as an error, as the issue shows. The issue says a formula's cached error (calcext:value-type="error") lost its error type the same way.What changed
office:string-value, or else its displayed text. It becomes the matching error value throughCellError::parse, ignoring case and surrounding spaces.Err:502(still reported as unsupported); and a cell typedstringthat merely reads like an error.ods_extension_error_cache_never_imports_its_placeholder_zerochecks that a cached error never imports as the placeholderoffice:value="0"written beside it. That still holds. It previously expected the text#DIV/0!(the fallback then), and now expects the#DIV/0!error itself, which is what ODS import turns typed error values into text #4301 asks for. So it's updated, with a comment.QA report
Main vs branch, end to end (
gridcraft-cli, an ODS file)err.odsis a minimal ODS package I assembled. Its cells:office:value-type="error" office:string-value="#DIV/0!");plain text;of:=1/0withcalcext:value-type="error"and a placeholderoffice:value="0";#N/A;stringcell whose text is#DIV/0!;Each build converted it to
.xlsx(run --in err.ods --out out.xlsx), and I evaluated these formulas on the result.mainis agridcraft-clibuilt fromorigin/main(abcfc191); the branch is this PR (900f79ee). The Excel column is the issue's result; I didn't run Excel myself.=ISERROR(A1)(typed error)=ISERROR(B1)(plain text)=ISERROR(C1)(formula's cached error)=ISERROR(D1)(#N/Ain the text)=IFERROR(ERROR.TYPE(A1),"-")/=IFERROR(ERROR.TYPE(D1),"-")=ISERROR(E1)/=ISTEXT(E1)(string reading#DIV/0!)=F1Tests
tests::ods_tests::ods_error_cells_open_as_errorscovers:#N/Aread from the cell's text;#value!with spaces, read as#VALUE!;stringcell reading#DIV/0!, which stays text;Err:502, which stays text and is still reported.ods_extension_error_cache_never_imports_its_placeholder_zeronow expects the error rather than its text, as explained above. The other ODS tests still pass.Negative control
With the error case disabled (on top of
900f79ee, then restored withgit checkout), the new test fails at A1: leftText("#DIV/0!"), rightError(Div0).Gate (macOS arm64)
cargo fmt --all -- --checkcargo clippy -p gridcraft-xlsx --all-targets -- -D warningscargo test -p gridcraft-xlsx -p gridcraft-engineNot covered
Err:502and the like) stay text. Mapping them to Excel errors would be a separate decision.parse_dateandparse_durationin the same file; this editsconvertand the attribute key. Their tests sit in different places.cargo xtask ci: I didn't run the fullcargo xtask ci(wasm, layers, the other crates).Summary by CodeRabbit