summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-07-18 17:28:43 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-07-24 23:29:30 -0400
commit8e59e77a72824c517918f4ea3cc71c7e1ba09a6b (patch)
tree43d32ac8d98f88abc37d3e1f20350c3222687b01 /sc/qa
parent87c187be0a2c56fefab53594e00f979492c004fd (diff)
Test for recalculating formula cells on partial shifting of ref range.
Change-Id: I63807a0368551c6a38cf98865a877e92810b2a22
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/ucalc_formula.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 134d23cbad0b..e04c7416fcc4 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -392,6 +392,24 @@ void Test::testFormulaRefUpdate()
if (!checkFormula(*m_pDoc, aPos, "SUM($B$2:$C$3)"))
CPPUNIT_FAIL("Wrong formula in A7.");
+ // Check the values of the formula cells in A6:A7.
+ CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,5,0)));
+ CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,6,0)));
+
+ // Insert cells over B1:B2 to partially shift value range.
+ m_pDoc->InsertRow(ScRange(1,0,0,1,1,0));
+
+ // Check the values of the formula cells in A6:A7 again.
+ CPPUNIT_ASSERT_EQUAL(7.0, m_pDoc->GetValue(ScAddress(0,5,0)));
+ CPPUNIT_ASSERT_EQUAL(7.0, m_pDoc->GetValue(ScAddress(0,6,0)));
+
+ // ... and shift them back.
+ m_pDoc->DeleteRow(ScRange(1,0,0,1,1,0));
+
+ // The formula cell results should be back too.
+ CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,5,0)));
+ CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,6,0)));
+
m_pDoc->DeleteTab(0);
}