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

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