diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-21 12:52:30 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-26 10:27:42 +0100 |
commit | 752d15176fe6c3361288f3939508cd9d4497115d (patch) | |
tree | 5078beb005b2704972c485e8dc42252399b0ef93 /sw/source/uibase | |
parent | bb0b878b9d8a63e43c5063b65b1b2381621a18f6 (diff) |
Add SwXTextDocument::postMouseEvent()
Change-Id: Ic2e6343288e87e23026b2f0c17338ecf5f1bed99
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/inc/edtwin.hxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 20 |
3 files changed, 26 insertions, 3 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index fef9d4d83c08..d04e3d79b9fb 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -6250,15 +6250,15 @@ void SwEditWin::LogicInvalidate(const vcl::Region* pRegion) m_rView.GetWrtShell().libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); } -void SwEditWin::LogicMouseMove(const MouseEvent& rMouseEvent) +void SwEditWin::LogicMouseMove(const MouseEvent& /*rMouseEvent*/) { } -void SwEditWin::LogicMouseButtonDown(const MouseEvent& rMouseEvent) +void SwEditWin::LogicMouseButtonDown(const MouseEvent& /*rMouseEvent*/) { } -void SwEditWin::LogicMouseButtonUp(const MouseEvent& rMouseEvent) +void SwEditWin::LogicMouseButtonUp(const MouseEvent& /*rMouseEvent*/) { } diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx index c28ad6e7bb26..c1018f8f5132 100644 --- a/sw/source/uibase/inc/edtwin.hxx +++ b/sw/source/uibase/inc/edtwin.hxx @@ -302,8 +302,11 @@ public: * @param pRegion If 0, that means the whole area, otherwise the area in logic coordinates. */ void LogicInvalidate(const vcl::Region* pRegion) SAL_OVERRIDE; + /// Same as MouseMove(), but coordinates are in logic unit. void LogicMouseMove(const MouseEvent& rMouseEvent); + /// Same as MouseButtonDown(), but coordinates are in logic unit. void LogicMouseButtonDown(const MouseEvent& rMouseEvent); + /// Same as MouseButtonUp(), but coordinates are in logic unit. void LogicMouseButtonUp(const MouseEvent& rMouseEvent); }; 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 <swatrset.hxx> #include <view.hxx> #include <srcview.hxx> +#include <edtwin.hxx> #include <svtools/langtab.hxx> #include <map> @@ -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); |