From d7163dfa5c207f973d226e494c1620651c2b2b75 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 9 Jun 2015 23:41:36 +0200 Subject: more tests for the implemented cases, tdf#90001 Change-Id: Iec22ad67c9deaada827ba8eac47581e08f934353 (cherry picked from commit 782c116b5ac39aef27c3a00f7fc145c9f755e3a3) --- sc/qa/unit/ucalc_formula.cxx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'sc') diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index fe7d417d6e9d..09ac70ddb0f9 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -1616,6 +1616,35 @@ void Test::testFormulaRefUpdateSheetsDelete() m_pDoc->InsertTab(2, "Sheet3"); m_pDoc->InsertTab(3, "Sheet4"); + m_pDoc->SetString(ScAddress(4,1,0), "=SUM(Sheet2.A4:Sheet4.A4)"); + m_pDoc->SetString(ScAddress(4,2,0), "=SUM($Sheet2.A4:$Sheet4.A4)"); + m_pDoc->DeleteTab(1); + if (!checkFormula(*m_pDoc, ScAddress(4,1,0), "SUM(Sheet3.A4:Sheet4.A4)")) + CPPUNIT_FAIL("Wrong Formula"); + if (!checkFormula(*m_pDoc, ScAddress(4,2,0), "SUM($Sheet3.A4:$Sheet4.A4)")) + CPPUNIT_FAIL("Wrong Formula"); + m_pDoc->InsertTab(1, "Sheet2"); + + m_pDoc->SetString(ScAddress(5,1,3), "=SUM(Sheet1.A5:Sheet3.A5)"); + m_pDoc->SetString(ScAddress(5,2,3), "=SUM($Sheet1.A5:$Sheet3.A5)"); + m_pDoc->DeleteTab(2); + if (!checkFormula(*m_pDoc, ScAddress(5,1,2), "SUM(Sheet1.A5:Sheet2.A5)")) + CPPUNIT_FAIL("Wrong Formula"); + if (!checkFormula(*m_pDoc, ScAddress(5,2,2), "SUM($Sheet1.A5:$Sheet2.A5)")) + CPPUNIT_FAIL("Wrong Formula"); + m_pDoc->InsertTab(2, "Sheet3"); + + m_pDoc->SetString(ScAddress(6,1,3), "=SUM(Sheet1.A6:Sheet3.A6)"); + m_pDoc->SetString(ScAddress(6,2,3), "=SUM($Sheet1.A6:$Sheet3.A6)"); + m_pDoc->DeleteTabs(0,3); + if (!checkFormula(*m_pDoc, ScAddress(6,1,0), "SUM(#REF!.A6:#REF!.A6)")) + CPPUNIT_FAIL("Wrong Formula"); + if (!checkFormula(*m_pDoc, ScAddress(6,2,0), "SUM($#REF!.A6:$#REF!.A6)")) + CPPUNIT_FAIL("Wrong Formula"); + m_pDoc->InsertTab(0, "Sheet1"); + m_pDoc->InsertTab(1, "Sheet2"); + m_pDoc->InsertTab(2, "Sheet3"); + m_pDoc->SetString(ScAddress(1,1,1), "=SUM(Sheet1.A2:Sheet3.A2"); m_pDoc->SetString(ScAddress(2,1,1), "=SUM(Sheet1.A1:Sheet2.A1"); m_pDoc->SetString(ScAddress(3,1,1), "=SUM(Sheet2.A3:Sheet4.A3"); -- cgit