feat(odf.js): add a real .sxc writer for OpenOffice.org 1.x - #894
Merged
Conversation
Mearman
marked this pull request as ready for review
September 3, 2026 19:25
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
writeSxc/writeSxcContent build a real ODF .ods Package through writeOds/writeOdsContent and run it through transformToOoo1Package, the same inverse transform writeSxw/writeSxwContent already use -- the transform is generic across every ODF media type, so wiring .sxc up to it needed no changes there, only a second pair of writer entry points wrapping writeOds/writeOdsContent the way the .sxw pair already wraps writeOdt/writeOdtContent.
…ed reader Mirrors ooo1/write.test.ts's own sxw suite exactly: a round-trip law against readSxc/readSxcContent covering every cell value kind, runs, formulas, decoration, merged ranges, column/row sizing, cell-anchored images and print settings, plus a second suite proving the output genuinely looks like OpenOffice.org 1.x XML -- no mimetype part, table:value-type/table:value rather than ODF's office:value-*, a bare style:properties rather than the typed style:table-cell-properties, and a bare draw:image rather than a draw:frame wrapping one.
Updates the package README's status list, usage example, and src/ooo1/ module inventory for writeSxc/writeSxcContent. Also updates the root README's package table row.
Keeps the export statement within this package's configured line length.
Three comments in transform.ts/read.ts still described this package's typed layer as read-only for ODF and named writeSxw as the transform's only caller -- both stopped being true once writeOdt/writeOds and writeSxw/writeSxc landed. Also states plainly that transformToOoo1Package is media-type-agnostic, which is exactly what let writeSxc reuse it unchanged.
Mearman
force-pushed
the
feat/odf-ooo1x-sxc-writer
branch
from
September 3, 2026 20:00
2322896 to
8eddaa6
Compare
This was referenced Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Progresses #821 (the .sxc quarter of it).
Adds
writeSxc/writeSxcContent, the direct structural analogue of the existing.sxwwriter (writeSxw/writeSxwContent, #878):writeSxc/writeSxcContentbuild a real ODF.odsPackagethroughwriteOds/writeOdsContent(#889) and run it throughtransformToOoo1Package, the same inverse transform the.sxwwriter already uses.transformToOoo1Packageis already generic across every ODF media type, so wiring.sxcup to it needed no changes to the transform itself -- only a second pair of writer entry points insrc/ooo1/write.tswrappingwriteOds/writeOdsContentthe way the.sxwpair already wrapswriteOdt/writeOdtContent.What it covers
Every construct
writeOds/writeOdsContentcan write, since a fix to the ODF writer fixes both formats at once: everyoffice:value-typea cell can carry (number/percentage/currency/boolean/date/time/string, plus a value-less cell), runs with inline character formatting and hyperlinks, cell background/borders/alignment/vertical-alignment, verbatim formulas, merged ranges, column widths/hidden columns, row heights/hidden rows, cell-anchored images, print settings (gridlines/headers/page order/scale/fit-to-page/print range/repeated header rows-columns/manual page breaks), and multiple sheets.What
writeOdsrefuses by name (embedded objects, data-validation rules, conditional-formatting rules),writeSxcrefuses too, for the same reason stated there: a document that silently lost semantic content would be worse than one this writer declined to produce at all..sxi/.sxdremain out of scope -- odf.js's typed layer still has nowriteOdp/writeOdgfor either to build on.Verification
Round-tripped against the existing, unmodified
readSxc/readSxcContentreader (untouched by this PR) -- the same proof #878 made for.sxw: genuine round-trip correctness against independently-built code, not merely internal self-consistency. A second, independent suite checks the packagewriteSxcContentproduces actually looks like OpenOffice.org 1.x XML (nomimetypepart,table:value-type/table:valuerather than ODF'soffice:value-*, a barestyle:propertiesrather than the typedstyle:table-cell-properties, a baredraw:imagerather than adraw:framewrapping one) rather than merely round-tripping because the transform's own passthrough tolerates whatever shape it was handed.Full workspace lint/typecheck pass, and
odf.js's own lint/typecheck/test/test:workers/test:smoke all green.