tdf#41722: Add unittest
Change-Id: I95ff8794addcce6a73d32f49222adffd7d824255
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92090
Tested-by: Jenkins
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
diff --git a/sc/qa/unit/data/xlsx/tdf41722.xlsx b/sc/qa/unit/data/xlsx/tdf41722.xlsx
new file mode 100644
index 0000000..9ec800e
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf41722.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 2c8940b..b75189f 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -204,6 +204,7 @@ public:
void testHeaderImageODS();
void testTdf88657ODS();
void testTdf41722();
void testEscapeCharInNumberFormatXLSX();
void testNatNumInNumberFormatXLSX();
void testExponentWithoutSignFormatXLSX();
@@ -343,6 +344,7 @@ public:
CPPUNIT_TEST(testHeaderImageODS);
CPPUNIT_TEST(testTdf88657ODS);
CPPUNIT_TEST(testTdf41722);
CPPUNIT_TEST(testEscapeCharInNumberFormatXLSX);
CPPUNIT_TEST(testNatNumInNumberFormatXLSX);
CPPUNIT_TEST(testExponentWithoutSignFormatXLSX);
@@ -4153,6 +4155,21 @@ void ScExportTest::testConditionalFormatOriginXLSX()
xDocSh->DoClose();
}
void ScExportTest::testTdf41722()
{
ScDocShellRef xDocSh = loadDoc("tdf41722.", FORMAT_XLSX);
CPPUNIT_ASSERT(xDocSh.is());
xmlDocPtr pDoc = XPathHelper::parseExport2(*this, *xDocSh, m_xSFactory, "xl/worksheets/sheet1.xml", FORMAT_XLSX);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "//x:conditionalFormatting/x:cfRule[1]", "operator", "containsText");
assertXPath(pDoc, "//x:conditionalFormatting/x:cfRule[2]", "operator", "containsText");
assertXPath(pDoc, "//x:conditionalFormatting/x:cfRule[3]", "operator", "containsText");
xDocSh->DoClose();
}
void ScExportTest::testEscapeCharInNumberFormatXLSX()
{
ScDocShellRef xDocSh = loadDoc("tdf81939.", FORMAT_XLSX);