summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Varga <mihai.varga@collabora.com>2015-05-19 12:14:48 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-05-20 10:07:16 +0000
commitf8b4c783c6269e108ade08cd9896b845e3b7ae3a (patch)
treec66f7284a91b188826d489c54ef7e0586ef81cac
parentf2331f3dee01029e3d68174534300228e5135910 (diff)
LOKit mouse move handler
Change-Id: I783bf782df66329ea4a1f78346aa2c36b9e4e425 Reviewed-on: https://gerrit.libreoffice.org/15799 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx13
-rw-r--r--sw/source/uibase/inc/edtwin.hxx2
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx3
3 files changed, 18 insertions, 0 deletions
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;