Skip to content

fix(docx): say Word sets a hung panel at its cell's text in every cell - #945

Merged
DemchaAV merged 1 commit into
2.5-devfrom
fix/docx-hang-in-filled-panel
Oct 22, 2026
Merged

DemchaAV merged 1 commit into
2.5-devfrom
fix/docx-hang-in-filled-panel

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Why

A panel in a table cell whose left border hangs left of the cell's text is written with a negative w:tblInd. The report names it (left edge) because the editors start a nested table at its cell's text. The note said "LibreOffice starts a nested table at its cell's text, and Word may". The docs, the ledger and six comments said Word honours the negative indent inside a filled panel's cell or a row inside one, 0.04 to 0.17pt off the page.

That exception is not what Word does. The measurement paired the panel's 3pt accent with a 0.12pt sliver of the outer cell's shading, which Word draws where the nested table starts. Only a shaded outer cell has that sliver, which is why taking the outer shading off seemed to change Word's placement. The accent itself stands at the cell's text in that same Word render: 1.62pt right of the page's in the earlier a-in-panel probe.

It also left a question open about whatTheHangGivesUp, which narrows a hung panel's table on the premise that Word moves it right. Inside a filled panel, a table Word did not move would end up to that much left of the page.

What changed

  • Measured on Windows, a 3pt accent panel with its own fill in four nestings:

    • in a filled panel's cell;
    • in a row inside a filled panel, Compact Mono's shape;
    • in a row inside a ruled panel;
    • in a plain row.

    Its border stood 1.59 to 1.62pt right of the page's in Word and 1.5pt in LibreOffice, in all four. A panel bled 4pt left by a margin below zero stood 4pt right in both editors, its text with it. In the corpus, Compact Mono's rail accent, in a row inside its filled root panel, stood 1.66pt right in Word and 1.5pt in LibreOffice.

  • whatTheHangGivesUp stands as it is. In the corpus, the only hung panels it narrows in a filled cell are Cobalt Rota's chips, in its filled table cells, and their right ends stand where the page draws them in Word (within 0.07pt). No code changes.

  • The note (leftEdgeHungOut) now ends ": LibreOffice and Word start a nested table at its cell's text".

  • Comments and javadoc: leftEdgeHungOut, whatTheHangGivesUp, cellHang, the in-cell indent, the row's hang, indentTable and the panel's fallback list drop "except in a filled panel's cell".

  • Docs:

    • the ledger's LEFT_EDGE ("which LibreOffice and Word set at the cell's text");
    • the recipe's panel passage;
    • the capability matrix's panel row;
    • the CHANGELOG entry for the left-edge note, which is unreleased, now with the bled measurement.

Verification

  • DocxPanelLeftEdgeTest (11 tests) pins the new wording, the bled panel's included. The filled-panel test's comment now carries the measurement.
  • Fail-closed: 2 sabotages, each run alone, both caught:
    • the old "and Word may" tail: 6 tests fail;
    • a bled panel named for its left edge: 1 test fails.
  • Corpus: 62 of 62 DOCX byte-identical. Notes stay at 1363; the 75 left edge notes change their text only.
  • Gate:
    • ./mvnw -B -ntp clean verify -pl <core, render-pdf, render-docx, render-pptx, templates, testing, qa, coverage> -am → BUILD SUCCESS: core 821, render-pdf 339, render-docx 2062, testing 5, render-pptx 142, templates 127, qa 1828.
    • The JDK 17 knowledge checks pass, and core javadoc has 0 warnings.
    • ./mvnw -f examples/pom.xml test → BUILD SUCCESS, 93 tests.

Lane: shared-engine (render-docx): report text and documentation only, no public API change.

- The left-edge note said LibreOffice starts a nested table at its
  cell's text "and Word may", and the docs that Word honours the
  negative indent inside a filled panel's cell or a row inside one
  (0.04 to 0.17pt off the page). That reading paired the 3pt accent
  with a 0.12pt sliver of the outer cell's shading, which Word draws
  where the nested table starts and only a shaded outer cell has.
- Measured on Windows, a 3pt accent in a filled panel's cell, in a row
  inside a filled or a ruled panel, and in a plain row stood 1.59 to
  1.62pt right of the page's in Word and 1.5pt in LibreOffice; a panel
  bled 4pt left stood 4pt right in both.
- The note now says LibreOffice and Word start a nested table at its
  cell's text. The comments, the ledger, the recipe, the capability
  matrix and the CHANGELOG drop the filled-panel exception. No DOCX
  changes.
@DemchaAV
DemchaAV merged commit 79c63de into 2.5-dev Oct 22, 2026
13 checks passed
@DemchaAV
DemchaAV deleted the fix/docx-hang-in-filled-panel branch October 22, 2026 22:49
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