summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-11-10 14:08:26 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-16 11:38:23 +0100
commit0d990874e8b87e131843415c558b8dedd0efe556 (patch)
tree0fe95303267c080c95f64ab6ca246d0ccffe0c42
parent769be57ca47581ae1669b154a92eb1410c7e5f90 (diff)
sw lok: fix width of the notes sidebar
The map mode is in general disabled during tiled rendering, so mouse positions can be sent in using twips, but here we have to temporarily enable it, otherwise the width will be returned always in pixels. With this, the gray background of the sidebar has the proper width, not e.g. fifteenth of the expected value (using default zoom). Change-Id: I4380ee0ba6bcda97cf71735161dbdc826e7a2532 (cherry picked from commit 6c3dbdbccbcccf914360dac1167599c5b89446a8)
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 35152d05d242..2310dd64f4de 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -74,6 +74,7 @@
#include <i18nlangtag/mslangid.hxx>
#include <i18nlangtag/lang.h>
+#include <comphelper/lok.hxx>
#include "annotsh.hxx"
#include "swabstdlg.hxx"
@@ -1813,7 +1814,15 @@ unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const
if (bPx)
return aWidth;
else
- return mpEditWin->PixelToLogic(Size( aWidth ,0)).Width();
+ {
+ bool bEnableMapMode = comphelper::LibreOfficeKit::isActive() && !mpEditWin->IsMapModeEnabled();
+ if (bEnableMapMode)
+ mpEditWin->EnableMapMode();
+ long nRet = mpEditWin->PixelToLogic(Size(aWidth, 0)).Width();
+ if (bEnableMapMode)
+ mpEditWin->EnableMapMode(false);
+ return nRet;
+ }
}
unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const