sc/qa/unit/ucalc_formula.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
New commits: commit 5cfbab03f914946bf9e5813eae707328fda438f9 Author: Eike Rathke <er...@redhat.com> Date: Tue Oct 18 20:50:40 2016 +0200 unit test for tdf#101583, named expression reference expansion Change-Id: I40dc157ebb33da59e436214b703800dfabc11a23 diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index c343686..37d4981 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -2764,6 +2764,20 @@ void Test::testFormulaRefUpdateNameExpandRef() m_pDoc->SetValue(ScAddress(0,3,0), 4.0); CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,6,0))); + // Insert a new column at column 2, which should not expand the named + // range as it is only one column wide. + rFunc.InsertCells(ScRange(1,0,0,1,MAXROW,0), &aMark, INS_INSCOLS_BEFORE, false, true); + pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE"); + CPPUNIT_ASSERT(pName); + pName->GetSymbol(aSymbol, m_pDoc->GetGrammar()); + CPPUNIT_ASSERT_EQUAL(OUString("$A$1:$A$4"), aSymbol); + + // Make sure the referenced area has not changed. + m_pDoc->SetValue(ScAddress(0,3,0), 2.0); + CPPUNIT_ASSERT_EQUAL(8.0, m_pDoc->GetValue(ScAddress(0,6,0))); + m_pDoc->SetValue(ScAddress(1,3,0), 2.0); + CPPUNIT_ASSERT_EQUAL(8.0, m_pDoc->GetValue(ScAddress(0,6,0))); + // Clear the document and start over. m_pDoc->GetRangeName()->clear(); clearSheet(m_pDoc, 0); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits