Kaydet (Commit) 782c116b authored tarafından Eike Rathke's avatar Eike Rathke

more tests for the implemented cases, tdf#90001

Change-Id: Iec22ad67c9deaada827ba8eac47581e08f934353
üst 20e4ccc6
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment