summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-23 11:48:18 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-24 12:09:20 +0200
commit043c4bf56f716761c240fe253d16fce2ae4089f7 (patch)
tree4f3e00087be01f281af75fb318f1e0e7df46a3aa /sc/qa/unit/ucalc.cxx
parentc5d1f72f0c8c07736ba675c807698bed0e0c4d28 (diff)
add some more test cases for copying formulas
Diffstat (limited to 'sc/qa/unit/ucalc.cxx')
-rw-r--r--sc/qa/unit/ucalc.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 9542320a2e03..4f6a6427327c 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -4229,17 +4229,33 @@ void Test::testCopyPasteFormulas()
m_pDoc->InsertTab(1, "Sheet2");
m_pDoc->SetString(0,0,0, "=COLUMN($A$1)");
+ m_pDoc->SetString(0,1,0, "=$A$1+B2" );
+ m_pDoc->SetString(0,2,0, "=$Sheet2.A1");
+ m_pDoc->SetString(0,3,0, "=$Sheet2.$A$1");
+ m_pDoc->SetString(0,4,0, "=$Sheet2.A$1");
+
+ // to prevent ScEditableTester in ScDocFunc::MoveBlock
m_pDoc->SetInTest();
CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc->GetValue(0,0,0), 1.0, 1e-08);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc->GetValue(0,1,0), 1.0, 1e-08);
ScDocFunc& rDocFunc = m_xDocShRef->GetDocFunc();
- bool bMoveDone = rDocFunc.MoveBlock(ScRange(0,0,0), ScAddress( 10, 10, 0), false, false, false, true);
+ bool bMoveDone = rDocFunc.MoveBlock(ScRange(0,0,0,0,4,0), ScAddress( 10, 10, 0), false, false, false, true);
// check that moving was succesful, mainly for editable tester
CPPUNIT_ASSERT(bMoveDone);
CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc->GetValue(10,10,0), 1.0, 1e-8);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc->GetValue(10,11,0), 1.0, 1e-8);
rtl::OUString aFormula;
m_pDoc->GetFormula(10,10,0, aFormula);
CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString("=COLUMN($A$1)"));
+ m_pDoc->GetFormula(10,11,0, aFormula);
+ CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString("=$A$1+L12"));
+ m_pDoc->GetFormula(10,12,0, aFormula);
+ CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString("=$Sheet2.K11"));
+ m_pDoc->GetFormula(10,13,0, aFormula);
+ CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString("=$Sheet2.$A$1"));
+ m_pDoc->GetFormula(10,14,0, aFormula);
+ CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString("=$Sheet2.K$1"));
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);