summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml/xmlimpit.cxx
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2022-08-17 02:31:44 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-09-14 08:32:08 +0200
commitc70ee4a6b9071468255e5d4fdb893e9c9bdf4fad (patch)
tree1df672814e562a42f0da889acbc9789322a67685 /sw/source/filter/xml/xmlimpit.cxx
parentc97c60f70e9e6de594f7e0e0b85f17944c640dcf (diff)
tdf#149551 use 'WritingMode' instead of TextPreRotateAngle
Commit 7e23cbdbb6ec0247a29ed8a8f744c01e10963ea0 changed the code so, that TextPreRotateAngle is used to track ooxml vert attribute. This patch changes it so, that the style attribute WritingMode is used. Now text direction can be written in 'writing-mode' attribute in the graphic properties in ODF, same for shapes as for frames. The needed conversion from WritingMode BT-LR and TB_LR90 to TextPreRotateAngle for rendering of text in custom shapes is now in one place in class SdrObjectCustomshape. The shape edit engine cannot yet render it itself. Some unit tests are adapted to use WritingMode property instead of TextPreRotateAngle. The value text::WritingMode2::TB_RL90 is introduced, corresponding to vert='vert' and textDirection='tbRl' or ='rl' in OOXML. It is used for frames too, so that the original text direction is preserved and vert='eaVert' can be distinguished from vert='vert'. TextPreRotateAngle is currently still used in SmartArt import for 'upr' and 'grav' and in emulating 'upright' but no longer to emulate text direction. Change-Id: Idc4339bbfc3592fe90b154d75e2c404a1fa30856 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138813 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/filter/xml/xmlimpit.cxx')
-rw-r--r--sw/source/filter/xml/xmlimpit.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index 067ebc41fb90..b092fe85f8af 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -997,6 +997,13 @@ bool SvXMLImportItemMapper::PutXMLValue(
aAny <<= static_cast<sal_uInt16>(SvxFrameDirection::Vertical_LR_BT);
bOk = rItem.PutValue(aAny, 0);
}
+ else if (IsXMLToken(rValue, XML_TB_RL90))
+ {
+ // Read tb-rl90 from the extension namespace.
+ Any aAny;
+ aAny <<= static_cast<sal_uInt16>(SvxFrameDirection::Vertical_RL_TB90);
+ bOk = rItem.PutValue(aAny, 0);
+ }
else
{
std::unique_ptr<XMLPropertyHandler> pWritingModeHandler =