How to write OOXML attribute 'vert' of <bodyPr> element to ODF?
Regina Henschel
rb.henschel at t-online.de
Thu Jun 16 12:49:45 UTC 2022
Hi all,
Currently the "vert" attribute of <bodyPr> element is connected to
TextPreRotateAngle property. vert="vert" produces TextPreRotateAngle=-90
and vert="vert270" produces TextPreRotateAngle=-270. When converting it
to ODF it produces draw:text-rotate-angle="-90" and
draw:text-rotate-angle="-270".
That approach does not work, because the ODF attribute
draw:text-rotate-angle produces a rotation of the text area rectangle,
same as the 'rot' attribute of element <bodyPr> in OOXML. Try with
attached file the export to ODF and reload to see the problem.
For using draw:text-rotate-angle attribute it would be necessary to
change the values of the draw:text-areas attribute in addition. But this
requires introducing additional equations and it conflicts with the
definitions of the predefined shapes of the presets.
My idea is to introduce a new loext:text-direction attribute of the
<draw:enhanced-geometry> element, which can carry each of the values of
the OOXML attribute 'vert'. "Each" needs to be discussed, perhaps better
to exclude values eaVert and mongolianVert, which in fact are writing
modes TB_RL and TB_LR. Possible values would be ("eaVert"), "horz",
("mongolianVert"), "vert", "vert270", "wordArtVert" and "wordArtVertRtl".
The CustomShapeGeometry property, which is a sequence, would get a new
property "TextDirection". Import from OOXML or from ODF-extended would
put the value into it without any rotate-angle calculations. Evaluation
of the attribute would be at rendering time in
ViewContactOfSdrObjCustomShape::createViewIndependentPrimitive2DSequence().
The current used attribute TextPreRotateAngle would be removed.
Currently it can be used in the CustomShapeGeometry sequence via macro,
but is not published in the API and has no UI.
Currently we have a confusion of attribute 'vert' and attribute 'rot'
resulting in bug 124437 (assigning the angle of the 'rot' attribute to
TextPreRotateAngle, which produces sheared text) and bug 127457 (value
of attribute 'vert' overwrites value of 'rot'). Therefore I prefer an
enum (or constants in API or string?) so that such errors cannot happen.
What do you think?
Kind regards,
Regina
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vert270.pptx
Type: application/octet-stream
Size: 15511 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20220616/5b51a779/attachment.obj>
More information about the LibreOffice
mailing list