summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-23 21:02:31 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-24 12:09:20 +0200
commit270096698d96f2654d4699c90ed0df20b7d15fbe (patch)
treebfcc0e11d347c476e37f4057c0dca15417ccf4e2 /sc/qa/unit/ucalc.cxx
parent043c4bf56f716761c240fe253d16fce2ae4089f7 (diff)
first try for copy/paste formulas between docs test case
Diffstat (limited to 'sc/qa/unit/ucalc.cxx')
-rw-r--r--sc/qa/unit/ucalc.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 4f6a6427327c..8585a1011a29 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -210,6 +210,7 @@ public:
void testAutoFill();
void testCopyPasteFormulas();
+ void testCopyPasteFormulasExternalDoc();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testCollator);
@@ -251,6 +252,7 @@ public:
CPPUNIT_TEST(testRenameTable);
CPPUNIT_TEST(testAutoFill);
CPPUNIT_TEST(testCopyPasteFormulas);
+ CPPUNIT_TEST(testCopyPasteFormulasExternalDoc);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4258,6 +4260,31 @@ void Test::testCopyPasteFormulas()
CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString("=$Sheet2.K$1"));
}
+void Test::testCopyPasteFormulasExternalDoc()
+{
+ ScDocShellRef xExtDocSh = new ScDocShell;
+ OUString aExtDocName(RTL_CONSTASCII_USTRINGPARAM("file:///extdata.fake"));
+ OUString aExtSh1Name(RTL_CONSTASCII_USTRINGPARAM("ExtSheet1"));
+ OUString aExtSh2Name(RTL_CONSTASCII_USTRINGPARAM("ExtSheet2"));
+ OUString aExtSh3Name(RTL_CONSTASCII_USTRINGPARAM("ExtSheet3"));
+ SfxMedium* pMed = new SfxMedium(aExtDocName, STREAM_STD_READWRITE);
+ xExtDocSh->DoInitNew(pMed);
+ CPPUNIT_ASSERT_MESSAGE("external document instance not loaded.",
+ findLoadedDocShellByName(aExtDocName) != NULL);
+
+ ScDocument* pExtDoc = xExtDocSh->GetDocument();
+
+ m_pDoc->InsertTab(0, "Sheet1");
+ 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");
+
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}