summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-11 00:34:37 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-04-11 00:44:54 -0400
commitbdc8d5f9e712fce35098352b8c1d9028f4095d8c (patch)
tree3bdd9d91cd8f6c23199a33955453ba17908e3ea4
parent896cacf059005e254f7d502a353f4cca74f9832e (diff)
fdo#77300: Add test for this.
Change-Id: Ib870d8f115b074a4ad80ee6910f92ba8d4b0c01e
-rw-r--r--sc/qa/unit/ucalc_sharedformula.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx
index acb249a83d1b..603e26e904b8 100644
--- a/sc/qa/unit/ucalc_sharedformula.cxx
+++ b/sc/qa/unit/ucalc_sharedformula.cxx
@@ -1222,6 +1222,9 @@ void Test::testSharedFormulaUpdateOnNamedRangeChange()
m_pDoc->SetString(ScAddress(1,1,0), "=SUM(MyRange)");
m_pDoc->SetString(ScAddress(1,2,0), "=SUM(MyRange)");
+ // Set single formula with no named range to B5.
+ m_pDoc->SetString(ScAddress(1,4,0), "=ROW()");
+
// B1:B3 should be grouped.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
CPPUNIT_ASSERT(pFC);
@@ -1232,6 +1235,8 @@ void Test::testSharedFormulaUpdateOnNamedRangeChange()
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(1,1,0)));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(1,2,0)));
+ CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(ScAddress(1,4,0)));
+
// Set a single formula to C1.
m_pDoc->SetString(ScAddress(2,0,0), "=AVERAGE(MyRange)");
pFC = m_pDoc->GetFormulaCell(ScAddress(2,0,0));
@@ -1260,6 +1265,8 @@ void Test::testSharedFormulaUpdateOnNamedRangeChange()
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*m_pDoc, ScAddress(1,2,0), "SUM(MyRange)"))
CPPUNIT_FAIL("Wrong formula!");
+ if (!checkFormula(*m_pDoc, ScAddress(1,4,0), "ROW()"))
+ CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*m_pDoc, ScAddress(2,0,0), "AVERAGE(MyRange)"))
CPPUNIT_FAIL("Wrong formula!");
@@ -1267,6 +1274,7 @@ void Test::testSharedFormulaUpdateOnNamedRangeChange()
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(1,0,0)));
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(1,1,0)));
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(1,2,0)));
+ CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(ScAddress(1,4,0)));
CPPUNIT_ASSERT_EQUAL(2.5, m_pDoc->GetValue(ScAddress(2,0,0)));
m_pDoc->DeleteTab(0);