summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2019-12-13 07:23:35 +0800
committerMiklos Vajna <vmiklos@collabora.com>2020-01-17 17:17:42 +0100
commit598ea01b91a1b4e96c24e70089a63dcd35b29f1b (patch)
tree564706693c2392983b72d7827289a2820844c30f /sw
parentbc47eabad3f593aedd71307334fa50b222604bdd (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> Signed-off-by: xisco <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86960
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf128304.odtbin0 -> 15138 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx29
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx2
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
new file mode 100644
index 000000000000..6c5cbd1200aa
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf128304.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 6a40ce994253..ee5b55b00139 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -10,6 +10,7 @@
#include <swmodeltestbase.hxx>
#include <com/sun/star/beans/XPropertySet.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>
@@ -554,12 +555,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
{
@@ -908,6 +907,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 8cc14d097fa0..b8329e9eb299 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");