xref: /trunk/odf_docs/openformula-small-group-semantic-gaps.tsv (revision 1354dfcdad4129e7cc561fdcfbb4f6c8958f0428)
1GapID   ODF Clause  Requirement AOO Implementation Location Current Behavior    Classification  Severity    Proposed Next Action    Test Coverage Status
2F-GAP-001   §6.13.7 COUNTA counts non-empty cells; empty string "" is not blank main/sc/source/core/tool/interpr1.cxx:3834 (ScCount2 via IterateParameters(ifCOUNT2) at :3487)  COUNTA counts scalar string args including ""; counts cells where eCellType != CELLTYPE_NONE && != CELLTYPE_NOTE; matrix case counts ALL elements including strings; formula cells returning "" counted as non-blank based on CELLTYPE_FORMULA (result not checked) Required by ODF 1.4; implementation-defined for formula cells returning ""  Medium  Verify COUNTA empty-cell and empty-string semantics match §6.13.7; document that formula-cell "" result is not inspected (cell-type-only check) calcval: COUNTA.range, COUNTA.empty-cells, COUNTA.emptystr (calcval-cases14.tsv); SG tests FN-013-* (openformula-small-group-1.4.tsv) — UNVERIFIED (no build)
3F-GAP-002   §6.13.8 COUNTBLANK counts empty cells; cell returning "" blankness is implementation-defined    main/sc/source/core/tool/interpr1.cxx:4714 (ScCountEmptyCells), :4745-4758 (lcl_IsCountBlankEmpty)  COUNTBLANK uses lcl_IsCountBlankEmpty() which checks cell type AND formula result: CELLTYPE_NONE/CELLTYPE_NOTE/NULL → blank; non-FORMULA cell types → not blank; CELLTYPE_FORMULA with error or IsValue() → not blank; CELLTYPE_FORMULA with GetString().Len()==0 → blank (formula cell returning "" counts as blank). Truly empty cells are blank. Scalar "" argument not supported (only ReferenceList per §6.13.8)   Implementation-defined (§6.13.8); AOO treats formula cell returning "" as blank, consistent with ISBLANK returning FALSE for empty string (§6.13.14)    Medium  Document COUNTBLANK formula-cell "" behavior as implementation-defined choice already exercised; no code change needed  calcval: COUNTBLANK.range, COUNTBLANK.empty-cells, COUNTBLANK.emptystr (calcval-cases14.tsv:162-164); SG test FN-014-COUNTBLANK-empty-string diagnostic-only (expected -) — UNVERIFIED (no build)
4F-GAP-003   §6.14.6 INDEX single-argument row vector returns error (no row-vector shortcut) main/sc/source/core/tool/interpr1.cxx:7448 (ScIndex); bRowArray shortcut PRESENT at :7588-7612 (restored by commit 8f3b3b25a2, undid Milestone A bb58e28fc2)    ODF 1.2 had explicit row-vector shortcut (Row acts as column offset); deleted in ODF 1.4 per OFFICE-4144. Current AOO code keeps bRowArray (ODF 1.3/Excel compatible, NOT ODF 1.4 compliant). INDEX(H1:L1;3) returns value 30 instead of Error. Test INDEX.row.rowonly expects #ERR — mismatch with implementation. Required by ODF 1.4; NOT currently conformant (bRowArray present). Compatibility audit complete: keep bRowArray as documented deviation; consider compatibility option if corpus testing shows impact.  Medium  Keep bRowArray (legacy compatible, non-ODF-1.4-compliant) or remove (ODF 1.4 compliant, breaks legacy docs) calcval: INDEX.row.rowonly (#ERR expected, impl returns 30), INDEX.row.col (101), INDEX.row.empty (30), INDEX.col.beyond (#ERR), INDEX.row.twod (202), INDEX.row.outrange (#ERR), INDEX.array (50) — UNVERIFIED (no build); INDEX.row.rowonly MISMATCH
5F-GAP-004   §4.11.11    Criteria syntax supported in database functions main/sc/source/core/tool/interpr1.cxx:6664 (GetDBParams), :6803 (DBIterator); :6871-6902 (ScDBCount), :6905-6935 (ScDBCount2); dociter.cxx:685-716 (CountRecords); queryparam.cxx:106-144 (operator prefix parsing) Criteria operators parsed: <>, <=, <, >=, >, =; bQueryByString via IsNumberFormat; bRegExp via MayBeRegExp. DBCount empty-cell limitation RESOLVED: ScDBCount missing-field path uses CountRecords() (dociter.cxx:685-716) which iterates row-by-row via IsQueryValid(), counting all matching records regardless of cell emptiness. ScDBCount2 (DCOUNTA) same pattern. ScDBQueryDataIterator::getCurrent() still skips CELTYPE_NONE for WITH-field path (correct per COUNT/COUNTA semantics).  Required by ODF 1.4 (§6.9.3: count all matching rows); FIXED via CountRecords() Low Fixed in b5a1b43b5b and 30877e2746; DB.DCOUNT.nf.nocrit gives 3 (was 0) calcval: SYN-001-criteria + DB.* cases (DB.DCOUNT.nf.ne, DB.DCOUNTA.nf.ne, DB.DCOUNT.f.ne, DB.DCOUNTA.f.ne, DB.DCOUNT.nf.eq, DB.DCOUNT.f.eq, DB.DCOUNT.nf.and, DB.DCOUNTA.nf.and, DB.DCOUNT.nf.or, DB.DCOUNTA.nf.or, DB.DCOUNT.f.or, DB.DCOUNT.nf.inline, DB.DCOUNTA.nf.inline, DB.DCOUNT.nf.blank*, DB.DCOUNT.nf.eq.gap, DB.DCOUNT.f.zero, DB.DCOUNT.nf.zero, DB.DCOUNTA.f.zero) — UNVERIFIED
6F-GAP-005   §4.11.11    Database criteria: text criteria, wildcards, empty criteria main/sc/source/core/tool/queryparam.cxx:106-144 (operator parsing); interpr1.cxx:6745-6748 (bQueryByString/bRegExp) Text criteria supported via bQueryByString; wildcard/RegExp via MayBeRegExp; empty criteria cell (svMissing) handled as missing field   Required by ODF 1.4; partially verified Medium  Verify wildcard and text criteria matching  calcval: no dedicated wildcard/empty-criteria cases — not covered
7F-GAP-006   §3.7    Formula length at least 1024 characters main/sc/inc/compiler.hxx:59-60 (MAXCODE=2048 tokens, MAXSTRLEN=1024 per symbol); main/sc/source/core/tool/compiler.cxx:3973-3978,:2689-2691 No formula-text length limit; MAXCODE=2048 max tokens, MAXSTRLEN=1024 max chars per single symbol. A 1026-char formula needs ~1025 tokens < 2048, each token < 1024 chars. A string literal may now reach 32767 chars (it was limited to 1021). MET — the 512-token limit was raised to 2048 (MAXCODE); matches on Linux aarch64    Low None    calcval: SG.BL-001-1024chars (1026-char expression, result 513) — matches
8F-GAP-007   §3.7    At least 30 parameters per function where prototype permits main/sc/source/core/inc/interpre.hxx:897-927 (MustHaveParamCount family); main/sc/source/core/tool/interpr1.cxx:3396-3400 (ScMax uses MustHaveParamCountMin)    Per-function parameter count enforced via MustHaveParamCount/MustHaveParamCountMin/MustHaveParamCountMax. No global 30-param cap found. MAX uses MustHaveParamCountMin(nParamCount, 1) — no upper cap beyond MAXCODE=2048 tokens. Parameter count via GetByte() supports up to 255; calcval SG.BL-255args expected result 255 (unverified). MET — matches on Linux aarch64; a call with more than 255 arguments is an error Low None    calcval: SG.BL-002-30params (MAX with 30 params, expected 30) — matches
9F-GAP-008   §3.7    Strings up to 32767 ASCII characters    main/tools/inc/tools/string.hxx:110-120 (STRING_MAXLEN definition); main/sc/source/core/inc/interpre.hxx:930-936 (CheckStringResultLen); main/sc/source/core/tool/compiler.cxx:2689-2691 (MAXSTRLEN per literal)    STRING32 not defined → default STRING_MAXLEN = 0xFFFF = 65,535 (> 32,767 ODF minimum). CheckStringResultLen enforces at concatenation (REPT, & operator). A string literal in a formula was limited to 1021 characters by MAXSTRLEN=1024; MAXSTRLITLEN (32767) now applies to literals. LEN(REPT("a";32767)) — "a" literal is 1 char; REPT creates 32,767-char string at runtime under STRING_MAXLEN.   MET — run-time strings and string literals both reach 32767 characters  Low None    calcval: SG.BL-003-32767chars (=LEN(REPT("a";32767)), expected 32767), SG.BL-003-literal1022 and SG.BL-003-literal32767 (=LEN("aaa...")) — match
10F-GAP-009   §3.7    At least 7 nesting levels of functions  main/formula/source/core/api/FormulaCompiler.cxx:782,:1341 (nRecursionMax=42, errStackOverflow); main/sc/inc/compiler.hxx:61 (MAXJUMPCOUNT=32, the jump targets of CHOOSE; IF and IFNA use it with at most 3 and 2, FormulaCompiler.cxx:1101-1103)  The parser stops with errStackOverflow once its recursion count passes 42. MAXCODE=2048 total tokens is the other ceiling (7 nested IFs ≈ 15 tokens).   MET — 7 nested IF levels match on Linux aarch64 Low None    calcval: SG.BL-004-7nesting (7 nested IFs, expected 1) — matches
11F-GAP-010   §5.5    Operator precedence per Table 1 main/sc/source/core/tool/compiler.cxx (parser grammar: RangeLine → IntersectionLine → RangeLine → UnaryLine → binary ops); main/sc/inc/compiler.hxx:61 (MAXJUMPCOUNT=32, CHOOSE only)   Parser structure exists with correct precedence hierarchy: ! > : > prefix +,- > ^ > *,/ > +,- > & > comparison. Precedence can be overridden with parentheses. Precedence not verified at runtime.  RUNTIME_PENDING — source has correct operator precedence structure; runtime verification required   Medium  Runtime precedence test (2+3*4=14, 2^3^2=512, -2^2=4)   calcval: SYN-005-precedence, SYN-005-power, SYN-005-negpow — RUNTIME_PENDING
12F-GAP-011   §5.8    Reference syntax supported  main/sc/source/core/tool/compiler.cxx (IsReference, PopDoubleRef/PopSingleRef); main/sc/inc/compiler.hxx    Cell and range reference handling present in compiler; references begin with '[' to disambiguate from function names; supports cell, row, column, whole-row, whole-column references    RUNTIME_PENDING — source has correct reference syntax structure; runtime verification required  Low Runtime reference test  calcval: SYN-008-ref, SYN-008-range — RUNTIME_PENDING
13F-GAP-012   §5.11   Simple Named Expressions supported  main/sc/source/core/tool/compiler.cxx (NameLine, ocName opcode); main/sc/source/core/inc/interpre.hxx   Named expression compilation present; SimpleNamedExpression ::= Identifier | '$$' (Identifier | SingleQuoted); global scope, case-consistent matching; requires pre-defined name not set up in calcval harness  RUNTIME_PENDING — source has correct named expression structure; runtime verification requires named expression setup in harness    Medium  Define named expression in test environment; verify calcval: SYN-009-named (=MYNAME) — RUNTIME_PENDING (not directly executable without name setup)
14F-GAP-013   §5.12   Error syntax and propagation    main/formula/inc/formula/compiler.hrc:58-64 (SC_OPCODE_ERROR_NULL through SC_OPCODE_ERROR_NA); main/sc/source/core/tool/interpr4.cxx (PushError, NOTAVAILABLE); main/sc/source/core/tool/compiler.cxx:3741,:4029,:4072,:4091,:4101,:5493,:5501 (errNoName)  Error constants #N/A (required) and others (optional) present. Error syntax: '#' [A-Z0-9]+ ([!?] | ('/' ([A-Z] | ([0-9] [!?]))). Functions propagate Errors unless stated otherwise. Not verified against ODF 1.4 normative results.    RUNTIME_PENDING — source has correct error constant structure; runtime verification required    Medium  Runtime error propagation test  calcval: SYN-010-error (=NA() → #N/A), CONV-005-error — RUNTIME_PENDING
15F-GAP-014   §5.14   Whitespace handling main/sc/source/core/tool/compiler.cxx:3583-3593 (NextNewToken generates ocSpaces), :3655-3667 (whitespace before '(' for function names)    Whitespace ::= #x20 | #x09 | #x0a | #x0d. Ignored outside strings, around operators, before/after =, before function names (but not between name and '('). ocSpaces token generated during tokenization. Only #x20 is set as whitespace in the compiler character table (compiler.cxx:448); #x09, #x0a and #x0d are unverified. RUNTIME_PENDING — runtime verification required Low Runtime whitespace test calcval: SYN-011-whitespace — RUNTIME_PENDING
16F-GAP-015   §6.13.7 / §6.13.8   COUNTA/COUNTBLANK distinction: scalar "" vs cell formula returning ""   main/sc/source/core/tool/interpr1.cxx:3487 (svString case counts ""), :4714 (cell-type-only check for COUNTBLANK)   AOO distinguishes scalar "" (counted by COUNTA) from cell formula returning "" (COUNTBLANK uses cell type, not result)  Implementation-defined; cell-type-only approach may not match ODF intent for formula cells returning "" Medium  Document distinction; consider formula-result inspection for COUNTBLANK Not covered by executable calcval cases (harness cannot place "" in data cells)
17F-GAP-016   §5.2    Basic Expressions grammar   main/sc/source/core/tool/compiler.cxx:3570 (NextNewToken), :3780 (CompileString)    Formula ::= Intro? Expression; Expression supports Number, String, Array, PrefixOp, InfixOp, parenthesized, function call, Reference, QuotedLabel, AutomaticIntersection, NamedExpression, Error. Grammar structure correct per §5.2 BNF.   RUNTIME_PENDING — source has correct expression grammar structure; runtime verification required    Medium  Runtime expression test (parenthesized, mixed operators)    calcval: no dedicated Basic Expressions test; covered indirectly by other syntax tests — RUNTIME_PENDING
18F-GAP-017   §5.3    Constant Numbers    main/sc/source/core/tool/compiler.cxx:2650+ (IsValue, number parsing)   Number ::= StandardNumber | '.' [0-9]+ ([eE] [-+]? [0-9]+)?; StandardNumber ::= [0-9]+ ('.' [0-9]+)? ([eE] [-+]? [0-9]+)?; decimal separator '.', scientific notation E/e   RUNTIME_PENDING — source has correct number literal syntax; runtime verification required   Low Runtime number literal test calcval: SG.SYN-003-decimal (=1.5), SG.SYN-003-sci (=1.5e2) — RUNTIME_PENDING
19F-GAP-018   §5.4    Constant Strings    main/sc/source/core/tool/compiler.cxx:2682 (IsString), :2689-2691 (MAXSTRLEN per literal)   String ::= '"' ([^"#x00] | '""')* '"'; double-quote escaped by duplication  RUNTIME_PENDING — source has correct string literal syntax; runtime verification required   Low Runtime string literal test calcval: SG.SYN-004-string (="hello"), SG.SYN-004-quote (="he said ""hi""") — RUNTIME_PENDING
20F-GAP-019   §5.6    Functions and Function Parameters   main/sc/source/core/tool/compiler.cxx:3648 (function name detection), :3661-3668 (must be followed by '('); main/sc/source/core/inc/interpre.hxx:897-927 (MustHaveParamCount family)    FunctionName ::= LetterXML (LetterXML | DigitXML | '_' | '.' | CombiningCharXML)*; case-insensitive; semicolon ';' separator; empty parameters allowed  RUNTIME_PENDING — source has correct function call syntax structure; runtime verification required  Medium  Runtime function call test  calcval: SG.SYN-006-func (=ABS(-5)) — RUNTIME_PENDING
21F-GAP-020   §5.7    Nonstandard Function Names  main/sc/source/core/tool/compiler.cxx:3741,:4029,:4072,:4091,:4101,:5493,:5501 (errNoName); main/formula/source/core/api/FormulaCompiler.cxx:891-895 (unknown name followed by '(' gives errNoName) Unknown functions → Error value other than #N/A; names not in spec need prefix (e.g., COM.FOO.BAR)  RUNTIME_PENDING — source has correct nonstandard function name handling; runtime verification required  Low Runtime nonstandard name test   calcval: SG.SYN-007-nonstandard (=NONEXISTENT() → #ERR) — RUNTIME_PENDING
22