Repository navigation
fix(docx): name a panel's left edge its table cell holds in - #943
Merged
Merged
Conversation
The page sets a panel in a table cell with its left border centred on the cell's text edge, half of it outside, or further out by a margin below zero, and its nested table is written that far left of the text. LibreOffice starts a nested table at its cell's text, and so does Word in a row's or a table's cell, though not in a filled panel's: the panel stood up to that much right of the page's, and nothing said so. The report now names it (left edge). A panel a placed row holds as a column had its left margin, which the row's cell already starts past, counted again in its table's indent; it is counted once.
DemchaAV
marked this pull request as draft
October 22, 2026 18:33
- A panel that a margin below zero sets left of its table cell's text is named as the panel, its text with it, rather than by its left edge. - Comments that said Word always keeps a nested table in its cell name a filled panel's cell as the exception. - Word's measured offset in a filled panel's cell is 0.04 to 0.17pt. - A right border and a stroke's width name the left edge in the value ledger, and the ledgers say "Word in most cells", as the docs do. - Tests: a painted row with a 3pt left border in a filled section is named; a row column's card with a 6pt margin is written at w:tblInd -30.
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.
Why
The page sets a panel in a table cell with its left border centred on the cell's text edge, half of it outside, or further out by a margin below zero. Its nested table is written that far left of the cell's text (
w:tblIndbelow zero), but the editors do not always set it there.Measured on Windows with 3pt accents:
LibreOffice starts a nested table at its cell's text: 1.5pt right of the page's, and a box's in a ruled table cell 1pt.
Word does the same in a row's cell and in a table cell, filled or not: 1.55 to 1.73pt right.
Word in a filled panel's cell, or a row inside a filled panel, sets the table where it is written: 0.04 to 0.17pt off.
Patching the XML of one case at a time isolated the panel cell's shading as what turns this on. The table indent, fixed layout, cell borders, row height and keep-together made no difference.
In the corpus, Engineering Resume's 2pt and 3pt card accents stood 1.05 and 1.71pt right in Word, and the 3pt accents of Classic and Modern invoices' two-column blocks 1.58 to 1.63pt. The report said nothing.
Separately, a panel that a placed row holds as a column had its left margin counted twice in its table's indent. The row's cell already starts past that margin, so the panel stood its margin further right.
What changed
left edgenote (writePanelPiece,leftEdgeHungOut):edgeleaves out the child's left margin where the placed row's cell already starts past it (leftMarginInCell), as the paragraph, list and table writers already do. No panel of the corpus has such a margin, so no file changes.whatTheHangGivesUp), the row's hang, the cell hang, thetblIndwrites — it now names the filled panel's cell as the exception. The give-up's@param paddingis documented.DocumentBorders' four sides; andDocumentStroke.widthname the left edge (LEFT_EDGE), as doesDocumentInsets.left.Verification
DocxPanelLeftEdgeTest(new, 11 tests):w:tblInd−30 twips;left edge, none of the others changed../mvnw -B -ntp clean verify -pl :graph-compose-core,:graph-compose-render-pdf,:graph-compose-render-docx,:graph-compose-render-pptx,:graph-compose-templates,:graph-compose-testing,:graph-compose-qa,:graph-compose-coverage -am→ BUILD SUCCESS (render-docx 2050 tests, qa 1828). The JDK 17 checks pass: the knowledge pack,
@Betastability doc, claims and routes, and core javadoc with 0 warnings.Lane: shared DOCX backend (
render-docx). No public API change.