Blame SOURCES/0337-sw-lok-comments-fix-sidebar-width-with-custom-zoom.patch

135360
From a1641176c666645a2c61b3b9ebcba05f01350c12 Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Mon, 16 Nov 2015 16:30:21 +0100
135360
Subject: [PATCH 337/398] sw lok comments: fix sidebar width with custom zoom
135360
135360
Change-Id: I6772cce10d157421d983d6b93efb52bf8b95f5b8
135360
(cherry picked from commit dc65f048fd1b08d17e71e4d3a3a3c114aae871e6)
135360
---
135360
 sw/source/uibase/docvw/PostItMgr.cxx | 22 +++++++++++-----------
135360
 1 file changed, 11 insertions(+), 11 deletions(-)
135360
135360
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
135360
index 871a642d24da..fa82556554d1 100644
135360
--- a/sw/source/uibase/docvw/PostItMgr.cxx
135360
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
135360
@@ -1865,19 +1865,19 @@ bool SwPostItMgr::HasNotes() const
135360
 
135360
 unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const
135360
 {
135360
-    unsigned long aWidth = (unsigned long)(mpWrtShell->GetViewOptions()->GetZoom() * 1.8);
135360
+    sal_uInt16 nZoom = mpWrtShell->GetViewOptions()->GetZoom();
135360
+    if (comphelper::LibreOfficeKit::isActive())
135360
+    {
135360
+        // The output device contains the real wanted scale factor.
135360
+        double fScaleX = mpWrtShell->GetOut()->GetMapMode().GetScaleX();
135360
+        nZoom = fScaleX * 100;
135360
+    }
135360
+    unsigned long aWidth = (unsigned long)(nZoom * 1.8);
135360
+
135360
     if (bPx)
135360
         return aWidth;
135360
     else
135360
-    {
135360
-        bool bEnableMapMode = comphelper::LibreOfficeKit::isActive() && !mpEditWin->IsMapModeEnabled();
135360
-        if (bEnableMapMode)
135360
-            mpEditWin->EnableMapMode();
135360
-        long nRet = mpEditWin->PixelToLogic(Size(aWidth, 0)).Width();
135360
-        if (bEnableMapMode)
135360
-            mpEditWin->EnableMapMode(false);
135360
-        return nRet;
135360
-    }
135360
+        return mpWrtShell->GetOut()->PixelToLogic(Size(aWidth, 0)).Width();
135360
 }
135360
 
135360
 unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const
135360
@@ -1885,7 +1885,7 @@ unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const
135360
     if (bPx)
135360
         return 2;
135360
     else
135360
-        return mpEditWin->PixelToLogic(Size(2,0)).Width();
135360
+        return mpWrtShell->GetOut()->PixelToLogic(Size(2,0)).Width();
135360
 }
135360
 
135360
 unsigned long SwPostItMgr::GetNoteWidth()
135360
-- 
135360
2.12.0
135360