diff options
-rw-r--r-- | sc/qa/unit/data/xlsx/writingMode.xlsx | bin | 0 -> 9485 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 15 | ||||
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 2 |
3 files changed, 15 insertions, 2 deletions
diff --git a/sc/qa/unit/data/xlsx/writingMode.xlsx b/sc/qa/unit/data/xlsx/writingMode.xlsx Binary files differnew file mode 100644 index 000000000000..3cf95125785d --- /dev/null +++ b/sc/qa/unit/data/xlsx/writingMode.xlsx diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 41c54edd0e27..8aa8ca918508 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -155,6 +155,7 @@ public: void testMoveCellAnchoredShapes(); void testMatrixMultiplication(); void testPreserveTextWhitespaceXLSX(); + void testTextDirection(); void testRefStringXLSX(); void testRefStringConfigXLSX(); @@ -221,6 +222,7 @@ public: CPPUNIT_TEST(testHyperlinkXLSX); CPPUNIT_TEST(testMoveCellAnchoredShapes); CPPUNIT_TEST(testMatrixMultiplication); + CPPUNIT_TEST(testTextDirection); CPPUNIT_TEST(testRefStringXLSX); CPPUNIT_TEST(testRefStringConfigXLSX); @@ -2988,7 +2990,6 @@ void ScExportTest::testMatrixMultiplication() xDocSh->DoClose(); } - void ScExportTest::testRefStringXLSX() { ScDocShellRef xDocSh = loadDoc("ref_string.", FORMAT_XLSX); @@ -3088,6 +3089,18 @@ void ScExportTest::testHeaderImage() CPPUNIT_ASSERT(aURL.startsWith("vnd.sun.star.GraphicObject:")); } +void ScExportTest::testTextDirection() +{ + ScDocShellRef xDocSh = loadDoc("writingMode.", FORMAT_XLSX); + CPPUNIT_ASSERT(xDocSh.Is()); + + xmlDocPtr pDoc = XPathHelper::parseExport(&(*xDocSh), m_xSFactory, "xl/styles.xml", FORMAT_XLSX); + CPPUNIT_ASSERT(pDoc); + + assertXPath(pDoc, "/x:styleSheet/x:cellXfs/x:xf[2]/x:alignment", "readingOrder", "1");//LTR + assertXPath(pDoc, "/x:styleSheet/x:cellXfs/x:xf[3]/x:alignment", "readingOrder", "2");//RTL +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 3f826554411e..9ea54b935d7a 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1621,7 +1621,7 @@ void XclExpCellAlign::SaveXml( XclExpXmlStream& rStrm ) const // OOXTODO: XML_relativeIndent, mnIndent? // OOXTODO: XML_justifyLastLine, XML_shrinkToFit, XclXmlUtils::ToPsz( mbShrink ), - // OOXTODO: XML_readingOrder, + XML_readingOrder, mnTextDir == EXC_XF_TEXTDIR_CONTEXT ? NULL : OString::number( mnTextDir ).getStr(), FSEND ); } |