diff options
author | Mark Hung <marklh9@gmail.com> | 2019-12-13 07:23:35 +0800 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-01-14 10:23:19 +0100 |
commit | b203b9c83d0000c8465dcd92fb6b029a2f28c724 (patch) | |
tree | 2751e971109a27bff316611a8a3568b9c140455b /sw | |
parent | 1dd9200be9f167dc802b04529a54604691fe050e (diff) |
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 <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf128304.odt | bin | 0 -> 15138 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 29 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 2 |
3 files changed, 25 insertions, 6 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf128304.odt b/sw/qa/extras/ooxmlexport/data/tdf128304.odt Binary files differnew file mode 100644 index 000000000000..6c5cbd1200aa --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf128304.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 18e957bbcb09..81687683ec63 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -11,6 +11,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/style/LineSpacing.hpp> +#include <com/sun/star/text/WritingMode.hpp> #include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/text/XTextFrame.hpp> #include <com/sun/star/drawing/XControlShape.hpp> @@ -639,12 +640,10 @@ DECLARE_OOXMLEXPORT_TEST(testTbrlFrameVml, "tbrl-frame-vml.docx") if (mbExported) { - // DML import: creates a TextBox. + // DML import: creates a TextBox, eaVert read back as TB_RL in TextWritingMode - comphelper::SequenceAsHashMap aGeometry(xTextFrame->getPropertyValue("CustomShapeGeometry")); - // Without the accompanying fix in place, this test would have failed with 'Expected: -90; - // Actual: 0', i.e. the tblr writing mode was lost during DML export of a TextFrame. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-90), aGeometry["TextPreRotateAngle"].get<sal_Int32>()); + auto eMode = getProperty<text::WritingMode>(xTextFrame, "TextWritingMode"); + CPPUNIT_ASSERT_EQUAL(text::WritingMode::WritingMode_TB_RL, eMode); } else { @@ -993,6 +992,26 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127579, "tdf127579.odt") assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", "InternetLink"); } +DECLARE_OOXMLEXPORT_TEST(testTdf128304, "tdf128304.odt") +{ + css::text::WritingMode eMode; + uno::Reference<beans::XPropertySet> xProps1(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xProps1->getPropertyValue("TextWritingMode") >>= eMode); + CPPUNIT_ASSERT_EQUAL(css::text::WritingMode::WritingMode_TB_RL, eMode); + + uno::Reference<beans::XPropertySet> xProps2(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT(xProps1->getPropertyValue("TextWritingMode") >>= eMode); + CPPUNIT_ASSERT_EQUAL(css::text::WritingMode::WritingMode_TB_RL, eMode); + + uno::Reference<beans::XPropertySet> xProps3(getShape(3), uno::UNO_QUERY); + CPPUNIT_ASSERT(xProps1->getPropertyValue("TextWritingMode") >>= eMode); + CPPUNIT_ASSERT_EQUAL(css::text::WritingMode::WritingMode_TB_RL, eMode); + + uno::Reference<beans::XPropertySet> xProps4(getShape(4), uno::UNO_QUERY); + CPPUNIT_ASSERT(xProps1->getPropertyValue("TextWritingMode") >>= eMode); + CPPUNIT_ASSERT_EQUAL(css::text::WritingMode::WritingMode_TB_RL, eMode); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 005e50ba5634..8ab399a46fe3 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -1359,7 +1359,7 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho const SvxFrameDirectionItem& rDirection = rFrameFormat.GetFrameDir(); if (rDirection.GetValue() == SvxFrameDirection::Vertical_RL_TB) - m_pImpl->getBodyPrAttrList()->add(XML_vert, "vert"); + m_pImpl->getBodyPrAttrList()->add(XML_vert, "eaVert"); else if (rDirection.GetValue() == SvxFrameDirection::Vertical_LR_BT) m_pImpl->getBodyPrAttrList()->add(XML_vert, "vert270"); |