Repository navigation
fix(docx): anchor a timeline's dot in its own cell of the entry's row, and let a dot rise above its line - #853
Merged
Conversation
…, and let a dot rise above its line A drawing in a table cell went into that cell only when the cell held it across, and a dot set in a column of its own beside its entry's text had no paragraph to go to, so it stayed on the page. It now goes into the first paragraph of the cell of the same row that holds it, placed from the row's top: Word and LibreOffice start each top-aligned cell's first paragraph there, less its top margin. A drawing may also rise above its paragraph's top by its own height, 24pt at most, as a dot centred on the first line does; both editors place a negative offset exactly and draw the shape whole.
…ored in their own cell of the row
…raph, and start a neighbour cell at the row's top A rule placed 1pt above its paragraph in a contact row's cell moved that row's text 1.8pt in LibreOffice on Linux, though not in Word or LibreOffice on Windows. A drawing in a cell rises above its paragraph's top by a stroke's width at most again; the body keeps the rise by the drawing's height. A neighbour cell's first paragraph is placed at the paragraph's own top: Word and LibreOffice give every cell of a row the row's largest top margin, so the first paragraphs of a row start together. One with a border above it is not used. Tests cover the paragraph's own cell centred, a neighbour opening with a table, a cell with no width in twips stopping the walk, and a cell in a vertical merge leaving the drawing on the page.
…otocol's count for dots in their own cell
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
#852 anchors a DOCX's drawings in the paragraph whose text they stand beside, so they move when a reader edits the text above. Two cases still left most of the remaining shapes on the page:
CharcoalGold's entry is a row of five cells: date, gap, dot, gap, text. The dot's cell holds nothing but an empty paragraph. The nearest text is in the text's cell, which does not hold the dot across, so nothing took the dot and it stayed on the page. Among the shapes the export still left on the page, 247 were turned away by the nearest paragraph's cell.What changed
The cell of the same row (
DocxDrawingAnchors.Seat.place,inTheRow,openingPlace). When the nearest paragraph's cell does not hold a shape across, the cell of the same row that does takes it, in its first paragraph.tcW) from the paragraph's own cell. The walk stops at a cell with no width in twips rather than guess.DocxSemanticBackend.evenTheRowsMarginsrecords, so the first paragraphs of a row start together whatever margin a cell states.Rising above the paragraph's top.
FURTHEST_RISE), as a dot or an icon's disc centred on a line does. NavySidebar's 22.6pt badge is the largest such disc in the corpus.TealPulse's contact-row cell moved that row's phone number 1.8pt in LibreOffice on Linux. It did not move in Word or in LibreOffice on Windows.Topof −999997.Docs.
docs/recipes/docx-export.mdsays which cell takes a shape and how far it may rise.Verification
Editing protocol (Word 16.0.20430, the 35 corpus documents with drawings,
-Scenario drawings-follow-text):2.5-dev(fix(docx): anchor a drawing in the paragraph whose text it stands beside, so it moves with that text #852)54 more shapes are anchored in a paragraph than on
2.5-dev: 289 against 235.Where shapes stand, unedited. Matched by kind and size in the Word and LibreOffice PDFs of the corpus before fix(docx): anchor a drawing in the paragraph whose text it stands beside, so it moves with that text #852 and with this PR:
OrangeOps's header separator, as in fix(docx): anchor a drawing in the paragraph whose text it stands beside, so it moves with that text #852.Text fidelity. The Word, LibreOffice Windows and LibreOffice Linux gates pass, and every baseline is the same as on
2.5-dev: no line of text moves.Tests:
DocxDrawingAnchorsTest, 10 new tests:Three earlier tests now state the new limits.
Sabotage. Each rule fails its test when broken:
render-docx: 948 tests green.
Full reactor gate:
./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 (render-docx 948, qa 1820).CommittedAssetDriftTest3 / 3 green.Notes
TimelineMinimal's divider is one;Lane: shared-engine (render-docx).