sw/qa/extras/tiledrendering/tiledrendering.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
New commits: commit 40c1bbd470fb35a3b6ba33009beec875c971ce04 Author: Henry Castro <[email protected]> AuthorDate: Tue Apr 16 09:01:01 2019 -0400 Commit: Jan Holesovsky <[email protected]> CommitDate: Wed Apr 17 15:12:44 2019 +0200 sw lok: add unit test for deselect custom shape Change-Id: I41a9ff0d281d9032ddaafbbcb55352254a809efe Reviewed-on: https://gerrit.libreoffice.org/70824 Tested-by: Jenkins Reviewed-by: Henry Castro <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/70880 Reviewed-by: Jan Holesovsky <[email protected]> Tested-by: Jan Holesovsky <[email protected]> diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 807efac9ea68..3db77a1c7f88 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -108,6 +108,7 @@ public: void testSplitNodeRedlineCallback(); void testDeleteNodeRedlineCallback(); void testVisCursorInvalidation(); + void testDeselectCustomShape(); CPPUNIT_TEST_SUITE(SwTiledRenderingTest); CPPUNIT_TEST(testRegisterCallback); @@ -163,6 +164,7 @@ public: CPPUNIT_TEST(testSplitNodeRedlineCallback); CPPUNIT_TEST(testDeleteNodeRedlineCallback); CPPUNIT_TEST(testVisCursorInvalidation); + CPPUNIT_TEST(testDeselectCustomShape); CPPUNIT_TEST_SUITE_END(); private: @@ -2354,6 +2356,29 @@ void SwTiledRenderingTest::testVisCursorInvalidation() comphelper::LibreOfficeKit::setActive(false); } +void SwTiledRenderingTest::testDeselectCustomShape() +{ + comphelper::LibreOfficeKit::setActive(); + + SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); + SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); + Point aStart = pShellCursor->GetSttPos(); + aStart.setX(aStart.getX() - 1000); + aStart.setY(aStart.getY() - 1000); + + comphelper::dispatchCommand(".uno:BasicShapes.hexagon", uno::Sequence<beans::PropertyValue>()); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pWrtShell->GetDrawView()->GetMarkedObjectList().GetMarkCount()); + + pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, aStart.getX(), aStart.getY(), 1, MOUSE_LEFT, 0); + pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, aStart.getX(), aStart.getY(), 1, MOUSE_LEFT, 0); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pWrtShell->GetDrawView()->GetMarkedObjectList().GetMarkCount()); + + comphelper::LibreOfficeKit::setActive(false); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest); CPPUNIT_PLUGIN_IMPLEMENT(); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
