Blame SOURCES/0355-vcl-lok-fix-scrollbar-to-accept-mouse-events-in-twip.patch

135360
From 65410a3cf918fc17bf92c1ad48574e17e79a62bc Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Mon, 23 Nov 2015 16:07:49 +0100
135360
Subject: [PATCH 355/398] vcl lok: fix scrollbar to accept mouse events in
135360
 twips
135360
135360
(cherry picked from commit 439765480695975e10c92f39aa6a4cb6f2ee7646)
135360
135360
Change-Id: Ieaedaa525d613f8ba55f336c613da163a09f7a33
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 a60595c2ee0d..e8004d13d177 100644
135360
--- a/vcl/source/control/scrbar.cxx
135360
+++ b/vcl/source/control/scrbar.cxx
135360
@@ -897,7 +897,19 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
135360
 
135360
     if (rMEvt.IsLeft() || rMEvt.IsMiddle() || rMEvt.IsRight())
135360
     {
135360
-        const Point&        rMousePos = rMEvt.GetPosPixel();
135360
+        Point aPosPixel;
135360
+        if (!IsMapModeEnabled() && GetMapMode().GetMapUnit() == MAP_TWIP)
135360
+        {
135360
+            // rMEvt 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(rMEvt.GetPosPixel());
135360
+            Pop();
135360
+        }
135360
+        const Point&        rMousePos = (GetMapMode().GetMapUnit() != MAP_TWIP ? rMEvt.GetPosPixel() : aPosPixel);
135360
         sal_uInt16          nTrackFlags = 0;
135360
         bool                bHorizontal = ( GetStyle() & WB_HORZ ) != 0;
135360
         bool                bIsInside = false;
135360
-- 
135360
2.12.0
135360