Blame SOURCES/0339-sw-lok-comments-fix-comment-widget-width-with-custom.patch

f325b2
From f3edb775652b288ac0c4c38186b4d23bfa603a6c Mon Sep 17 00:00:00 2001
f325b2
From: Miklos Vajna <vmiklos@collabora.co.uk>
f325b2
Date: Tue, 17 Nov 2015 17:07:47 +0100
f325b2
Subject: [PATCH 339/398] sw lok comments: fix comment widget width with custom
f325b2
 zoom
f325b2
f325b2
When tiled rendering, then only the render context (or failing that,
f325b2
SwViewShell::GetOut()) has the correct zoom level, so use that when
f325b2
doing pixel-to-logic conversion or scaling pixel values.
f325b2
f325b2
Change-Id: I265a642b8253c6eced42da2a0e06a2de25c36ca8
f325b2
(cherry picked from commit c9db32de2deeaa705e3da4945f62a94b75a7e4c5)
f325b2
---
f325b2
 sw/source/uibase/docvw/PostItMgr.cxx  | 2 +-
f325b2
 sw/source/uibase/docvw/SidebarWin.cxx | 7 ++++---
f325b2
 2 files changed, 5 insertions(+), 4 deletions(-)
f325b2
f325b2
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
f325b2
index 40e2bda8f6b7..e0ea88fd86b4 100644
f325b2
--- a/sw/source/uibase/docvw/PostItMgr.cxx
f325b2
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
f325b2
@@ -870,7 +870,7 @@ void SwPostItMgr::PaintTile(OutputDevice& rRenderContext, const Rectangle& /*rRe
f325b2
         MapMode aMapMode(rRenderContext.GetMapMode());
f325b2
         aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
f325b2
         rRenderContext.SetMapMode(aMapMode);
f325b2
-        Size aSize(pPostIt->PixelToLogic(pPostIt->GetSizePixel()));
f325b2
+        Size aSize(rRenderContext.PixelToLogic(pPostIt->GetSizePixel()));
f325b2
         Rectangle aRectangle(Point(0, 0), aSize);
f325b2
 
f325b2
         pPostIt->PaintTile(rRenderContext, aRectangle);
f325b2
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
f325b2
index f9163a80f44b..693bcdf5b09a 100644
f325b2
--- a/sw/source/uibase/docvw/SidebarWin.cxx
f325b2
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
f325b2
@@ -286,7 +286,8 @@ void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle
f325b2
             continue;
f325b2
 
f325b2
         rRenderContext.Push(PushFlags::MAPMODE);
f325b2
-        Point aOffset(PixelToLogic(pChild->GetPosPixel()));
f325b2
+        const Fraction& rFraction(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
f325b2
+        Point aOffset(PixelToLogic(pChild->GetPosPixel() * rFraction.GetDenominator() / rFraction.GetNumerator()));
f325b2
         MapMode aMapMode(rRenderContext.GetMapMode());
f325b2
         aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
f325b2
         rRenderContext.SetMapMode(aMapMode);
f325b2
@@ -1411,7 +1412,7 @@ sal_Int32 SwSidebarWin::GetMetaButtonAreaWidth()
f325b2
 
f325b2
 sal_Int32 SwSidebarWin::GetMetaHeight()
f325b2
 {
f325b2
-    const Fraction& f( GetMapMode().GetScaleY() );
f325b2
+    const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
f325b2
     return POSTIT_META_HEIGHT * f.GetNumerator() / f.GetDenominator();
f325b2
 }
f325b2
 
f325b2
@@ -1422,7 +1423,7 @@ sal_Int32 SwSidebarWin::GetMinimumSizeWithMeta()
f325b2
 
f325b2
 sal_Int32 SwSidebarWin::GetMinimumSizeWithoutMeta()
f325b2
 {
f325b2
-    const Fraction& f( GetMapMode().GetScaleY() );
f325b2
+    const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
f325b2
     return POSTIT_MINIMUMSIZE_WITHOUT_META * f.GetNumerator() / f.GetDenominator();
f325b2
 }
f325b2
 
f325b2
-- 
f325b2
2.12.0
f325b2