summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-03-15 20:38:19 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-03-15 21:47:05 +0100
commit034fa64b2becaf1b1eefa0a24d52808f30ce7c12 (patch)
tree4483a0db8cf9668d3302d245b7d5adabf0623831 /sc
parent304352d9df17ec5e9963c1b0d41c7f7cb951012e (diff)
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@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xlsx/tdf113271.xlsxbin0 -> 22831 bytes
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx25
2 files changed, 25 insertions, 0 deletions
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
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf113271.xlsx
Binary files 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);