Repository navigation
fix(docx): name in the report the geometry a block is written without - #857
Merged
Merged
Conversation
A picture's, a barcode's and a table's left margin or padding, a page reference's sides, a spacer's and a chart's insets above and below, and a fixedWidth narrower than the column of an unpainted box or of a panel composed in a table cell were left out of the Word file in silence. Each block's note now names them, and a page reference whose anchor has no bookmark says its number is written as text. In a band, where a spacer's or a chart's insets are written as the space below, no note is made. Nothing written changes.
…measures A band measures the space below its lowest block from the page, and a column the space before a layer it resumes after the one above, each taking that block's margin and padding below it; nothing else in them writes a spacer's or a chart's insets. DocxLayerColumns now hands back where those blocks are placed, and only their side below goes unnamed: the sides above, below a block in the middle and a chart's left are named in a band too. A page reference counts the sides its alignment sets it from, and a fixed width is named only where the column's width is known and the box holds text.
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
The DOCX export left part of a block's own geometry out of the Word file and said nothing, while
DocxExportReportpromises to name every loss:DocxNodeFieldLedgerTestlisted each of these as a gap.What changed
sidesLost(node, marginWritten, left, right)names a block's side margins and padding that its paragraph or table leaves out. A side counts where it moves the block:insetSidesLost(node, left)names the sides a spacer or a chart's table loses its margin and padding on: above, below and, for a chart, on the left.DocxLayerColumnsnow hands back where those blocks are placed (Band.closing,Plan.closing), from the same measurement that sets the space. The measurement itself is unchanged.written as an inline picture; …;drawWhereThePagePutsIt): its padding. It is fitted to its placement, which holds the padding;written as a paragraphnote, naming its sides and, where the export writes no bookmark for its anchor, that its number is written as text;writeSpacer): the sides above and below;chartnote;writeContainerChildren): afixedWidthnarrower than the room its margins leave it. The room is taken past a placed row column's left margin, with an auto column's point of slack, and only where the width is known. A panel the layout placed is a table that wide, so it loses nothing.REPORTED. 23 node-field gaps remain, each named.DocxLayoutMetrics.ownRowsmatches a table's rows by the table's placement width, which holds its side padding. A table with side padding therefore matches none of its rows, and loses its grid, row heights, unbroken rows and the anchoring of drawings in them. That is fixed in a change of its own, since it changes what is written.Verification
./mvnw -B -ntp install -pl :graph-compose-render-docx→ BUILD SUCCESS: 1008 tests, 0 failures, 1 skipped (the property-gated fidelity probe).DocxBlockGeometryReportTestis new, 18 tests.w:tblIndof a table with a margin and padding equals that of one with the margin alone, which is not empty.DocxFidelityCorpusTest -Dgraphcompose.docxFidelity=export, SHA-256 per file, 0 of 62 differ.-pl :graph-compose-core -Dtest='com.demcha.documentation.**'→ 166 tests, 0 failures;DocxPageZoneTest,DocxTransparentWrapperTest,TimelineRailAcrossBackendsTestandRtlAcrossBackendsTest→ 52 tests, 0 failures.Lane: render-docx backend (report only, no change to what is written) plus tests and docs.