summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-11-09 22:45:21 +0100
committerEike Rathke <erack@redhat.com>2018-11-10 17:36:21 +0100
commitdc134874b62422729a6cbe62e48639e721eacfdf (patch)
treee532ce2f2e64a3f6a8a74215ff1eaa12b9a316d8 /sc/qa
parent603b63b4c154882ecfe95ae3c6960b08eb9fb626 (diff)
Unit test for array of references in ForceArray, tdf#120895, tdf#58874
Change-Id: I8d90c3c9547bc2f36e9ccb3c2ba96b2a29012e07 Reviewed-on: https://gerrit.libreoffice.org/63222 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/ucalc_formula.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index cc55a350f9db..3c1b462933c4 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -8734,6 +8734,20 @@ void Test::testFuncRefListArraySUBTOTAL()
aPos.IncRow();
CPPUNIT_ASSERT_EQUAL_MESSAGE("COUNTBLANK for A1:A2,A4:A5,A5:A6 failed", 0.0, m_pDoc->GetValue(aPos));
+ // Restore these two cell values so we'd catch failures below.
+ m_pDoc->SetValue(0,1,0, 2.0); // A2
+ m_pDoc->SetValue(0,2,0, 4.0); // A3
+ // Hide rows 2 to 4.
+ m_pDoc->SetRowHidden(1,3,0, true);
+ // Matrix in K7, array of references as OFFSET result.
+ m_pDoc->InsertMatrixFormula(10, 6, 10, 6, aMark, "=SUM(SUBTOTAL(109;OFFSET(A1;ROW(A1:A7)-ROW(A1);;1)))");
+ aPos.Set(10,6,0);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("SUM SUBTOTAL failed", 49.0, m_pDoc->GetValue(aPos));
+ aPos.IncRow();
+ // ForceArray in K8, array of references as OFFSET result.
+ m_pDoc->SetString( aPos, "=SUMPRODUCT(SUBTOTAL(109;OFFSET(A1;ROW(A1:A7)-ROW(A1);;1)))");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("SUMPRODUCT SUBTOTAL failed", 49.0, m_pDoc->GetValue(aPos));
+
m_pDoc->DeleteTab(0);
}