Repository navigation
fix(docx): give a hanging list's top level the page's marker column, text markers too - #836
Merged
Merged
Conversation
… and size Word draws a level's marker in the paragraph mark's style, and an item at an exact line leaves its mark the document's: a list set smaller than the body would get a bullet wider than the column measured for it. The level now names the list's face and size. A nesting list keeps its space at the top level on the paragraph path too, for a drawn marker and for rich items; tests pin both. The Linux LibreOffice baseline is this branch's CI measure, and the docs state the embedding condition the column relies on.
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 placed list items in two ways.
Either way, an item's wrapped lines came back under its marker, while the page hangs them at the text.
Panel's skills stood 7.8pt left of the page's on their second lines in both editors.That had been a recorded decision ("
hangingIndentchanges nothing in DOCX", pinned byDocxHangingIndentIsIgnoredTest). It rested on the export not knowing the marker's width as Word sets it. Two things have changed:What changed
For the top level of a
hangingIndent(true)list that does not nest,DocxSemanticBackendtakes the layout's marker column: the marker's width andmarkerGap, fromDocxLayoutMetrics.markerToText(list, letters). A text marker's fragment is found by its letters.numberingForsets level 0's indent and hanging to that column, and names the list's face and size in the level'sw:rPr. Word draws a level's marker in the paragraph mark's style, and an item at an exact line leaves its mark the document's. Without that, a list set smaller than the body would get a bullet wider than the one its column was measured against.indentListItemInsideuses the same column when a container's inset putsw:indon the paragraph.writeRichListLinewrites the marker, a tab, andhangFrom(): left = start + column, hanging = column, with a left stop there. This covers rich items, drawn markers, and now plain items too, routed viasetInAColumn. Picture markers from fix(docx): start a picture-marked list item's text where the page does, a tab past the marker and its gap #835 now hang as well.markerWidth × wordsSize(size)/sizeand needs 0.5pt clear (MARKER_TEXT_CLEARANCE);nests) keeps the stated columns at every level. Only level 0 is measured, and a nested level kept stated could stand left of its parent's text past a 10pt gap;DocxListHangingIndentTestand holds the new rule.ListBuilder.hangingIndent/markerGapJavadoc (core; no signature change), both recipes, the capability matrix and CHANGELOG are updated.Verification
scripts/docx-visual/word-fidelity.ps1(Word 16.0.20430) → BUILD SUCCESS, baseline rewritten with-Update.Panel(4 lines) andSerifHeadline(2) moved, all across: from −7.76 / +2.25pt to within 0.04pt.docx-fidelity-37164256524):Panel4 andSerifHeadline2 lines moved; lines past 2pt across: 388 → 382.Panel's nesting projects list keeps its lines where they are on2.5-dev: 7 at −7.75pt and 3 at −3.17pt across in Word.DocxListMarkerGapTest: 13 tests, 7 of them new —DocxListHangingIndentTest(was…IsIgnoredTest):DocxSemanticBackendTest: the rich-list tests expect the tab and the same runs otherwise../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 -am→ BUILD SUCCESS (qa 1820 tests).CommittedAssetDriftTestinexamples→ 3/3 green.Notes
Lane: shared-engine (render-docx), with a Javadoc correction in core.