fix(docx): stand OrangeOps on one page in Word — room for a one-line heading, and a negative bottom edge kept - #810
Merged
Merged
Conversation
…ll the next paragraph up by a negative bottom edge
…nd none of it between overlapping layers Before a table or a page break the pull now comes out of the space owed below the paragraph, and a spacer under it takes what the space above it could not give. A band's next layer and its end, a layer column's next layer, and the layers drawn over a columns table no longer carry the pull, as the space there is measured from the page's boxes.
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
OrangeOpsran to two pages in Word, and 6 of its 108 lines were found in Word's rendering. Its two columns are one table row Word keeps whole, and the page fills to within 2pt. In Word the row grew 51pt and the masthead 4pt, so the whole row went to a second page.Oswald,Bold, and broke each heading onto a second line.What changed
wordsMeasure: a paragraph of one line has room for a line three hundredths wider than its own (ONE_LINE_FACE_SLACK), through its right indent.applyVerticalSpacing/newBodyParagraph: a negative bottom edge pulls the next paragraph up (pullBelow). That covers a paragraph's, an image's, a barcode's and a rule's.flushSpacingAftertakes it out of the space owed below.word-windowsandlibreoffice-windowsare rewritten for the documents this moves nearer the page.CHANGELOG.md, anddocs/recipes/docx-export.md(the negative-edge paragraph, and the half-point measure).Verification
Template corpus, line by line against
2.5-dev's baselines. Both gates pass: no line is lost or set further from the page, and no page count moves further from the engine's.OrangeOpsNorthlineProposalOrangeOpsNo other document changes in either editor. "Lines found" counts the lines the gate pairs with the page's.
New tests.
DocxVerticalSpacingTest:DocxOverlayBandTest:DocxWordSizeMeasureTest: a line of one as wide as its box is given room past it, and one with room to spare is not.Each rule fails its own test when taken out.
flushSpacingAfter, or out of the spacer, fails the table and spacer tests.Re-measured after the layer and spacer rules. The Word and LibreOffice corpus baselines re-record byte-identical, so no template reaches those paths.
DocxPanelInsetTest. Two assertions now allow a right indent only at or past the box. They still allow no left indent. A heading as wide as its panel now has room past it on the right.render-docxruns 778 tests. The committedword-export-companion.docxpreview exports unchanged (document.xmlbyte-identical).Full reactor gate:
./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 (qa 1811).Known limits
OrangeOpsstill runs to two pages in LibreOffice, which sets its body taller for its own reasons.Lane: shared-engine (render-docx). No public API change.