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

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