Repository navigation
fix(formula): read a space before an ods function's parenthesis - #1198
Merged
Merged
Conversation
OpenFormula 5.14 forbids a space between a function name and its "(", but
LibreOffice writes and reads "ROUND (". The parser refused these formulas,
so they got no result, no exact reads and no structural edit. Skip spaces
there in the OpenFormula syntax only. A tab or a line break stays an error,
as in LibreOffice, and the OOXML syntax stays strict.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S5yx1nDeVcNX3BxqK1WpJz
andiwand
added a commit
that referenced
this pull request
Oct 10, 2026
…paces The output now prints a text page with a page frame whole (#1199), and reads a space before an ods function's parenthesis (#1198). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5yx1nDeVcNX3BxqK1WpJz
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.
OpenFormula (ODF 1.3 part 4, §5.14) says: "whitespace shall not separate a function name from its initial opening parenthesis". But LibreOffice 6.1 and 6.2 wrote formulas like
of:=ROUND (([.C2]*[.C1]^2)/[.B4];2)(ruski.ods) andof:=PRODUCT ((…); 0.5)(Meine Buecher-last test2.ods). The parser refused them. So these cells got no computed result, and #1193 made them read their whole sheet. A structural edit would also refuse on them (#1196).What LibreOffice does
A probe
.fodsthroughsoffice --convert-to fods:ROUND (2.567;2)ROUND(2.567;2)ROUND (2.567;2)(two spaces)ROUND<tab>(2.567;2)#NAME?ROUND<line feed>(2.567;2)#NAME?Change
The OpenFormula branch of the parser skips spaces after a function name when a
(follows. OpenFormula spells the intersection operator!, so no other reading is possible. A tab or a line break stays an error. The OOXML syntax stays strict, because a space is the intersection operator there. The writer writesROUND(, as LibreOffice does when it saves.Verification
FormulaCorpus.every_answer_is_the_result_the_file_caches: 15045 of 15160 formulas answered, before 14970. All 75 new answers equal the result the file caches.Reference output
Four private pages change: the document view and the affected sheet of
ruski.odsand ofMeine Buecher-last test2.ods. Their formula cells get exactdata-odr-readsinstead of the whole sheet. I will update the reference output once, after this PR and the print PR that follows have landed.