tdf#85617: sc: Add unittest
Change-Id: I3baa89c210bf7bb44543e7b501986aae4ac9f270
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94358
Tested-by: Jenkins
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
diff --git a/sc/qa/unit/data/xlsx/tdf85617.xlsx b/sc/qa/unit/data/xlsx/tdf85617.xlsx
new file mode 100644
index 0000000..df515f2
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf85617.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index fe786fb..e56ebd2 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -244,6 +244,7 @@ public:
void testMergedCellsXLSXML();
void testBackgroundColorStandardXLSXML();
void testTdf131536();
void testTdf85617();
void testNamedExpressionsXLSXML();
void testEmptyRowsXLSXML();
void testBorderDirectionsXLSXML();
@@ -390,6 +391,7 @@ public:
CPPUNIT_TEST(testMergedCellsXLSXML);
CPPUNIT_TEST(testBackgroundColorStandardXLSXML);
CPPUNIT_TEST(testTdf131536);
CPPUNIT_TEST(testTdf85617);
CPPUNIT_TEST(testNamedExpressionsXLSXML);
CPPUNIT_TEST(testEmptyRowsXLSXML);
CPPUNIT_TEST(testBorderDirectionsXLSXML);
@@ -3833,7 +3835,7 @@ void ScFiltersTest::testBackgroundColorStandardXLSXML()
void ScFiltersTest::testTdf131536()
{
ScDocShellRef xDocSh = loadDoc("tdf131536.", FORMAT_XLSX);
CPPUNIT_ASSERT_MESSAGE("Failed to load named-exp-global.xml", xDocSh.is());
CPPUNIT_ASSERT_MESSAGE("Failed to load the document", xDocSh.is());
ScDocument& rDoc = xDocSh->GetDocument();
ScAddress aPos(3,9,0);
@@ -3847,6 +3849,17 @@ void ScFiltersTest::testTdf131536()
"=RIGHT(TEXT(INDEX($Comparison.$L:$Z,$Comparison.$A5,$Comparison.D$4),\"0\"),4))", nullptr);
}
void ScFiltersTest::testTdf85617()
{
ScDocShellRef xDocSh = loadDoc("tdf85617.", FORMAT_XLSX);
CPPUNIT_ASSERT_MESSAGE("Failed to load the document", xDocSh.is());
ScDocument& rDoc = xDocSh->GetDocument();
ScAddress aPos(2,2,0);
//Without the fix in place, it would be Err:509
CPPUNIT_ASSERT_EQUAL(4.5, rDoc.GetValue(aPos));
}
void ScFiltersTest::testNamedExpressionsXLSXML()
{
{