summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-01-07 19:20:20 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2012-01-07 19:21:25 -0500
commit5bc315f5f50b9f1cf5b4fd8b6bcba62f6d9ad1ab (patch)
tree6ef1e17ec0aef39da7be62832fe320423c489689 /sc/qa/unit/ucalc.cxx
parentd831f352ba4969f4e5ed0d1057a773d5a472d4aa (diff)
More unit test code to test copying a sheet with drawing object.
Diffstat (limited to 'sc/qa/unit/ucalc.cxx')
-rw-r--r--sc/qa/unit/ucalc.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index c9c6b4bd28f4..18fb569bba9d 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2521,7 +2521,7 @@ void Test::testGraphicsOnSheetMove()
// Insert an object.
Rectangle aObjRect(2,2,100,100);
- SdrRectObj* pObj = new SdrRectObj(aObjRect);
+ SdrObject* pObj = new SdrRectObj(aObjRect);
pPage->InsertObject(pObj);
ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0);
@@ -2566,6 +2566,17 @@ void Test::testGraphicsOnSheetMove()
CPPUNIT_ASSERT_MESSAGE("2nd sheet should have one object.", pPage && pPage->GetObjCount() == 1);
CPPUNIT_ASSERT_MESSAGE("Wrong sheet ID in cell anchor data!", pData->maStart.Tab() == 1 && pData->maEnd.Tab() == 1);
+ // Copy the 2nd sheet, which has one drawing object to the last position.
+ m_pDoc->CopyTab(1, 2);
+ pPage = pDrawLayer->GetPage(2);
+ CPPUNIT_ASSERT_MESSAGE("Copied sheet should have one object.", pPage && pPage->GetObjCount() == 1);
+ pObj = pPage->GetObj(0);
+ CPPUNIT_ASSERT_MESSAGE("Failed to get drawing object.", pObj);
+ pData = ScDrawLayer::GetObjData(pObj);
+ CPPUNIT_ASSERT_MESSAGE("Failed to get drawing object meta-data.", pData);
+ CPPUNIT_ASSERT_MESSAGE("Wrong sheet ID in cell anchor data!", pData->maStart.Tab() == 2 && pData->maEnd.Tab() == 2);
+
+ m_pDoc->DeleteTab(2);
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
}