[Libreoffice-commits] core.git: sc/qa
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Nov 10 16:36:43 UTC 2018
sc/qa/unit/ucalc_formula.cxx | 14 ++++++++++++++
1 file changed, 14 insertions(+)
New commits:
commit dc134874b62422729a6cbe62e48639e721eacfdf
Author: Eike Rathke <erack at redhat.com>
AuthorDate: Fri Nov 9 22:45:21 2018 +0100
Commit: Eike Rathke <erack at redhat.com>
CommitDate: Sat Nov 10 17:36:21 2018 +0100
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 at redhat.com>
Tested-by: Jenkins
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);
}
More information about the Libreoffice-commits
mailing list