Blame SOURCES/0359-vcl-lok-handle-tracking-coordinates-which-are-in-twi.patch

135360
From 077f463e0fdb16d1bd37154d0cfcb84959c63a66 Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Tue, 24 Nov 2015 15:01:01 +0100
135360
Subject: [PATCH 359/398] vcl lok: handle tracking coordinates which are in
135360
 twips
135360
135360
This is similar to the mouse button down handling. When the map mode is
135360
disabled and the map mode is in twips, then in general it's possible to
135360
send mouse coordinates in twips. The scrollbar is usually in pixels, so
135360
add extra code to still make this possible.
135360
135360
Change-Id: I0c7e404ecd7ac839e000266e396683bb7d15c505
135360
(cherry picked from commit d7acb44b148893fe0cc48a54c3eb73406c251668)
135360
---
135360
 vcl/source/control/scrbar.cxx | 14 +++++++++++++-
135360
 1 file changed, 13 insertions(+), 1 deletion(-)
135360
135360
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
135360
index e8004d13d177..0679c848b682 100644
135360
--- a/vcl/source/control/scrbar.cxx
135360
+++ b/vcl/source/control/scrbar.cxx
135360
@@ -1076,7 +1076,19 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
135360
     }
135360
     else
135360
     {
135360
-        const Point rMousePos = rTEvt.GetMouseEvent().GetPosPixel();
135360
+        Point aPosPixel;
135360
+        if (!IsMapModeEnabled() && GetMapMode().GetMapUnit() == MAP_TWIP)
135360
+        {
135360
+            // rTEvt coordinates are in twips.
135360
+            Push(PushFlags::MAPMODE);
135360
+            EnableMapMode();
135360
+            MapMode aMapMode = GetMapMode();
135360
+            aMapMode.SetOrigin(Point(0, 0));
135360
+            SetMapMode(aMapMode);
135360
+            aPosPixel = LogicToPixel(rTEvt.GetMouseEvent().GetPosPixel());
135360
+            Pop();
135360
+        }
135360
+        const Point rMousePos = (GetMapMode().GetMapUnit() != MAP_TWIP ? rTEvt.GetMouseEvent().GetPosPixel() : aPosPixel);
135360
 
135360
         // Dragging is treated in a special way
135360
         if ( meScrollType == SCROLL_DRAG )
135360
-- 
135360
2.12.0
135360