Repository navigation
fix(docx): leave a row's hang on its page when a spacer opens the next - #828
Merged
Merged
Conversation
…t, and take the Linux LibreOffice baseline from CI
…t, and check the layout each such test assumes
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
Follow-up to #827. A row whose cell's last line hangs past the row now leaves that reach in
hangingBelow, to come out of the gap under the row.A spacer the layout moves to the next page took it from the wrong space. The spacer's
newBodyParagraphtook the reach out of the space above it. Only then didholdTheGapAboveInTheLinemove what was left of that space into the spacer's line, which holds the gap the layout carries onto the new page.holdAParagraphsTopEdgeOnItsPage) already leaves the hang, a pull and a card's border below on the page above. A table there leaves the hang and the border.The Linux LibreOffice baseline was not rewritten in #827.
What changed
writeSpacer. For a body spacer that starts a page of its own, the hang, the pull andborderBeloware cleared before its paragraph is written, as on the paragraph path. Unlike that path, they are cleared even when the spacer's line then holds none of the gap: they belong to the page above either way.cellOverhang's comment says which writers read it: only a row does. A panel or a stack written as columns still makes its table taller by the remainder.Baselines.
libreoffice-linuxand its-linesfile are taken from fix(docx): take a cell's last line hanging past its row out of the gap under the row #827's CI run (docx-fidelity-37117164489). It moves the same three documents as Windows LibreOffice, by the same amounts:No line is lost, page counts are unchanged, and no line moves more than 0.22pt further from the page. This PR's own CI measurement is identical to that baseline.
Docs.
CHANGELOG.md, in fix(docx): take a cell's last line hanging past its row out of the gap under the row #827's entry.Verification
DocxRowOverhangTest. The block above is measured first, then a filler is sized so that it ends 3pt above the page's foot, under the 10pt gap. Each test first checks on the layout that the spacer opens page 2 with 10pt above it.aRowsHangStaysOnItsPageWhenTheGapUnderItCarriesASpacerToTheNext: a row whose last line is held exact to its icon. The spacer holds the hairline and the whole gap, 202 twips. With the hang left in place it holds 165.aPullOutOfTheBlockAboveStaysOnItsPageWhenTheGapCarriesASpacerToTheNext: a paragraph with a −4pt bottom margin. The spacer holds 202 twips; with the pull left in place, 122../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 841 tests, qa 1814.Known limits
Lane: shared-engine (render-docx). No public API change.