sd/source/ui/view/sdwindow.cxx    |   12 ------------
 sw/source/uibase/docvw/edtwin.cxx |   12 ------------
 2 files changed, 24 deletions(-)

New commits:
commit 825242b48843d7d8e03e3dd41a58d6d93afb443e
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Oct 23 09:35:18 2022 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Oct 23 19:06:00 2022 +0200

    Simplify SwEditWin::LogicMouse* and sd::Window::LogicMouse*
    
    These are intended to be called in LibreOfficeKit case. Setting pointer
    position appeared in commits b780822f5afbf8cd6c2a8c756251a7edf248f55e
      Author Miklos Vajna <vmik...@collabora.co.uk>
      Date    Tue Feb 24 14:30:41 2015 +0100
        Introduce SdXImpressDocument::postMouseEvent() override
    
    and cc7d10c04fe3047f18b6d5271a5f46a31b80d360
      Author Miklos Vajna <vmik...@collabora.co.uk>
      Date   Tue Mar 03 12:09:04 2015 +0100
        SwEditWin: disable map mode in LogicMouseButtonUp/Down
    
    The only effect of Window::SetPointerPosPixel is realized by a call
    to SalFrame::SetPointerPos; and in SVP case, which is used in case of
    LibreOfficeKit on Linux, it is a noop (see SvpSalFrame::SetPointerPos
    in vcl/headless/svpframe.cxx). But e.g. when running gtktiledviewer
    on Windows, WinSalFrame::SetPointerPos is called, which actually sets
    system cursor position, causing unexpected jumps.
    
    And it is unclear why the mouse actions should restore previous mouse
    positions after executing their functions in the first place. The other
    overrides (vcl/source/control/ctrl.cxx, sc/source/ui/view/gridwin.cxx,
    chart2/source/controller/main/ChartWindow.cxx) don't do that.
    
    So remove these SetPointerPosPixel calls altogether.
    The question remains: if these LogicMouse* are still needed, or if they
    may be replaced with respective Window::Mouse* calls.
    
    Change-Id: Id6103f8eaaddafc72fe5e4264532dbc8a658d240
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141696
    Tested-by: Mike Kaganski <mike.kagan...@collabora.com>
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index f639b463e124..b637a1a01aa8 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -1050,12 +1050,8 @@ void Window::LogicMouseButtonDown(const MouseEvent& 
rMouseEvent)
     // When we're not doing tiled rendering, then positions must be passed as 
pixels.
     assert(comphelper::LibreOfficeKit::isActive());
 
-    Point aPoint = GetPointerPosPixel();
     SetLastMousePos(rMouseEvent.GetPosPixel());
-
     mpViewShell->MouseButtonDown(rMouseEvent, this);
-
-    SetPointerPosPixel(aPoint);
 }
 
 void Window::LogicMouseButtonUp(const MouseEvent& rMouseEvent)
@@ -1063,12 +1059,8 @@ void Window::LogicMouseButtonUp(const MouseEvent& 
rMouseEvent)
     // When we're not doing tiled rendering, then positions must be passed as 
pixels.
     assert(comphelper::LibreOfficeKit::isActive());
 
-    Point aPoint = GetPointerPosPixel();
     SetLastMousePos(rMouseEvent.GetPosPixel());
-
     mpViewShell->MouseButtonUp(rMouseEvent, this);
-
-    SetPointerPosPixel(aPoint);
 }
 
 void Window::LogicMouseMove(const MouseEvent& rMouseEvent)
@@ -1076,12 +1068,8 @@ void Window::LogicMouseMove(const MouseEvent& 
rMouseEvent)
     // When we're not doing tiled rendering, then positions must be passed as 
pixels.
     assert(comphelper::LibreOfficeKit::isActive());
 
-    Point aPoint = GetPointerPosPixel();
     SetLastMousePos(rMouseEvent.GetPosPixel());
-
     mpViewShell->MouseMove(rMouseEvent, this);
-
-    SetPointerPosPixel(aPoint);
 }
 
 FactoryFunction Window::GetUITestFactory() const
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 584d715b9cb8..5095370a16f2 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -6740,12 +6740,8 @@ void SwEditWin::LogicMouseButtonDown(const MouseEvent& 
rMouseEvent)
     // When we're not doing tiled rendering, then positions must be passed as 
pixels.
     assert(comphelper::LibreOfficeKit::isActive());
 
-    Point aPoint = GetPointerPosPixel();
     SetLastMousePos(rMouseEvent.GetPosPixel());
-
     MouseButtonDown(rMouseEvent);
-
-    SetPointerPosPixel(aPoint);
 }
 
 void SwEditWin::LogicMouseButtonUp(const MouseEvent& rMouseEvent)
@@ -6753,12 +6749,8 @@ void SwEditWin::LogicMouseButtonUp(const MouseEvent& 
rMouseEvent)
     // When we're not doing tiled rendering, then positions must be passed as 
pixels.
     assert(comphelper::LibreOfficeKit::isActive());
 
-    Point aPoint = GetPointerPosPixel();
     SetLastMousePos(rMouseEvent.GetPosPixel());
-
     MouseButtonUp(rMouseEvent);
-
-    SetPointerPosPixel(aPoint);
 }
 
 void SwEditWin::LogicMouseMove(const MouseEvent& rMouseEvent)
@@ -6766,12 +6758,8 @@ void SwEditWin::LogicMouseMove(const MouseEvent& 
rMouseEvent)
     // When we're not doing tiled rendering, then positions must be passed as 
pixels.
     assert(comphelper::LibreOfficeKit::isActive());
 
-    Point aPoint = GetPointerPosPixel();
     SetLastMousePos(rMouseEvent.GetPosPixel());
-
     MouseMove(rMouseEvent);
-
-    SetPointerPosPixel(aPoint);
 }
 
 void SwEditWin::SetCursorTwipPosition(const Point& rPosition, bool bPoint, 
bool bClearMark)

Reply via email to