f325b2
From b2abef914624cfb7d0fd5f75d098fe37cabaf3d6 Mon Sep 17 00:00:00 2001
f325b2
From: Miklos Vajna <vmiklos@collabora.co.uk>
f325b2
Date: Tue, 10 Nov 2015 14:08:26 +0100
f325b2
Subject: [PATCH 297/398] sw lok: fix width of the notes sidebar
f325b2
f325b2
The map mode is in general disabled during tiled rendering, so mouse
f325b2
positions can be sent in using twips, but here we have to temporarily
f325b2
enable it, otherwise the width will be returned always in pixels.
f325b2
f325b2
With this, the gray background of the sidebar has the proper width, not
f325b2
e.g. fifteenth of the expected value (using default zoom).
f325b2
f325b2
Change-Id: I4380ee0ba6bcda97cf71735161dbdc826e7a2532
f325b2
(cherry picked from commit 6c3dbdbccbcccf914360dac1167599c5b89446a8)
f325b2
---
f325b2
 sw/source/uibase/docvw/PostItMgr.cxx | 11 ++++++++++-
f325b2
 1 file changed, 10 insertions(+), 1 deletion(-)
f325b2
f325b2
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
f325b2
index 35152d05d242..2310dd64f4de 100644
f325b2
--- a/sw/source/uibase/docvw/PostItMgr.cxx
f325b2
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
f325b2
@@ -74,6 +74,7 @@
f325b2
 
f325b2
 #include <i18nlangtag/mslangid.hxx>
f325b2
 #include <i18nlangtag/lang.h>
f325b2
+#include <comphelper/lok.hxx>
f325b2
 
f325b2
 #include "annotsh.hxx"
f325b2
 #include "swabstdlg.hxx"
f325b2
@@ -1813,7 +1814,15 @@ unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const
f325b2
     if (bPx)
f325b2
         return aWidth;
f325b2
     else
f325b2
-        return mpEditWin->PixelToLogic(Size( aWidth ,0)).Width();
f325b2
+    {
f325b2
+        bool bEnableMapMode = comphelper::LibreOfficeKit::isActive() && !mpEditWin->IsMapModeEnabled();
f325b2
+        if (bEnableMapMode)
f325b2
+            mpEditWin->EnableMapMode();
f325b2
+        long nRet = mpEditWin->PixelToLogic(Size(aWidth, 0)).Width();
f325b2
+        if (bEnableMapMode)
f325b2
+            mpEditWin->EnableMapMode(false);
f325b2
+        return nRet;
f325b2
+    }
f325b2
 }
f325b2
 
f325b2
 unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const
f325b2
-- 
f325b2
2.12.0
f325b2