From b203b9c83d0000c8465dcd92fb6b029a2f28c724 Mon Sep 17 00:00:00 2001 From: Mark Hung Date: Fri, 13 Dec 2019 07:23:35 +0800 Subject: tdf#128304 export TB_RL writing mode as eaVirt and import eaVirt to TextWritingMode instead of TextPreRotateAngle (-90) degree of CustomShapeGeometry. CJK text in TB_RL writing mode are upright in Writer. It corresponds to eaVirt by its defintion. Change-Id: I2a8bc6676ad6af06b06e023adaa2f201a028d426 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86637 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- oox/source/export/drawingml.cxx | 2 +- oox/source/shape/WpsContext.cxx | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'oox') diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 087c51da5541..8c9f641b5d4f 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2692,7 +2692,7 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin if( ( mAny >>= eMode ) && eMode == WritingMode_TB_RL ) { - sWritingMode = "vert"; + sWritingMode = "eaVert"; bVertical = true; } } diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index cf637eae0606..863621b3931c 100644 --- a/oox/source/shape/WpsContext.cxx +++ b/oox/source/shape/WpsContext.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -57,7 +58,12 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken uno::Reference xServiceInfo(mxShape, uno::UNO_QUERY); uno::Reference xPropertySet(mxShape, uno::UNO_QUERY); sal_Int32 nVert = rAttribs.getToken(XML_vert, XML_horz); - if (nVert != XML_horz) + if (nVert == XML_eaVert) + { + xPropertySet->setPropertyValue("TextWritingMode", + uno::makeAny(text::WritingMode_TB_RL)); + } + else if (nVert != XML_horz) { // Get the existing rotation of the shape. drawing::HomogenMatrix3 aMatrix; -- cgit