Skip to content

feat(bindings): Sheet::set_cell_style in python, java, objective-c and npm - #939

Merged
andiwand merged 3 commits into
mainfrom
feat/bindings-cell-style
Sep 28, 2026
Merged

andiwand merged 3 commits into
mainfrom
feat/bindings-cell-style

Conversation

@andiwand

@andiwand andiwand commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Step 5, the last one, of the cell-formatting plan (#934).

Change

Binding API
python Sheet.set_cell_style(column, row, cell_style, text_style); TableCellStyle was already constructible
Java Sheet.setCellStyle(column, row, TableCellStyle, TextStyle); TableCellStyle gets a public constructor and writable fields, as TextStyle did in #898
Objective-C / Swift -[ODRSheet setCellStyle:textStyle:atColumn:row:error:], sheet.setStyle(_:textStyle:column:row:) in Swift; ODRTableCellStyle gets init and writable properties
npm Document.setCellStyle(sheet, column, row, style) with a CellStyle type; the object is the one odr.editing.format takes, replayed through the envelope so the parser of the wire checks it

Java and Objective-C refuse a padding or a border before C++, since no engine writes one. The Java and Swift suites take ods/span.ods from OpenDocument.test as a fixture beside mixed-layout.odt.

.gitattributes marks *.ods binary, as it marks *.odt: the * text eol=lf rule would rewrite the CRLF bytes inside the zip. ODRStyle.mm and jni_style.cpp had lost their <odr/exceptions.hpp> include, which the new refusal needs again.

Proof

Each binding gets a test that styles A1 (a fill, centre alignment and bold), saves, reopens and reads the fill and the bold back, and a test for the refusal:

  • python: 86 passed.
  • JUnit: 65 successful.
  • Swift/XCTest: 46 tests, 0 failures, macOS xcframework slice.
  • wasm/node: 54 passed.

@andiwand
andiwand force-pushed the feat/sheet-format-editor branch from 5531ba5 to 716e5cf Compare September 28, 2026 19:35
Base automatically changed from feat/sheet-format-editor to main September 28, 2026 19:40
andiwand and others added 3 commits September 28, 2026 21:41
…d npm

Python binds Sheet.set_cell_style as it stands. Java and Objective-C get
Sheet.setCellStyle and -[ODRSheet setCellStyle:textStyle:atColumn:row:
error:], with TableCellStyle constructible and its fields writable, so a
caller builds the delta. A padding or a border is refused before it
reaches C++. The npm package's setCellStyle(sheet, column, row, style)
takes the object that the page's odr.editing.format takes, and replays it
through the envelope, so the parser of the wire checks it.

The Java and Swift suites take ods/span.ods from OpenDocument.test as a
fixture beside mixed-layout.odt.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NXnz6EZY8YpyiyyE1GpsWy
The text eol rule rewrote its CRLF bytes, which breaks the zip on a fresh
checkout.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NXnz6EZY8YpyiyyE1GpsWy
The python refusal test now expects `pyodr.UnsupportedOperation`, so a
wrong error no longer passes it. The npm `CellStyle` builds on
`TextStyle` without `highlight` and does not repeat its keys. The
changelog entry is shorter.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tigcf9he3w1aHfNPJoEGsd
@andiwand
andiwand force-pushed the feat/bindings-cell-style branch from fafe04e to 5f61f1b Compare September 28, 2026 19:43
@andiwand
andiwand merged commit 1f8f51d into main Sep 28, 2026
22 of 23 checks passed
@andiwand
andiwand deleted the feat/bindings-cell-style branch September 28, 2026 19:45
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