summaryrefslogtreecommitdiff
path: root/xmloff/source/style/xmlexppr.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 /xmloff/source/style/xmlexppr.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 'xmloff/source/style/xmlexppr.cxx')
-rw-r--r--xmloff/source/style/xmlexppr.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index 412b578c42a9..d2088cfea601 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -938,7 +938,8 @@ namespace
sal_Int8 CheckExtendedNamespace(std::u16string_view sXMLAttributeName, std::u16string_view sValue,
const SvtSaveOptions::ODFSaneDefaultVersion nODFVersion)
{
- if (IsXMLToken(sXMLAttributeName, XML_WRITING_MODE) && IsXMLToken(sValue, XML_BT_LR))
+ if (IsXMLToken(sXMLAttributeName, XML_WRITING_MODE)
+ && (IsXMLToken(sValue, XML_BT_LR) || IsXMLToken(sValue, XML_TB_RL90)))
return nODFVersion & SvtSaveOptions::ODFSVER_EXTENDED ? 1 : -1;
else if (IsXMLToken(sXMLAttributeName, XML_VERTICAL_REL)
&& (IsXMLToken(sValue, XML_PAGE_CONTENT_BOTTOM)