From f8b4c783c6269e108ade08cd9896b845e3b7ae3a Mon Sep 17 00:00:00 2001 From: Mihai Varga Date: Tue, 19 May 2015 12:14:48 +0300 Subject: LOKit mouse move handler Change-Id: I783bf782df66329ea4a1f78346aa2c36b9e4e425 Reviewed-on: https://gerrit.libreoffice.org/15799 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- sw/source/uibase/docvw/edtwin.cxx | 13 +++++++++++++ sw/source/uibase/inc/edtwin.hxx | 2 ++ sw/source/uibase/uno/unotxdoc.cxx | 3 +++ 3 files changed, 18 insertions(+) diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 7a5d7117b4cf..8ff7f5366570 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -6232,6 +6232,19 @@ void SwEditWin::LogicMouseButtonUp(const MouseEvent& rMouseEvent) SetPointerPosPixel(aPoint); } +void SwEditWin::LogicMouseMove(const MouseEvent& rMouseEvent) +{ + // When we're not doing tiled rendering, then positions must be passed as pixels. + assert(m_rView.GetWrtShell().isTiledRendering()); + + Point aPoint = GetPointerPosPixel(); + SetLastMousePos(rMouseEvent.GetPosPixel()); + + MouseMove(rMouseEvent); + + SetPointerPosPixel(aPoint); +} + void SwEditWin::SetCursorTwipPosition(const Point& rPosition, bool bPoint, bool bClearMark) { if (SdrView* pSdrView = m_rView.GetWrtShell().GetDrawView()) diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx index 28ce77407941..2c5062f20794 100644 --- a/sw/source/uibase/inc/edtwin.hxx +++ b/sw/source/uibase/inc/edtwin.hxx @@ -303,6 +303,8 @@ public: void LogicMouseButtonDown(const MouseEvent& rMouseEvent); /// Same as MouseButtonUp(), but coordinates are in logic unit. void LogicMouseButtonUp(const MouseEvent& rMouseEvent); + /// Same as MouseMove(), but coordinates are in logic unit. + void LogicMouseMove(const MouseEvent& rMouseEvent); /// Allows adjusting the point or mark of the selection to a document coordinate. void SetCursorTwipPosition(const Point& rPosition, bool bPoint, bool bClearMark); /// Allows starting or ending a graphic move or resize action. diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 01a4cb4d01dc..a3ea47da95aa 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3218,6 +3218,9 @@ void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount) case LOK_MOUSEEVENT_MOUSEBUTTONUP: rEditWin.LogicMouseButtonUp(aEvent); break; + case LOK_MOUSEEVENT_MOUSEMOVE: + rEditWin.LogicMouseMove(aEvent); + break; default: assert(false); break; -- cgit v1.2.3