Repository navigation
fix(docx): take text hanging past a block out of the space above a band that follows - #830
Merged
Merged
Conversation
… the band test pins
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
Text that runs past the foot of the block it stands in leaves that reach in
hangingBelow, for the space above what follows to give back. That covers:writeOverlayBand);hangBelowItsBox);writeLinePair);A paragraph or a table that follows takes it out of its space above.
A stack written as a band dropped it.
writeOverlayBandseeds the space above its first block (resumeSpacing) from the gap the page measures. Its first block then resumes that space (resumeHere) and forgets the hang.ConsultingInvoice.What changed
writeOverlayBand. When a band opens (not inside a band already writing), the hang comes off the space above its first block, as far as that space goes. A band the layout starts on a new page leaves the hang on the page above, as a paragraph (fix(docx): keep the space above a paragraph or spacer the layout moves to a new page #825) and a table (fix(docx): keep a table's top edge on the page the layout moves it to #821) there do.word-windows,libreoffice-windowsand their-linesfiles are rewritten for the six lines this moves.libreoffice-linuxand its-linesfile are taken from this PR's CI run (docx-fidelity-37134178025).MerchantInvoiceincluded: its Linux baseline already matched.CHANGELOG.md, and the paragraph on pulls and overhangs indocs/recipes/docx-export.md.Verification
Template corpus, re-measured in full in both editors on Windows. Only
ConsultingInvoiceand its long version move: three contact lines each. No line is lost, and page counts are unchanged.Across the corpus, lines past 2pt fall from 11 to 5 in Word, and from 614 to 608 in LibreOffice (Windows). The 5 left in Word are
VioletGrid's.New test,
DocxOverlayBandTest.textHangingBelowABandTakesItsPlaceOutOfTheSpaceAboveTheNextBand.New test,
DocxOverlayBandTest.aBandOpeningTheNextPageLeavesTheHangAboveOnItsPage.Examples module (
./mvnw -B -ntp test -f examples/pom.xml, 93 tests): BUILD SUCCESS. No committed preview moves.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. render-docx runs 847 tests, qa 1814.Known limits
newTable). A paragraph that follows instead takes the rest out of its own top edge (hangingOver).overlayDepth == 0condition the paragraph path uses (fix(docx): keep the space above a paragraph or spacer the layout moves to a new page #825). The one-layer flow depth is left to the change that unifies it.Lane: shared-engine (render-docx). No public API change.