Repository navigation
fix(docx): name in the report where a page zone's parts stand and what its paragraphs lose - #863
Merged
Merged
Conversation
…t its paragraphs lose A page zone is written as one Word line: its parts one after another from the left margin, and those after the first spacer against the right margin. The page sets each by the zone's padding, a row's columns and gap and the part's own alignment and sides. A page zone note now counts the parts that stand off where the page sets them, read from the layout's zone fragments, says where that is not measured, and names a zone paragraph's direction, prefix letters, fitted size and outline entry. The written bytes do not change.
… it with the writer Word gives a zone's line one baseline, its tallest part's, standing at the zone's edge: the smaller parts move onto it, so they are the ones counted. A part known to stand off is counted before its place across the line is asked, and a prefix on the right side, whose end Word keeps, does not count. The writer and the report take the parts and the right tab from one place, and a page field's alignment, which moves it within a point, is inert. The not-measured phrase names the zone's parts, and a zone paragraph's own losses are named as a paragraph's.
…s number The page a zone's fragment is drawn on is on the fragment; parsing it out of the path could overflow. The zone report test sets a row's spacing through the call that is not deprecated.
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 page zone (
session.chrome().zone(...)) is written as one line of a Word header or footer (writeZoneLine).DocxNodeFieldLedgerTestlisted a page field'salign,paddingandmarginas gaps, and thezonesoption as a gap for a zone paragraph's alignment, spacing, direction, prefix, fitted size and outline entry, and a row's columns, gap and padding.What changed
reportZoneLinenames what the zone's line loses, in apage zonenote: "a footer written as one line of Word's footer; …". It runs where the zone is placed, so it fires once per zone in a section, however many of Word's headers or footers the zone is written into.The writer and the report share the line. Both take the parts from
zoneParts(content)and the right tab fromzoneRightTab(). A test pins the written footer to one right tab at the right margin.The parts that stand off where the page sets them are counted. The phrases:
How a part is tested.
DocxLayoutMetrics.zoneText), on the first page the zone is drawn on. The export builds the zone's content again, so it finds its nodes by the paths the layout gives a tree compiled on its own (pathsWithin).ParagraphLineGeometry). The baseline is seated as the PDF seats it (ParagraphSeating).ZONE_PLACE_CLEARANCE(1.5pt) off Word's;A zone paragraph's own losses are named (
zoneParagraphLost), each as "a paragraph's …", since a zone holds several:autoSizeLost,fittedSizeandlaysOutAPrefixtake the paragraph's lines rather than reading them by the body's paths, so a zone paragraph is measured from the zone's fragments.autoSizeor a prefix, as before.autoSizeLosttakes whose text it names.Ledger.
paddingandmarginmove from a gap toREPORTED: at its sides, and above and below beside other parts. A lone field's room above and below falls in thezonesgap.alignmoves toINERT: the page sets a field in a box a point wider than its number, which its alignment moves it no further within.zonesgap narrows to the line's height and the room its parts hold above and below their text, which Word sets its own way, and a zone paragraph's anchor, which gets no bookmark.CanvasLayerNode.height).Docs. These say what the note names:
render-docx/README.md;paragraphLost's Javadoc, the README and the CHANGELOG's paragraph entry no longer say a zone's paragraphs are not named.Verification
./mvnw -B -ntp install -pl :graph-compose-render-docx→ BUILD SUCCESS: 1091 tests, 0 failures, 1 skipped (the property-gated fidelity probe).DocxZoneReportTestis new, with 11 tests.verticalAlign);DocxFidelityCorpusTest -Dgraphcompose.docxFidelity=export, SHA-256 per file, 0 of 62 differ. No corpus document has a page zone, and the report's notes across the corpus stay at 950.-pl :graph-compose-core -Dtest='com.demcha.documentation.**'→ 166 tests, 0 failures;DocxPageZoneTest,DocxTransparentWrapperTest,TimelineRailAcrossBackendsTestandRtlAcrossBackendsTest→ 50 tests, 0 failures.Known limits
zonesgap records.zonesoption keeps them as its gap. A lone page field padded above or below stands that far off in Word, unnamed.Lane: render-docx backend (report only, no change to what is written) plus tests and docs.