tdf#58122 FILESAVE: XLSX - Cell RTL direction state not saved
Current behavior: The direction of the sheet is set to default from left to right Expected behavior: The action of changing the direction from left to right to become from right to left Solution: Added export for text writting direction. Now <alignment readingorder="2"> export properly Change-Id: I0a49ba0e458cbd6a7feae8e205ae583b7da30d0b
This commit is contained in:
committed by
Markus Mohrhard
parent
0aa5414015
commit
0157524427
BIN
sc/qa/unit/data/xlsx/writingMode.xlsx
Normal file
BIN
sc/qa/unit/data/xlsx/writingMode.xlsx
Normal file
Binary file not shown.
@@ -155,6 +155,7 @@ public:
|
|||||||
void testMoveCellAnchoredShapes();
|
void testMoveCellAnchoredShapes();
|
||||||
void testMatrixMultiplication();
|
void testMatrixMultiplication();
|
||||||
void testPreserveTextWhitespaceXLSX();
|
void testPreserveTextWhitespaceXLSX();
|
||||||
|
void testTextDirection();
|
||||||
|
|
||||||
void testRefStringXLSX();
|
void testRefStringXLSX();
|
||||||
void testRefStringConfigXLSX();
|
void testRefStringConfigXLSX();
|
||||||
@@ -221,6 +222,7 @@ public:
|
|||||||
CPPUNIT_TEST(testHyperlinkXLSX);
|
CPPUNIT_TEST(testHyperlinkXLSX);
|
||||||
CPPUNIT_TEST(testMoveCellAnchoredShapes);
|
CPPUNIT_TEST(testMoveCellAnchoredShapes);
|
||||||
CPPUNIT_TEST(testMatrixMultiplication);
|
CPPUNIT_TEST(testMatrixMultiplication);
|
||||||
|
CPPUNIT_TEST(testTextDirection);
|
||||||
|
|
||||||
CPPUNIT_TEST(testRefStringXLSX);
|
CPPUNIT_TEST(testRefStringXLSX);
|
||||||
CPPUNIT_TEST(testRefStringConfigXLSX);
|
CPPUNIT_TEST(testRefStringConfigXLSX);
|
||||||
@@ -2988,7 +2990,6 @@ void ScExportTest::testMatrixMultiplication()
|
|||||||
xDocSh->DoClose();
|
xDocSh->DoClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScExportTest::testRefStringXLSX()
|
void ScExportTest::testRefStringXLSX()
|
||||||
{
|
{
|
||||||
ScDocShellRef xDocSh = loadDoc("ref_string.", FORMAT_XLSX);
|
ScDocShellRef xDocSh = loadDoc("ref_string.", FORMAT_XLSX);
|
||||||
@@ -3088,6 +3089,18 @@ void ScExportTest::testHeaderImage()
|
|||||||
CPPUNIT_ASSERT(aURL.startsWith("vnd.sun.star.GraphicObject:"));
|
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_TEST_SUITE_REGISTRATION(ScExportTest);
|
||||||
|
|
||||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
@@ -1621,7 +1621,7 @@ void XclExpCellAlign::SaveXml( XclExpXmlStream& rStrm ) const
|
|||||||
// OOXTODO: XML_relativeIndent, mnIndent?
|
// OOXTODO: XML_relativeIndent, mnIndent?
|
||||||
// OOXTODO: XML_justifyLastLine,
|
// OOXTODO: XML_justifyLastLine,
|
||||||
XML_shrinkToFit, XclXmlUtils::ToPsz( mbShrink ),
|
XML_shrinkToFit, XclXmlUtils::ToPsz( mbShrink ),
|
||||||
// OOXTODO: XML_readingOrder,
|
XML_readingOrder, mnTextDir == EXC_XF_TEXTDIR_CONTEXT ? NULL : OString::number( mnTextDir ).getStr(),
|
||||||
FSEND );
|
FSEND );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user