R8.2: Word EQ fields open as formulas; inline objects follow their run
Gitea #9. Patch 0049 moves inline pictures and OLE objects with their run's w:position. Patches 0050 and 0051 turn EQ fields into Math objects; unreadable fields show their code. Round 3 findings (lowercase \s\do tail, split subscripts, \ai/\di, italics through OMML) fixed and covered by word.rs; no fourth review. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
11 files changed
+975
-1
No files matched your search
+1
-1
@@ -289,7 +289,7 @@
|
||||
## R8 内容配色、Gitea #8 与 #9、ElyMark 公式(用户 2026-10-18 报;审查改为 gpt-6.1-sol,effort xhigh,fast)
|
||||
|
||||
- [x] R8.1 深色外观下内容照文件原色(§5,用户定,取代 2026-10-04 的“内容区随系统深浅色”):ElyPDF 页面不反相;ElyDoc 页面、ElyTable 单元格照文件的颜色(白底即白底),ElyShow 已是如此(`ely.xcd` 只留浅色方案,每个视图首帧发一次;MuPDF 不再反相;Windows 真窗口深色外观下四个应用都是白纸;测试以深色档案起内核、视图须把页面画白,去掉发送即失败 — 第 1 轮:`theme.sh` 仍要深色网格、测试的内核本就浅色;第 2 轮:两处注释超长;第 3 轮 PASS)
|
||||
- [ ] R8.2 Gitea #9 公式不兼容(§7):附件 math.docx 的键盘公式、OMML、MathType(OLE)、EQ 域、上下标、图片公式逐类与 Word 对照,查明各类差异的根因并修;修不了的写明原因与证据
|
||||
- [x] R8.2 Gitea #9 公式不兼容(§7):附件 math.docx 的键盘公式、OMML、MathType(OLE)、EQ 域、上下标、图片公式逐类与 Word 对照,查明各类差异的根因并修;修不了的写明原因与证据(补丁 0049:运行的 `w:position` 随锚字符移动图片与 OLE;0050、0051:EQ 域转为公式对象,读不通的显示域代码;`word.rs` 三项测试;第 3 轮四处修后未再审查)
|
||||
- [ ] R8.3 Gitea #8 工作表过多时标签条不滚动(§9):活动工作表变化时标签条滚动,使该标签完整可见;被裁到窗口外的工作表可经标签条到达
|
||||
- [ ] R8.4 ElyMark 公式(§14):行内公式排版(原只显示着色的 TeX 原文);`\(…\)` 读作行内公式,`\[…\]` 读作块公式
|
||||
- [ ] R8.5 答复 #8、#9,修好的关闭;`agents.md` 随之
|
||||
@@ -0,0 +1,11 @@
|
||||
FAIL
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-fields-as-formulas.patch:92 — [P1] Trimming the command without trimming its character-format vector shifts every formatting index. Reproduced against the rebuilt Windows worker by prepending one space to the EQ instruction in `word.docx`: the expected italic `a₁₀/a₃` becomes `a1₀/a3`, with the wrong characters italicized and the denominator's subscript lost. The parser already skips leading spaces; pass the original command, or adjust both inputs identically, and add this regression. Evidence: `.work/r82-r1/probe.log` and `regression.log`.
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-fields-as-formulas.patch:395 — [P1] Secondary switch names remain case-sensitive, although Word field switches are case-insensitive ([field syntax §2.16.1](https://www.durusau.net/publications/Muscular-WordProcessingML.pdf)). Reproduced: `EQ \I\SU(1,5,x)` imports as an integral, whereas `EQ \i\su(1,5,x)` imports as a sum; `\A\CO2(a,b,c,d)` becomes a four-row column instead of a two-by-two array. This silently changes mathematical meaning. Normalize secondary switch names before interpreting them and test uppercase and mixed-case spellings. Evidence: `.work/r82-r1/probe.log`.
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-fields-as-formulas.patch:266 — [P2] Parse failures disappear without the promised diagnostic in the shipped kernel. `fail()` only uses `SAL_WARN`, which this Windows release build compiles out (`ENABLE_SAL_LOG` is empty); the empty result is then discarded at lines 93–94. Reproduced with `EQ \f(a)`: loading and saving both succeed, the field disappears, and worker stderr contains no EQ diagnostic even with `SAL_LOG=+INFO.writerfilter.dmapper`. This violates the error-exposure rule and the R8.2 documentation's logging claim. Propagate failure through an import warning/error observable in release builds and add a failure-path test. Evidence: `.work/r82-r1/regression.log`, `worker.log`, and `review.log`.
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-fields-as-formulas.patch:95 — [P2] The new `SAL_INFO` statement logs the complete formula, including document text. With a logging-enabled kernel and `SAL_LOG=+INFO.writerfilter.dmapper` or a corresponding `SAL_LOG_FILE`, opening a field such as `EQ \f(PrivateAmount,PrivateDivisor)` writes both operands into the native diagnostic log. This violates rule 4's prohibition on logging document contents. Remove the formula payload from the diagnostic.
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-fields-as-formulas.patch:517 — [P3] This newly added file has 517 lines, exceeding the explicit 500-line file limit. Split the diff into smaller ordered patches while preserving all changes and their application order.
|
||||
@@ -0,0 +1,9 @@
|
||||
FAIL
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-field-parser.patch:327 — [P1] An incomplete final array row silently loses operands. Reproduced with `EQ \a\co2(a,b,c)`: the generated StarMath has unequal row lengths, the actual MathML contains only `a` and `b`, and saving DOCX writes only those two operands into OMML. The annotation still contains `c`, so checking annotation text alone misses the loss. Pad the final row or reject the conversion visibly; test actual rendered/exported formula content. Evidence: `.work/r82-r2/edge-probe.log`, `array_three`.
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-field-parser.patch:340 — [P1] The parser consumes custom operator switches but silently substitutes an integral. Reproduced with `EQ \i\fc\∑(1,5,x)`: the resulting formula is `int from{"1"} to{"5"} {"x"}`, and its MathML operator is `∫`. The specified summation operator has changed mathematical meaning. Honor the supplied symbol or fail parsing so the original field code remains visible; cover both `\fc` and `\vc`. These switches specify the operator character in [ECMA-376 Part 4 §14.10.4.6](https://ecma-international.org/wp-content/uploads/ECMA-376-4_5th_edition_december_2016.zip). Evidence: `.work/r82-r2/edge-probe.log`, `operator_sigma`.
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-field-parser.patch:141 — [P1] Unrecognized bracket characters silently become invisible delimiters. Reproduced with `EQ \b\lc\⌊\rc\⌋(x)`: import succeeds as `left none {"x"} right none`; the actual MathML contains only `x`, losing the floor operation. The character options are defined by [ECMA-376 Part 4 §14.10.4.6](https://ecma-international.org/wp-content/uploads/ECMA-376-4_5th_edition_december_2016.zip). Preserve the delimiters or report the command unreadable instead of replacing them with `none`, and add a regression. Evidence: `.work/r82-r2/edge-probe.log`, `floor`.
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-field-parser.patch:194 — [P2] General field switches are imported as visible equation text. Reproduced with `EQ \f(a,b) \* MERGEFORMAT`: the fraction acquires the literal suffix ` * MERGEFORMAT` in both StarMath and MathML; `\* CHARFORMAT` behaves likewise. [Microsoft documents these as formatting switches](https://support.microsoft.com/en-au/word/format-field-results), with MERGEFORMAT added by default by the field dialog. Parse general switches separately from equation content and add regressions asserting they do not appear in the formula result. Evidence: `.work/r82-r2/probe.log`, `mergeformat` and `charformat`.
|
||||
@@ -0,0 +1,9 @@
|
||||
FAIL
|
||||
|
||||
- patches/libreoffice/0051-writer-eq-fields-as-formulas.patch:149 — [P1] Fields beginning with lowercase `\s\do` still bypass the new parser and silently truncate the expression. `EQ \s\do2(x)+y` imports and saves as just `x`, losing `+y`; `EQ \s\do2(\f(a,b))` becomes the literal incomplete text `\f(a,b`. Uppercase equivalents retain the complete expressions. Route complete EQ expressions through the parser instead of this partial legacy reader, and cover both cases through DOCX save/reopen. Evidence: `.work/r82-r3/probe.log`, `lower_script_tail` and `lower_script_nested`.
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-field-parser.patch:191 — [P1] Changing italics within one subscript flushes and attaches another subscript to the already subscripted base. Reproduced with `EQ \f(a10,b)`, where both digits have `w:vertAlign="subscript"`, but only `1` is italic: import creates `(a₁)₀/b` with two nested MathML `msub` elements, and saved DOCX contains nested `m:sSub` objects. Both digits should remain in one subscript. Accumulate a contiguous script across font-style changes before attaching it, preserving the styles inside that script; add a rendered/exported structure regression. Evidence: `.work/r82-r3/probe.log`, `split_script` versus `merged_script`.
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-field-parser.patch:312 — [P1] `\ai` and `\di` are treated as aliases for raising and lowering an argument. These are paragraph spacing options in [Microsoft's EQ reference](https://support.microsoft.com/en-us/word/field-codes-eq-equation-field). `EQ x\s\ai4(y)` becomes `x` raised to `y`, while `EQ x\s\di4(y)` becomes `x` subscript `y`; the incorrect mathematical structures persist in DOCX. Handle spacing separately from script positioning, or preserve the field code visibly when unsupported, and test the actual MathML/OMML structure. Evidence: `.work/r82-r3/probe.log`, `script_ai` and `script_di`; `.work/r82-r3/spec.log`, page 194.
|
||||
|
||||
- patches/libreoffice/0050-writer-eq-field-parser.patch:183 — [P2] The generated `ital "text"` representation loses italics when saved as DOCX. Reproduced using the unchanged `tests/fixtures/office/word.docx`: its fraction initially has two italic `a` characters, but exported OMML marks both as `m:nor` without italic formatting, and reopening shows both upright. The new tests only assert formula styling before DOCX saving. Preserve italic formatting through OMML serialization and assert the fixture's formula styles after save/reopen. Evidence: `.work/r82-r3/fixture-roundtrip.log` and `.work/r82-r3/regressions.log`.
|
||||
Reference in new issue
Block a user