diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-23 23:06:03 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-24 23:29:40 -0400 |
commit | 6dda773b8fa88cc2de994878fd1cdf2092962567 (patch) | |
tree | d48d15110503606a55e63be4a6afb33143763865 | |
parent | 46b849a6eafc59369ea437fec539863d72953919 (diff) |
Add test for partial move of referenced range.
Change-Id: I48d0a3ea631f26b779fd6faddeb30c30a831f493
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index ebf74e74a16f..ec6a6da71fcd 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -907,6 +907,28 @@ void Test::testFormulaRefUpdateMove() if (!checkFormula(*m_pDoc, ScAddress(1,12,0), "$D$6")) CPPUNIT_FAIL("Wrong formula."); + // The value cells are in D4:D6. Push D4:D5 to the right but leave D6 + // where it is. + m_pDoc->InsertCol(ScRange(3,0,0,3,4,0)); + + // Only the values of B10 and B11 should be updated. + CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(1,9,0)); + CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(1,10,0)); + CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(1,11,0)); + CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(1,12,0)); + + if (!checkFormula(*m_pDoc, ScAddress(1,9,0), "SUM(D4:D6)")) + CPPUNIT_FAIL("Wrong formula."); + + if (!checkFormula(*m_pDoc, ScAddress(1,10,0), "SUM($D$4:$D$6)")) + CPPUNIT_FAIL("Wrong formula."); + + if (!checkFormula(*m_pDoc, ScAddress(1,11,0), "E5")) + CPPUNIT_FAIL("Wrong formula."); + + if (!checkFormula(*m_pDoc, ScAddress(1,12,0), "$D$6")) + CPPUNIT_FAIL("Wrong formula."); + m_pDoc->DeleteTab(0); } |