Blame SOURCES/0351-sw-lok-comments-implement-painting-of-the-vertical-s.patch

135360
From 10e3ea1d50a225b92a56c83ccf881807fbc7b0eb Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Fri, 20 Nov 2015 10:24:29 +0100
135360
Subject: [PATCH 351/398] sw lok comments: implement painting of the vertical
135360
 scrollbar
135360
135360
This one is special, as normally its map mode is in pixels, but we need
135360
all sub-widgets to work in twips when tiled rendering.
135360
135360
With this, the scrollbar widget (both the buttons and the
135360
button/background area of the scrollbar itself) is painted at the
135360
correct location when Writer comments have enough content so the
135360
scrollbar is visible.
135360
135360
Change-Id: I4ee9ef8618974b965339078d2262364ec19732ef
135360
(cherry picked from commit f411ef1b8065d3ae03d1a820812e64b250de0932)
135360
---
135360
 sw/source/uibase/docvw/SidebarWin.cxx | 14 ++++++++++++++
135360
 1 file changed, 14 insertions(+)
135360
135360
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
135360
index 5f6cfa7c4ae0..6acbc1da7077 100644
135360
--- a/sw/source/uibase/docvw/SidebarWin.cxx
135360
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
135360
@@ -290,8 +290,22 @@ void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle
135360
         aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
135360
         rRenderContext.SetMapMode(aMapMode);
135360
 
135360
+        bool bPopChild = false;
135360
+        if (pChild->GetMapMode().GetMapUnit() != rRenderContext.GetMapMode().GetMapUnit())
135360
+        {
135360
+            // This is needed for the scrollbar that has its map unit in pixels.
135360
+            pChild->Push(PushFlags::MAPMODE);
135360
+            bPopChild = true;
135360
+            pChild->EnableMapMode();
135360
+            aMapMode = pChild->GetMapMode();
135360
+            aMapMode.SetMapUnit(rRenderContext.GetMapMode().GetMapUnit());
135360
+            pChild->SetMapMode(aMapMode);
135360
+        }
135360
+
135360
         pChild->Paint(rRenderContext, rRect);
135360
 
135360
+        if (bPopChild)
135360
+            pChild->Pop();
135360
         rRenderContext.Pop();
135360
     }
135360
 
135360
-- 
135360
2.12.0
135360