tdf#127982: sc: Add unittest
Change-Id: I6fc4299012db9094ceec3c8146bfef317c93e3cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97259
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sc/qa/unit/data/ods/tdf127982.ods b/sc/qa/unit/data/ods/tdf127982.ods
new file mode 100644
index 0000000..d075522
--- /dev/null
+++ b/sc/qa/unit/data/ods/tdf127982.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 35b4907..09d2890 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -225,6 +225,7 @@ public:
void testBnc762542();
void testTdf100458();
void testTdf127982();
void testTdf100709XLSX();
void testTdf97598XLSX();
void testTdf110440XLSX();
@@ -378,6 +379,7 @@ public:
CPPUNIT_TEST(testHiddenSheetsXLSX);
CPPUNIT_TEST(testTdf100458);
CPPUNIT_TEST(testTdf127982);
CPPUNIT_TEST(testTdf100709XLSX);
CPPUNIT_TEST(testTdf97598XLSX);
CPPUNIT_TEST(testTdf110440XLSX);
@@ -3724,6 +3726,29 @@ void ScFiltersTest::testTdf100458()
xDocSh->DoClose();
}
void ScFiltersTest::testTdf127982()
{
ScDocShellRef xDocSh = loadDoc("tdf127982.", FORMAT_ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is());
ScDocument& rDoc = xDocSh->GetDocument();
// Without the fix in place, these cells would be empty
CPPUNIT_ASSERT_EQUAL(OUString("R1"), rDoc.GetString(ScAddress(3,5,0)));
CPPUNIT_ASSERT_EQUAL(OUString("R6"), rDoc.GetString(ScAddress(3,6,0)));
CPPUNIT_ASSERT_EQUAL(OUString("R7"), rDoc.GetString(ScAddress(3,7,0)));
CPPUNIT_ASSERT_EQUAL(OUString("R1"), rDoc.GetString(ScAddress(4,5,0)));
CPPUNIT_ASSERT_EQUAL(OUString("R6"), rDoc.GetString(ScAddress(4,6,0)));
CPPUNIT_ASSERT_EQUAL(OUString("R7"), rDoc.GetString(ScAddress(4,7,0)));
// Without the fix in place, these cells would be empty
CPPUNIT_ASSERT_EQUAL(OUString("R1"), rDoc.GetString(ScAddress(4,5,0)));
CPPUNIT_ASSERT_EQUAL(OUString("R6"), rDoc.GetString(ScAddress(4,6,0)));
CPPUNIT_ASSERT_EQUAL(OUString("R7"), rDoc.GetString(ScAddress(4,7,0)));
xDocSh->DoClose();
}
void ScFiltersTest::testTdf100709XLSX()
{
ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc("tdf100709.", FORMAT_XLSX);