fix(docx): hide the empty paragraph closing a cell that ends in a nested table - #801
Merged
Merged
Conversation
… the text that takes a closer over
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
Word ends a table cell on a paragraph, so the export closes every table nested in a cell with a hairline one, 2 twips tall (
newTable).CobaltRota.CobaltRotahas a chip in a table in a table in each cell, so every row stood up to 0.3pt taller there than on the page.What changed
hideTheCellClosingMarks. After the whole document is written, every table cell is checked, nested tables included. Where a cell ends in a paragraph right after a table, and that paragraph is still the bare hairline, its mark is hidden (w:vanish), so it is not laid out. The bare hairline means:A hairline holding the space under the table keeps its mark, since that space would go with it.
structureAlone/hide. Extracted fromhideTheClosingMark, which hides the paragraph closing a document that ends in a table, so both passes share the rule.Docs.
CHANGELOG.md, the composed-cells row ofdocs/recipes/docx-export.md, and the table row ofdocs/architecture/backend-capability-matrix.md.Verification
./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 -amgives BUILD SUCCESS (1791 + 127 tests).DocxPanelHeightTest(+5).2.5-dev: 33 documents change. Word renders all 33 as before. The page count stays the same in both editors, and no median drift in LibreOffice moves by more than 0.2pt.CobaltRotain LibreOffice: p90 drift 3.86pt → 2.91. Its last row stands 3.5pt low instead of 5.2.InvoiceMetered,InvoiceWorkspace,InvoicePayments,InvoiceSubscription,ReceiptModern.EngineeringResume,TealPulse,MerchantInvoice,ProposalIndigo,ObsidianInvoice.Known limits
CobaltRotadoes not come from these paragraphs and is unchanged.Lane: shared-engine (render-docx). No public API change.