Repository navigation
fix(docx): say a shape container's layers are written inline only where they are - #903
Merged
Merged
Conversation
…re they are Every shape container not written as a panel was noted "its layers are written inline, one after another in source order", whatever it held. A tile, an icon or a badge holding its glyph writes nothing in the flow: each layer is drawn where the page draws it, and nothing of its layering is lost. The note is now written after the layers, where one of them was written in the flow, and for a band, which always writes its text. A chip whose text moves into an earlier layer's stand-in keeps the note, and the once-per-export fallback warning is logged with it.
… order A drawing-only shape container whose layers the page stacks by their z-index in another order than they are given is drawn in the order given: a dot laid under a disc comes out over it. Its note stays, and the once-per-export fallback warning is logged where it was, before the layers, so a container whose clip cuts still logs it. The stand-in test now checks its premise, the subtitle written under the name in the strip; the drawing test counts its seven drawings.
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
Every shape container not written as a panel got the report note
APPROXIMATED"its layers are written inline, one after another in source order", whatever it held. It was the most frequent note in the corpus (186 of 1332). It is true of a container holding text or an inline picture, which the export writes in the flow, one layer after another, rather than over its outline. It is false of a container whose layers are all drawing — a tile, an icon, a badge holding its glyph — since each of those layers is drawn where the page draws it and nothing is written in the flow.Measured on the corpus, by what each noted container holds:
ShapeNode, a stack ofPaths, an ellipse)What changed
writeShapeContainerno longer notes the container before its layers. The note (reportLayersWrittenInline) is written:blocksWrittengrew, the counter that already decides whether the container's edges are space in the flow;holdsMovedContent), where it is written in the flow though the container's own layer writes nothing;paintsOutOfSourceOrder, againstinPaintOrder): the export draws them in the order given, so a dot laid under a disc comes out over it;writeOverlayBand).blocksWrittencounts every paragraph and tablenewBodyParagraph/newTablemakes, a table cell's included, so a container holding text in a composed cell keeps its note.docx.export.shape-container-fallbackwarning stays where it was, so a container whose clip cuts still logs it.ShapeContainerNode.layerssay where the note is written.Verification
2.5-dev's, since only the report changes. Notes go from 1332 to 1246; the 86 gone are exactly the three "nothing" rows above, and no note is added.DocxDrawingsTest.aContainerWhoseLayersAreAllDrawnIsNotSaidToWriteThemInlineexports four containers: a tile in a layer stack, a tile composed in a table cell, a text container and a header band beside its badge. It asserts the seven drawings are written and that exactly the text container and the band carry the note; with the note written for every container, the stack's tile, the band's badge and the cell's tile get it too.DocxStandInMoveTest.aShapeContainerWhoseTextMovesIntoAStandInIsStillSaidToWriteItsLayersInlinehas a chip taller than the stand-in, whose subtitle moves into the strip under the name, the premise it checks. The chip keeps its note.DocxDrawingsTest.aContainerWhoseLayersThePageStacksInAnotherOrderIsStillNamedhas a disc over a dot by z-index, given the other way round. The container keeps its note.DocxClipReportTest.aPhotoFillingItsCircleIsCroppedToItstill pins the note on a photo written in the flow../mvnw -B -ntp clean verify→ BUILD SUCCESS (render-docx 1584, qa 1820).Lane: render-docx — report notes only; the Word file is unchanged