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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 15 20:47:44 UTC 2021


 sc/qa/unit/data/xlsx/tdf113271.xlsx   |binary
 sc/qa/unit/subsequent_export-test.cxx |   25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+)

New commits:
commit 034fa64b2becaf1b1eefa0a24d52808f30ce7c12
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Mar 15 20:38:19 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Mar 15 21:47:05 2021 +0100

    tdf#113271: sc_subsequent_export: Add unittest
    
    Change-Id: I92b9184cc36dcfedec40a74b6dbcee1c2583ebf6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112540
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/unit/data/xlsx/tdf113271.xlsx b/sc/qa/unit/data/xlsx/tdf113271.xlsx
new file mode 100644
index 000000000000..49a161458959
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf113271.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index b0f390206129..204889815292 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -90,6 +90,7 @@ public:
 
     void test();
     void testTdf139167();
+    void testTdf113271();
     void testTdf139394();
     void testExtCondFormatXLSX();
     void testTdf90104();
@@ -289,6 +290,7 @@ public:
     CPPUNIT_TEST_SUITE(ScExportTest);
     CPPUNIT_TEST(test);
     CPPUNIT_TEST(testTdf139167);
+    CPPUNIT_TEST(testTdf113271);
     CPPUNIT_TEST(testTdf139394);
     CPPUNIT_TEST(testExtCondFormatXLSX);
     CPPUNIT_TEST(testTdf90104);
@@ -553,6 +555,29 @@ void ScExportTest::testTdf139167()
     xDocSh->DoClose();
 }
 
+void ScExportTest::testTdf113271()
+{
+    ScDocShellRef xShell = loadDoc(u"tdf113271.", FORMAT_XLSX);
+    CPPUNIT_ASSERT(xShell.is());
+
+    ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_XLSX);
+    CPPUNIT_ASSERT(xDocSh.is());
+
+    std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xDocSh), FORMAT_XLSX);
+    xmlDocUniquePtr pDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/styles.xml");
+    CPPUNIT_ASSERT(pDoc);
+
+    assertXPath(pDoc, "/x:styleSheet/x:fonts", "count", "6");
+
+    // Without the fix in place, this test would have failed with
+    // - Expected: FF000000
+    // - Actual  : FFFFFFFF
+    assertXPath(pDoc, "/x:styleSheet/x:fonts/x:font[1]/x:color", "rgb", "FF000000");
+    assertXPath(pDoc, "/x:styleSheet/x:fonts/x:font[1]/x:name", "val", "Calibri");
+
+    xDocSh->DoClose();
+}
+
 void ScExportTest::testTdf139394()
 {
     ScDocShellRef xShell = loadDoc(u"tdf139394.", FORMAT_XLSX);


More information about the Libreoffice-commits mailing list