summaryrefslogtreecommitdiff
path: root/sc/qa/unit/subsequent_export-test.cxx
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2021-01-20 09:53:46 +0100
committerLászló Németh <nemeth@numbertext.org>2021-01-26 11:41:15 +0100
commit807a63d66010b1969cfbb61d3609b91909872399 (patch)
treea79be3ab14a404c15d7193a0fc26a6c871df5569 /sc/qa/unit/subsequent_export-test.cxx
parent80b360085f5974fbb3abe49a88b20f4d39704fb5 (diff)
tdf#139167 XLSX export: fix proliferation of conditional styles
Run-time created styles “ExtConditionalStyle_N N” for extended conditional styles were written back to the XLSX file, growing the cell style list by each save-reload with unused styles. Co-authored-by: Attila Szűcs (NISZ) Change-Id: Icccb9f5333311556132b760efd4e8c8c2db00858 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109667 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc/qa/unit/subsequent_export-test.cxx')
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 6c68d2b02183..972004c28431 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -89,6 +89,7 @@ public:
virtual void tearDown() override;
void test();
+ void testTdf139167();
void testTdf139394();
void testExtCondFormatXLSX();
void testTdf90104();
@@ -283,6 +284,7 @@ public:
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
+ CPPUNIT_TEST(testTdf139167);
CPPUNIT_TEST(testTdf139394);
CPPUNIT_TEST(testExtCondFormatXLSX);
CPPUNIT_TEST(testTdf90104);
@@ -525,6 +527,25 @@ void ScExportTest::test()
xDocSh->DoClose();
}
+void ScExportTest::testTdf139167()
+{
+ ScDocShellRef xShell = loadDoc(u"tdf139167.", 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:cellStyles", "count", "6");
+ assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:fill/x:patternFill/x:bgColor", "rgb",
+ "FFFFFF00");
+
+ xDocSh->DoClose();
+}
+
void ScExportTest::testTdf139394()
{
ScDocShellRef xShell = loadDoc(u"tdf139394.", FORMAT_XLSX);