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