summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-07-31 19:19:41 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-07-31 21:26:47 -0400
commit10dfaebc6cc2191745d4d7323596bb8e22c9d029 (patch)
treedf4e46286d3a6f75fd6b761dc514f0cdf556120d /sc/qa
parent02fb63f8f29085213659b730456dbf0438c2f7cc (diff)
Add test on updating references in named range.
This currently fails. Change-Id: Ibb2b9e4430c97479d068d94d233f04f60b255966
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 f731f2ae4e3b..e85c01c55045 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -1064,6 +1064,24 @@ void Test::testFormulaRefUpdateNamedExpression()
CPPUNIT_ASSERT_EQUAL(34.0, m_pDoc->GetValue(ScAddress(2,7,0)));
#endif
+ // Clear all and start over.
+ clearRange(m_pDoc, ScRange(0,0,0,100,100,0));
+ pGlobalNames->clear();
+
+ pName = new ScRangeData(
+ m_pDoc, "MyRange", "$B$1:$C$6", ScAddress(0,0,0), RT_NAME, formula::FormulaGrammar::GRAM_NATIVE);
+ bInserted = pGlobalNames->insert(pName);
+ CPPUNIT_ASSERT_MESSAGE("Failed to insert a new name.", bInserted);
+ pName->GetSymbol(aExpr);
+ CPPUNIT_ASSERT_EQUAL(OUString("$B$1:$C$6"), aExpr);
+
+ // Insert range of cells to shift right. The range partially overlaps the named range.
+ m_pDoc->InsertCol(ScRange(2,4,0,3,8,0));
+
+ // This should not alter the range.
+ pName->GetSymbol(aExpr);
+ CPPUNIT_ASSERT_EQUAL(OUString("$B$1:$C$6"), aExpr);
+
m_pDoc->DeleteTab(0);
}