Skip to content

fix: keep table spans compact and bound their extents - #1038

Merged
andiwand merged 2 commits into
mainfrom
review/20-table-spans
Oct 5, 2026
Merged

andiwand merged 2 commits into
mainfrom
review/20-table-spans

Conversation

@andiwand

@andiwand andiwand commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

The shared table cursor previously allocated a list entry for every row covered by a merged cell and discarded pending spans when advancing several rows. Store one range with an end row per merged cell and retain active spans across row advances. Reject overflowing extents before changing the cursor; a zero count from a damaged file advances nothing.

Recalculation checks formula-span dimensions and its expansion budget before narrowing or accumulating sizes, including on 32-bit targets. Row-label formatting also widens before adding one.

Validation: 305 targeted ODF, HTML, recalculation, table-cursor, and position tests pass. New regressions cover a UINT32_MAX-row span without proportional allocation, invalid extents, and a formula array whose size would wrap on 32-bit targets.

@andiwand
andiwand force-pushed the review/19-csv-boundaries branch from 6ed93b6 to b12a6a9 Compare October 5, 2026 06:05
Base automatically changed from review/19-csv-boundaries to main October 5, 2026 06:06
andiwand and others added 2 commits October 5, 2026 08:07
The ODF readers take repeat and span counts with as_uint(1), whose
default applies only to a missing attribute. So a damaged
number-columns-repeated="0" reached the cursor, which now threw, and the
document no longer opened. Before, a zero count advanced nothing. The
cursor again accepts zero and still rejects overflow.

The recalculation also threw for a zero matrix span. Because every save
recalculates, such a document no longer saved. A zero span covers no
cell, so only overflow is rejected there too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gb1fLafqqzehpqPuU6uBfn
@andiwand
andiwand force-pushed the review/20-table-spans branch from 35d7498 to 52fc542 Compare October 5, 2026 06:12
@andiwand
andiwand merged commit 7376bf0 into main Oct 5, 2026
22 of 23 checks passed
@andiwand
andiwand deleted the review/20-table-spans branch October 5, 2026 06:14
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