diff options
author | Jan Holesovsky <kendy@collabora.com> | 2016-03-31 15:48:52 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-03-31 15:52:26 +0200 |
commit | 8c32ffd59aef2c7b319d64c310e7d0a46dbb9e2c (patch) | |
tree | 2061aba2dbcb5c56d9d8d73dbd3a5e093062e616 /sd/qa | |
parent | ee246512cb0103f22f8afc0de245ea7f82143776 (diff) |
sd lok bccu#1525: Unit test for the fix.
Change-Id: I55107bd36a9b716ecbef4d01dd670617b141cc48
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 1d6775f496c0..f62fa5e44668 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -46,7 +46,6 @@ public: virtual void tearDown() override; #if !defined(_WIN32) && !defined(MACOSX) - void testInsertDeletePage(); void testRegisterCallback(); void testPostKeyEvent(); void testPostMouseEvent(); @@ -59,11 +58,12 @@ public: void testSearchAllSelections(); void testSearchAllNotifications(); void testSearchAllFollowedBySearch(); + void testInsertDeletePage(); + void testInsertTable(); #endif CPPUNIT_TEST_SUITE(SdTiledRenderingTest); #if !defined(_WIN32) && !defined(MACOSX) - CPPUNIT_TEST(testInsertDeletePage); CPPUNIT_TEST(testRegisterCallback); CPPUNIT_TEST(testPostKeyEvent); CPPUNIT_TEST(testPostMouseEvent); @@ -75,7 +75,8 @@ public: CPPUNIT_TEST(testSearchAll); CPPUNIT_TEST(testSearchAllSelections); CPPUNIT_TEST(testSearchAllNotifications); - CPPUNIT_TEST(testSearchAllFollowedBySearch); + CPPUNIT_TEST(testInsertDeletePage); + CPPUNIT_TEST(testInsertTable); #endif CPPUNIT_TEST_SUITE_END(); @@ -628,6 +629,36 @@ void SdTiledRenderingTest::testInsertDeletePage() comphelper::LibreOfficeKit::setActive(false); } +void SdTiledRenderingTest::testInsertTable() +{ + comphelper::LibreOfficeKit::setActive(); + SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp"); + + uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence( + { + {"Rows", uno::makeAny(3)}, + {"Columns", uno::makeAny(5)} + } + )); + + comphelper::dispatchCommand(".uno:InsertTable", aArgs); + Scheduler::ProcessEventsToIdle(); + + // get the table + sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); + SdPage* pActualPage = pViewShell->GetActualPage(); + SdrObject* pObject = pActualPage->GetObj(1); + CPPUNIT_ASSERT(pObject); + + // check that the table is not in the top left corner + Point aPos(pObject->GetRelativePos()); + + CPPUNIT_ASSERT(aPos.X() != 0); + CPPUNIT_ASSERT(aPos.Y() != 0); + + comphelper::LibreOfficeKit::setActive(false); +} + #endif CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest); |