summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-09-09 17:05:47 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-09-09 21:18:52 +0200
commit4a6fedc2e21d7036ae784ed90e78e3eb2fe1b3d5 (patch)
tree166377ac5081159bb48fa9075edfdd61b0d98c2a /sc/qa
parent94512c499d678e9eeca05e84361d846bbd3b6950 (diff)
tdf#136364: sc_subsequent_filters_test: Add unittest
Change-Id: I4088e6e3f0b4c344011c1cee589e2fa0b504e3ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102326 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/xlsx/tdf136364.xlsxbin0 -> 10149 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx26
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/tdf136364.xlsx b/sc/qa/unit/data/xlsx/tdf136364.xlsx
new file mode 100644
index 000000000000..45358a6b1ebd
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf136364.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 7ca0f5fa1a25..bc8c36a9bf9c 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -227,6 +227,7 @@ public:
void testBnc762542();
+ void testTdf136364();
void testTdf103734();
void testTdf98844();
void testTdf100458();
@@ -395,6 +396,7 @@ public:
CPPUNIT_TEST(testHiddenSheetsXLSX);
+ CPPUNIT_TEST(testTdf136364);
CPPUNIT_TEST(testTdf103734);
CPPUNIT_TEST(testTdf98844);
CPPUNIT_TEST(testTdf100458);
@@ -3786,6 +3788,30 @@ void ScFiltersTest::testRelFormulaValidationXLS()
xDocSh->DoClose();
}
+void ScFiltersTest::testTdf136364()
+{
+ ScDocShellRef xDocSh = loadDoc("tdf136364.", FORMAT_XLSX);
+ CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ // Without the fix in place, it would have failed with
+ // - Expected: =SUM((B2:B3~C4:C5~D6:D7))
+ // - Actual : =SUM((B2:B3~C4:C5,D6:D7))
+ OUString aFormula;
+ rDoc.GetFormula(4, 0, 0, aFormula);
+ CPPUNIT_ASSERT_EQUAL(OUString("=SUM((B2:B3~C4:C5~D6:D7))"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(27.0, rDoc.GetValue(ScAddress(4,0,0)));
+
+ // - Expected: =SUM((B2~C4~D6))
+ // - Actual : =SUM((B2~C4,D6))
+ rDoc.GetFormula(4, 1, 0, aFormula);
+ CPPUNIT_ASSERT_EQUAL(OUString("=SUM((B2~C4~D6))"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(12.0, rDoc.GetValue(ScAddress(4,1,0)));
+
+ xDocSh->DoClose();
+}
+
void ScFiltersTest::testTdf103734()
{
ScDocShellRef xDocSh = loadDoc("tdf103734.", FORMAT_ODS);