diff options
author | merttumer <mert.tumer@collabora.com> | 2021-05-24 18:56:56 +0300 |
---|---|---|
committer | Mert Tumer <mert.tumer@collabora.com> | 2021-05-31 07:49:49 +0200 |
commit | d17f982436006d1dc59d7679f2959ee931904372 (patch) | |
tree | 03bbb88892161f4cb6e472894d2d6ea13fd33063 /sd | |
parent | 7eed711a6115bf892c998cbd73a2c5b706c6f99d (diff) |
sd: Unit test for Table deletion with Delete Key
Change-Id: I9849f55a143007b49bdcaac392dd84e32d610998
Signed-off-by: merttumer <mert.tumer@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116069
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116311
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index fe6ee4e628b7..5c852d854c90 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -132,6 +132,7 @@ public: void testSpellOnlineRenderParameter(); void testSlideDuplicateUndo(); void testMoveShapeHandle(); + void testDeleteTable(); CPPUNIT_TEST_SUITE(SdTiledRenderingTest); CPPUNIT_TEST(testCreateDestroy); @@ -188,6 +189,7 @@ public: CPPUNIT_TEST(testSpellOnlineRenderParameter); CPPUNIT_TEST(testSlideDuplicateUndo); CPPUNIT_TEST(testMoveShapeHandle); + CPPUNIT_TEST(testDeleteTable); CPPUNIT_TEST_SUITE_END(); @@ -738,6 +740,30 @@ void SdTiledRenderingTest::testInsertTable() CPPUNIT_ASSERT(aPos.Y() != 0); } +void SdTiledRenderingTest::testDeleteTable() +{ + SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp"); + + uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence( + { + { "Rows", uno::makeAny(sal_Int32(3)) }, + { "Columns", uno::makeAny(sal_Int32(5)) } + })); + + comphelper::dispatchCommand(".uno:InsertTable", aArgs); + Scheduler::ProcessEventsToIdle(); + sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); + SdrView* pSdrView = pViewShell->GetView(); + const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); + CPPUNIT_ASSERT(rMarkList.GetMarkCount() == 1); + pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | awt::Key::A); + pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_MOD1 | awt::Key::A); + pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DELETE); + pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DELETE); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT(rMarkList.GetMarkCount() == 0); +} + void SdTiledRenderingTest::testPartHash() { SdXImpressDocument* pDoc = createDoc("dummy.odp"); |