Skip to content

feat(api)!: a cell's value type says boolean, date, time and error - #899

Merged
andiwand merged 1 commit into
mainfrom
feat/value-type-kinds
Sep 13, 2026
Merged

feat(api)!: a cell's value type says boolean, date, time and error#899
andiwand merged 1 commit into
mainfrom
feat/value-type-kinds

Conversation

@andiwand

@andiwand andiwand commented Sep 13, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

One of the three public-API changes before the major. Independent of the other two.

The enum. ValueType gains boolean, date, time and error, appended so no existing ordinal moves. The odf reader maps office:value-type and the xlsx reader c/@t (b, e, d) onto them, for sheet cells and odf table cells alike. A boolean states 1 or 0 as its number. A percentage, a currency and an xlsx date stay what they were, a string or a float_number serial stating a number, until number formats are read; the enum's doc says so.

Writing. Sheet::set_cell writes a boolean (office:value-type="boolean" with office:boolean-value, t="b" with <v>1|0</v>) and refuses date, time and error with UnsupportedOperation before it touches the cell, since no engine has a form for them yet.

No rendering change. The renderer keys on float_number alone, so no page moves; the ods, xlsx, odt and docx outputs are byte-identical to the reference.

Bindings. The python, Java and Objective-C mirrors gain the four values; the ordinal test pins them. The npm package exposes no ValueType.

Verified. 476 tests across the cell value, sheet, document and html suites pass, with new cases for a boolean, a date, a time and an error on both formats and for the refusals. JUnit 63 and pytest 83 pass. The touched sources are clean under Homebrew clang -Wall -Wextra -Werror. The macOS Apple slice is building as I write this; its result follows in a comment.

Changelog entry added, marked breaking.

`ValueType` gains the four kinds, appended so no ordinal moves, and the odf
and xlsx readers report them from `office:value-type` and `c/@t`. A boolean
states 1 or 0 as its number. A percentage, a currency and an xlsx date stay
what they were, a string or a serial stating a number, until number formats
are read. `Sheet::set_cell` writes a boolean and refuses the other three
before it touches the cell. The renderer keys on `float_number` alone, so no
page moves. Every binding's mirror follows.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137vd79NGaB8nfLsdPoghM4
@andiwand

Copy link
Copy Markdown
Member Author

The macOS Apple slice built for both archs and swift test passed with the new ValueType cases in the header.

@andiwand
andiwand merged commit de20a7f into main Sep 13, 2026
29 checks passed
@andiwand
andiwand deleted the feat/value-type-kinds branch September 13, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant