Blame SOURCES/0353-sw-lok-comments-fix-vertical-scrollbar-with-custom-z.patch

135360
From 0fb40ac6ec515ccc3b1db575232aa4e01c46e815 Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Mon, 23 Nov 2015 13:46:59 +0100
135360
Subject: [PATCH 353/398] sw lok comments: fix vertical scrollbar with custom
135360
 zoom
135360
135360
With this, if a comment has enough content that it gets a vertical
135360
scrollbar, then tiled rendering output looks OK, even with non-100%
135360
zoom.
135360
135360
Change-Id: I699aadc11b6c34fb0791e70705719fd61169d972
135360
(cherry picked from commit 30b511ae38e2870174db91d12f65a9c3320fc172)
135360
---
135360
 sw/source/core/view/viewsh.cxx        | 9 +++++++++
135360
 sw/source/uibase/docvw/SidebarWin.cxx | 5 +++--
135360
 2 files changed, 12 insertions(+), 2 deletions(-)
135360
135360
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
135360
index 963577fb1bd8..093d5208fdda 100644
135360
--- a/sw/source/core/view/viewsh.cxx
135360
+++ b/sw/source/core/view/viewsh.cxx
135360
@@ -1879,6 +1879,15 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
135360
     aMapMode.SetScaleY(scaleY);
135360
     rDevice.SetMapMode(aMapMode);
135360
 
135360
+    // Update scaling of SwEditWin and its sub-widgets, needed for comments.
135360
+    if (GetWin() && GetWin()->GetMapMode().GetScaleX() != scaleX)
135360
+    {
135360
+        double fScale = scaleX;
135360
+        SwViewOption aOption(*GetViewOptions());
135360
+        aOption.SetZoom(fScale * 100);
135360
+        ApplyViewOptions(aOption);
135360
+    }
135360
+
135360
     Rectangle aOutRect = Rectangle(Point(tilePosX, tilePosY),
135360
                                    rDevice.PixelToLogic(Size(contextWidth, contextHeight)));
135360
 
135360
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
135360
index 6acbc1da7077..47c65c86b06b 100644
135360
--- a/sw/source/uibase/docvw/SidebarWin.cxx
135360
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
135360
@@ -284,8 +284,7 @@ void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle
135360
             continue;
135360
 
135360
         rRenderContext.Push(PushFlags::MAPMODE);
135360
-        const Fraction& rFraction(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
135360
-        Point aOffset(PixelToLogic(pChild->GetPosPixel() * rFraction.GetDenominator() / rFraction.GetNumerator()));
135360
+        Point aOffset(PixelToLogic(pChild->GetPosPixel()));
135360
         MapMode aMapMode(rRenderContext.GetMapMode());
135360
         aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
135360
         rRenderContext.SetMapMode(aMapMode);
135360
@@ -299,6 +298,8 @@ void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle
135360
             pChild->EnableMapMode();
135360
             aMapMode = pChild->GetMapMode();
135360
             aMapMode.SetMapUnit(rRenderContext.GetMapMode().GetMapUnit());
135360
+            aMapMode.SetScaleX(rRenderContext.GetMapMode().GetScaleX());
135360
+            aMapMode.SetScaleY(rRenderContext.GetMapMode().GetScaleY());
135360
             pChild->SetMapMode(aMapMode);
135360
         }
135360
 
135360
-- 
135360
2.12.0
135360