Repository navigation
test(docx): hold a body card whose text fills it to grow with that text - #972
Merged
Merged
Conversation
A painted box holding text in the body is written as a panel whose row is held at least its outline's height, so it grows when text is added to it in an editor. DocxBodyShapePanelTest held that rule only on boxes whose text leaves room to spare. A change writing exact only the row of a box its text fills, at the height a clip that cuts is written at, was seen by no test: in Word every line of the corpus card stood where it stood, in LibreOffice 24.2 the paragraph under it moved nearer the page, and the card no longer grew. The new case holds a card a quarter of a point taller than its text, as the page lays it out, to an at-least row.
The case asserts that the first layout sets the card's text at its own height, not the taller card's: otherwise the card would be no fuller than its text leaves it. Its comment and the CHANGELOG entry say the card's text and padding fill it, and leave out a prediction of what LibreOffice would do.
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 painted box holding text in the body is written as a panel (#971): a table of one cell whose row is held at least its outline's height, so the box grows when text is added to it in an editor. With the editing protocol's sentence added, the fidelity corpus's
rounded_cardgrows 35.4pt taller in Word 16 and 36.0pt in LibreOffice 24.2, and the paragraph under it moves down as far.DocxBodyShapePanelTestholds that rule on a card under its default clip only where the card's text leaves room to spare inside it. Nothing holds it for a card whose text and padding fill its outline, as the corpus card's do: its section ends 1.6pt above the outline's foot. A change that writes only such a box's row exact, at the height a clip that cuts is written at, is seen by no test, nor by either fidelity gate measured under it:render-docx(2310) and ofqa(1846) passes;rounded_cardstands where it stood, to 0.00pt;The Windows LibreOffice baseline was not measured under it.
That 0.6pt is the one difference #971 left in LibreOffice 24.2, which counts a cell's borders inside a least row height. A change that closed it by writing the card's row exact would land here, and the Linux gate would reward it. Word's editing protocol, run by hand, is the only check that would fail it, on the exact row.
What changed
DocxBodyShapePanelTest.aCardItsTextFillsGrowsWithItsTextAsOneWithRoomToSpare(new): a card as wide as the page between its margins, under its default clip, holding a heading and a paragraph in a padded section. The card is a quarter of a point taller than that section as the page lays it out; the height is read from a first layout, so the case does not hang on a face's metrics. The test asserts its premise (the section laid out at its own height, and less than half a point under it), then that the card's row is held at least its outline's height less its two borders, and that the report names neither a clip nor a layer past the outline.No production code changes.
Tests
DocxBodyShapePanelTest: 18 (17 + 1), passing.DocxBodyShapePanelTestis run. Every one is caught, and the source is byte-identical afterwards:render-docx's 2311, and none ofqa's 1846. Exported over the corpus, it changesrounded_cardalone, its row exact; the Word and LibreOffice 24.2 measurements above are of that export.clean verifyof the reactor as CI runs it → BUILD SUCCESS (core 823, render-pdf 339, render-docx 2311, testing 5, render-pptx 142, templates 127, qa 1846); the four knowledge checks and core javadoc (0 warnings) pass; examples 93.Lane: tests (
render-docx). No public API change.