From 752d15176fe6c3361288f3939508cd9d4497115d Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 21 Jan 2015 12:52:30 +0100 Subject: Add SwXTextDocument::postMouseEvent() Change-Id: Ic2e6343288e87e23026b2f0c17338ecf5f1bed99 --- sw/source/uibase/uno/unotxdoc.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sw/source/uibase/uno') diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 08fd4a49caa9..cd4b4bc330fb 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -129,6 +129,7 @@ #include #include #include +#include #include #include @@ -3172,6 +3173,25 @@ void SwXTextDocument::registerCallback(LibreOfficeKitCallback pCallback, void* p pViewShell->registerLibreOfficeKitCallback(pCallback, pData); } +void SwXTextDocument::postMouseEvent(int nType, int nX, int nY) +{ + SwEditWin& rEditWin = pDocShell->GetView()->GetEditWin(); + MouseEvent aEvent(Point(nX, nY), 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT); + + switch (nType) + { + case LOK_MOUSEEVENT_MOUSEBUTTONDOWN: + rEditWin.LogicMouseButtonDown(aEvent); + break; + case LOK_MOUSEEVENT_MOUSEBUTTONUP: + rEditWin.LogicMouseButtonUp(aEvent); + break; + default: + assert(false); + break; + } +} + void * SAL_CALL SwXTextDocument::operator new( size_t t) throw() { return SwXTextDocumentBaseClass::operator new(t); -- cgit v1.2.3