Repository navigation
fix(docx): keep the layout's grid, row heights and unbroken rows for a table with side padding - #858
Merged
Merged
Conversation
…a table with side padding The page draws a table's rows inside its padding, narrower than its placement by that much, and the rows were matched to the layout by the placement's width: a table with side padding matched none and was written without the layout's grid, row heights or unbroken rows, standing its padding left of the page's. The rows are measured inside the padding now, and the padding holds the table in as its margin does, so a table with side padding is written as one with those margins.
…ng in its cell A table held in by an alignment wrapper, and a drawing a padded table's cell is all of, are written as for a table with those margins. The recipe's indent paragraph, the capability matrix's nested-table width and the CHANGELOG entry's wrapping say what the padding now does.
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 draws a table's rows inside its padding:
NodeDefinitionSupport.prepareTablemeasures the table atfinalWidth + padding.horizontal, and lays each row outpadding.leftin,finalWidthwide.DocxLayoutMetrics.ownRowsandtableColumnsmatched a table's rows to the layout by the table's placement width. A table with side padding therefore matched none of its rows, and the DOCX export wrote it:The report named the left padding; the grid, row heights, unbroken rows and anchors it did not.
What changed
DocxLayoutMetrics.rowsWidthis the placement less the side padding, andownRowsandtableColumnsmeasure a table's rows against it. Row heights, unbroken rows, cell boxes and the grid come back for a table with side padding.writeTableWithItsOwnSpacingadds a table's side padding to the insets it is written between: its left side is inw:tblInd, and both are out of the room its columns are given. A row's padding is unchanged, since it rides in its cells' margins (writeRow).withEditorSlackno longer takes the padding off the room a second time; it is among the insets now.DocxNodeFieldLedgerTestmovesTableNode.paddingtoWRITTEN; 22 node-field gaps remain.Verification
./mvnw -B -ntp install -pl :graph-compose-render-docx→ BUILD SUCCESS: 1014 tests, 0 failures, 1 skipped (the property-gated fidelity probe).DocxPaddedTableTestis new, 7 tests:cantSplit, the row heights and the indent;w:tblIndof 15pt);DocxFidelityCorpusTest -Dgraphcompose.docxFidelity=export, SHA-256 per file, 0 of 62 differ). A table with side padding is written as one with those margins, which the corpus already holds.-pl :graph-compose-core -Dtest='com.demcha.documentation.**'→ 166 tests, 0 failures;DocxPageZoneTest,DocxTransparentWrapperTest,TimelineRailAcrossBackendsTestandRtlAcrossBackendsTest→ 52 tests, 0 failures.Lane: render-docx backend (what a table with side padding is written as) plus tests and docs.