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

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