Repository navigation
fix(docx): write a body panel's table indent even when it is 0 - #823
Merged
Merged
Conversation
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
A container that paints exports as a one-cell table, and its
w:tblIndplaces the cell's text, less half its left border (writePanelPiece: edge + padding − half the left border). The indent was written only when it was not 0.IndigoProposal's about band takes its fill to the paper's edge with a negative left margin, and takes its text back to the page margin with an equal padding. So its indent is exactly 0, and nothing was written.With no
w:tblInd, Word 16 does not put the text on the margin. It puts the table's edge there, and the text a padding further in. Fill and text stood 27.6pt right of the page's, while the band's icons, drawn from the page, stood where the page has them. LibreOffice already set the band where the page does.Measured by editing the exported DOCX by hand and converting it with Word 16.0.20430:
w:tblInd w:w="0", the fill stands at 0 and "ABOUT" at 27.6. The page has them at 0 and 27.7.What changed
writePanelPiecewrites the indent of a panel in the body even when it is 0. In a cell it keeps writing none at 0: there it is the table's outer edge, and Word starts a nested table no further left than the cell's text, so the two mean the same.CHANGELOG.md, and an Indent bullet under "What a panel keeps and loses" indocs/recipes/docx-export.md.Verification
IndigoProposalin Word: the 13 lines of the about band move 27.72pt left. "ABOUT KESTREL BUSINESS" stands at 27.63 against the page's 27.70.w:tblIndof 0:BlueBanner,BoxedSections(CV and letter),CompactMono,MinimalUnderlinedandModernProfessional(CV and letter). For each, the x of every line Word sets is unchanged, compared render to render. Their panels have no left padding, so 0 and none land alike.indentTable, which writes an indent wherever the inset is not 0. With no indent Word puts the edge on the margin, which is where they want it at an inset of 0.DocxPanelInsetTest.aPanelBledToThePaperEdgeWritesItsIndentOfNothing. A filled section with a −30pt margin and a 30pt padding writesw:tblInd0 and a 30pt left cell margin. It fails without the change, where no indent is written../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 -amgives BUILD SUCCESS. render-docx runs 820 tests, qa 1814.Known limits
Lane: shared-engine (render-docx). No public API change.