sc/qa/unit/ucalc.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
New commits: commit 5bc315f5f50b9f1cf5b4fd8b6bcba62f6d9ad1ab Author: Kohei Yoshida <kohei.yosh...@suse.com> Date: Sat Jan 7 19:20:20 2012 -0500 More unit test code to test copying a sheet with drawing object. diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index c9c6b4b..18fb569 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); } _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits