Repository navigation
fix(docx): hold a row's auto column's editor point in the gap after it - #948
Merged
Merged
Conversation
- A row column sized to its content is given a point for an editor's face. It came out of the row's weight columns and moved what stood right of it a point right: ReceiptModern's leaders and EditorialProposal's signature lines started 0.9 to 1pt right of the page's in Word. - The column already holds the next child's left margin, and a paragraph's own right side gives what the paragraph does not write as an indent (writtenSides, now shared with writeParagraph). A paragraph set left takes what that leaves from the gap after its column, which then stands where the page sets it. - What neither holds still comes out of the weight columns, and the row is named (right end) unless they hold only spacers or it is under a tenth of a point: ReceiptModern's amounts at the row's end and VioletGrid's section heading rules, among twenty rows nothing named before. - A rule in a row's column counts its left margin once. Counted again, CharcoalGold's heading rules started 9.25pt right of the page's in Word and VioletGrid's credential ones 12.3pt. - Measured on Windows, in Word: leaders within 0.06pt, signature lines within 0.18pt, credential rules within 0.07pt; no word moves in Word or LibreOffice. - Tests: the gap holding the point, the last column taking it from the weight column, a neighbour's margin and a paragraph's own right side as room, a thin gap, a section and a centred paragraph, the row's padding, a spacer, a tenth of a point, and a rule's margin in a row's column.
DemchaAV
marked this pull request as draft
October 23, 2026 10:06
- A row cell holds a paragraph's side at its text, so a right margin below zero gives an auto column no room: counted, a label pulled 2pt into a neighbour's 2pt margin got no point. - writtenSides names its paragraph and says a cell holds a side below zero at its text. - The rule test checks the right end of a rule in a row's column too. - The CHANGELOG, the recipe and the javadoc give ReceiptModern's amounts as measured on all eight rows, 0.84 to 1.1pt left in Word and 0.86 to 1.02pt in LibreOffice, and the leaders and signature lines 0.88 to 1.04pt right before. The CHANGELOG says no line breaks differently or moves down, and no word moves across by more than 0.4pt.
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 row column sized to its content (
DocumentRowColumn.auto()) is given a point of slack (EDITOR_COLUMN_SLACK_POINTS). An editor setting its text in its own face would otherwise wrap it: a table of contents' label broke mid-word in LibreOffice without it.withRowEditorSlackalways took that point out of the row's weight columns. The auto column was written a point wider, and whatever stood right of it moved a point right. Nothing named it.A rule in a placed row's column also counted its left margin twice. The column already starts past the child's margin (
leftMarginInCell), andwriteRuleadded it again as the rule's indent.Measured on Windows, in Word:
ReceiptModern's 8 leadersEditorialProposal's 3 signature linesVioletGrid's credential heading rulesCharcoalGold's heading rulesWhat changed
withRowEditorSlackcounts the room an auto column already has (roomInItsColumn):CharcoalGold's heading words have the 9pt their rule stands in by, and take no point at all.EDITOR_SLACK_POINTS). A side a margin below zero pulls out stands at the cell's text, so it counts as nothing. The arithmetic is now one helper,writtenSides, shared withwriteParagraph.withoutTheRowsPadding).right end). The note is skipped where the weight columns giving it hold only spacers, or the remainder is under a tenth of a point. Twenty corpus rows are named that nothing named before:ReceiptModern's amounts at the row's end, 0.84 to 1.1pt left in Word and 0.86 to 1.02pt in LibreOffice;VioletGrid's section heading rules, a point right;SerifHeadline's section headings, Orange Ops' contact strip and Subscription's masthead.writeRulecounts a rule's left margin once in a placed row's column.ROW_AUTO_ROOM).Verification
DocxEditorSlackTest(+10 new, 3 updated):DocxRuleTest(+1): a rule with a 9pt margin in a row's column starts and ends at Word's reach in from its cell's text.VioletGrid's credential rules within 0.07pt.CharcoalGold's heading rules stand with their words, which stand 0.7pt left in both editors.EditorialProposal's "Date:" stands 0.17pt right of the page's in Word, where it stood 0.19pt left.cv-charcoal_gold,cv-violet_grid,proposal-editorial,receipt-modern). Notes go from 1365 to 1385../mvnw -B -ntp clean verify -pl <core, render-pdf, render-docx, render-pptx, templates, testing, qa, coverage> -am→ BUILD SUCCESS: core 821, render-pdf 339, render-docx 2083, testing 5, render-pptx 142, templates 127, qa 1828../mvnw -f examples/pom.xml test→ BUILD SUCCESS, 93 tests. The committedword-export-companion.docxdoes not change.Notes for review:
Lane: shared-engine (render-docx): no public API change.