summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2019-04-16 09:01:01 -0400
committerHenry Castro <hcastro@collabora.com>2019-04-17 14:47:37 +0200
commit70981db28e1f2bde08911059495d3ea0980481d6 (patch)
tree8aa2d47f99f4c9f1f242610f6403368ca4b2aa9d /sw
parent9be1b6cf5b97727135c7f5e48c971edd8dc45e70 (diff)
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 <hcastro@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index ceed820f4a66..07ec78c3e542 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -111,6 +111,7 @@ public:
void testSplitNodeRedlineCallback();
void testDeleteNodeRedlineCallback();
void testVisCursorInvalidation();
+ void testDeselectCustomShape();
CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
CPPUNIT_TEST(testRegisterCallback);
@@ -167,6 +168,7 @@ public:
CPPUNIT_TEST(testSplitNodeRedlineCallback);
CPPUNIT_TEST(testDeleteNodeRedlineCallback);
CPPUNIT_TEST(testVisCursorInvalidation);
+ CPPUNIT_TEST(testDeselectCustomShape);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2400,6 +2402,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();