[Libreoffice-commits] core.git: sc/qa sc/source

PriyankaGaikwad priyanka.gaikwad at synerzip.com
Fri Jan 8 09:45:53 PST 2016


 sc/qa/unit/data/xlsx/writingMode.xlsx |binary
 sc/qa/unit/subsequent_export-test.cxx |   15 ++++++++++++++-
 sc/source/filter/excel/xestyle.cxx    |    2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 01575244271cc7e0156e766b91750c4c147a0f8e
Author: PriyankaGaikwad <priyanka.gaikwad at synerzip.com>
Date:   Wed May 27 12:22:10 2015 +0530

    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

diff --git a/sc/qa/unit/data/xlsx/writingMode.xlsx b/sc/qa/unit/data/xlsx/writingMode.xlsx
new file mode 100644
index 0000000..3cf9512
Binary files /dev/null and b/sc/qa/unit/data/xlsx/writingMode.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 41c54ed..8aa8ca9 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 3f82655..9ea54b9 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 );
 }
 


More information about the Libreoffice-commits mailing list