[Libreoffice-commits] core.git: sw/source

Mihai Varga mihai.varga at collabora.com
Wed May 20 03:07:43 PDT 2015


 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(+)

New commits:
commit f8b4c783c6269e108ade08cd9896b845e3b7ae3a
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Tue May 19 12:14:48 2015 +0300

    LOKit mouse move handler
    
    Change-Id: I783bf782df66329ea4a1f78346aa2c36b9e4e425
    Reviewed-on: https://gerrit.libreoffice.org/15799
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 7a5d711..8ff7f53 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 28ce774..2c5062f 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 01a4cb4..a3ea47d 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;


More information about the Libreoffice-commits mailing list