Skip to content

fix: bound ODF number format expansion - #1086

Merged
andiwand merged 2 commits into
mainfrom
review/68-odf-format-bounds
Oct 5, 2026
Merged

andiwand merged 2 commits into
mainfrom
review/68-odf-format-bounds

Conversation

@andiwand

@andiwand andiwand commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

ODF number styles now clamp digit counts to 4096, keep the default for a negative count, and clamp the minimum decimal count to the total, as LibreOffice does. This prevents tiny styles from requesting gigabytes of placeholder strings or overflowing the decimal-count subtraction. Styles with more than two conditional maps are rejected before expanding another mapped style.

One table-driven regression covers the count fields, out-of-range counts, inconsistent decimals, and the upper boundary. All 71 targeted number-format, ODF sheet, and recalculation checks pass. The changed production file passes clang-tidy (upstream pugixml analyzer warnings remain advisory).

@andiwand
andiwand force-pushed the review/67-odf-number-tokens branch from 8d62f54 to 309c283 Compare October 5, 2026 18:32
Base automatically changed from review/67-odf-number-tokens to main October 5, 2026 18:35
andiwand and others added 2 commits October 5, 2026 20:35
LibreOffice clamps a digit count on import and ignores a negative one, so
one large count does not drop the whole data style. Clamp each count to
4,096, keep the default for a negative count, and clamp the minimum
decimals to the decimals.

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/68-odf-format-bounds branch from af969e3 to 4a29c2f Compare October 5, 2026 18:39
@andiwand
andiwand merged commit f19f8a3 into main Oct 5, 2026
24 of 25 checks passed
@andiwand
andiwand deleted the review/68-odf-format-bounds branch October 5, 2026 18:44
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