ODPresentation Writer and Reader : Give a text box the insets, the wrap and the alignment it was told - #976
Open
dkulyk wants to merge 2 commits into
Open
ODPresentation Writer and Reader : Give a text box the insets, the wrap and the alignment it was told#976dkulyk wants to merge 2 commits into
dkulyk wants to merge 2 commits into
Conversation
dkulyk
force-pushed
the
fix/odp-textbox-frame
branch
4 times, most recently
from
September 8, 2026 08:41
dc553b3 to
f914167
Compare
…ap and the alignment it was told Six properties of a text box never reached the file. OpenDocument states the four insets as the padding of the frame, `fo:padding-left` and the three beside it; the vertical alignment as `draw:textarea-vertical-align`; and the wrap as `fo:wrap-option`, which was written as the literal `wrap` whatever the shape said. Nothing read any of the three back either, so a text box came back wearing the defaults it was born with. The PowerPoint2007 Writer writes all six. An inset is a float in pixels and the two defaults are 9.6 and 4.8, while `pixelsToCentimeters()` takes an int, so the conversion is spelled out rather than rounding the insets to whole pixels first. The padding is written to six decimals rather than the three the lengths beside it carry: a pixel is 127/4800 cm, so three decimals lose about a sixtieth of a pixel, and six put the common values in exactly -- the two defaults come out as `0.254cm` and `0.127cm`, which is what LibreOffice writes for them. `getName()` is missing from the same frame and is left alone: `loadShapeDescription()` falls back to `draw:name` for files written by older versions, so writing a text box's name there would come back as its description. `testTextColumnsRTLWritingModes()` replaced `fo:wrap-option` and `style:writing-mode` as one string. The two are no longer neighbours, so it replaces the writing mode alone.
dkulyk
force-pushed
the
fix/odp-textbox-frame
branch
2 times, most recently
from
September 8, 2026 18:50
f914167 to
55f32c0
Compare
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.
Description
Fixes #975
Six properties of a text box never reached the file, and none of them was read back. OpenDocument states the four insets as the padding of the frame,
fo:padding-leftand the three beside it; the vertical alignment asdraw:textarea-vertical-align; and the wrap asfo:wrap-option, which was written as the literalwrapwhatever the shape said. The PowerPoint2007 Writer writes all six.An inset is a float in pixels and the two defaults are 9.6 and 4.8, while
pixelsToCentimeters()takes an int, so the conversion is spelled out rather than rounding the insets to whole pixels first. The padding is written to six decimals rather than the three the lengths beside it carry: a pixel is 127/4800 cm, so three decimals lose about a sixtieth of a pixel, and six put the common values in exactly. The two defaults come out as0.254cmand0.127cm, which is what LibreOffice writes for them.getName()is missing from the same frame and is deliberately left alone:loadShapeDescription()falls back todraw:namefor files written by older versions, so writing a text box's name there would come back as its description. That is a separate decision.One existing test replaced
fo:wrap-optionandstyle:writing-modeas a single string; the two are no longer neighbours, so it replaces the writing mode alone.Found by walking every property of a shape through each Writer/Reader pair and diffing what came back; this closes six of the differences the ODP pair showed.
Checklist:
composer run-script check --timeout=0and no errors were reported