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

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