[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/qa

Kohei Yoshida kohei.yoshida at gmail.com
Tue Jul 23 20:05:50 PDT 2013


 sc/qa/unit/ucalc_formula.cxx |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

New commits:
commit c92abf7e27ea8dc579e00b751648bf03e147f09f
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Tue Jul 23 23:06:03 2013 -0400

    Add test for partial move of referenced range.
    
    Change-Id: I48d0a3ea631f26b779fd6faddeb30c30a831f493

diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index ebf74e7..ec6a6da 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);
 }
 


More information about the Libreoffice-commits mailing list