summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-11-17 12:21:42 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-17 12:22:14 +0100
commit0fd381b773cb7c15c4773affd4a3b298ad38fe92 (patch)
tree5f84476460a6772b2b56f7d8deecdb6f89cb25f3 /sw
parentb5eaa0f9f00cd62f4769c3e8860d788844ccf557 (diff)
sw lok comments: fix text selection with custom zoom
SwPostItMgr::GetSidebarWidth() can be called in two scenarios: - inside PaintTile() the output device contains the zoom level and has the map mode enabled (and its scale factor is the zoom level) - outisde PaintTile() the output device is SwEditWin and has the map mode disabled (and the zoom level is to be taken from the view options) Change-Id: I6cf19f3241a2e972ae711e0efa7b0205aae1a3f2
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 2889e2171060..b18cff52beb2 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1865,10 +1865,11 @@ bool SwPostItMgr::HasNotes() const
unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const
{
+ bool bEnableMapMode = !mpWrtShell->GetOut()->IsMapModeEnabled();
sal_uInt16 nZoom = mpWrtShell->GetViewOptions()->GetZoom();
- if (comphelper::LibreOfficeKit::isActive())
+ if (comphelper::LibreOfficeKit::isActive() && !bEnableMapMode)
{
- // The output device contains the real wanted scale factor.
+ // The output device is the tile and contains the real wanted scale factor.
double fScaleX = mpWrtShell->GetOut()->GetMapMode().GetScaleX();
nZoom = fScaleX * 100;
}
@@ -1877,7 +1878,15 @@ unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const
if (bPx)
return aWidth;
else
- return mpWrtShell->GetOut()->PixelToLogic(Size(aWidth, 0)).Width();
+ {
+ if (bEnableMapMode)
+ // The output device is the window.
+ mpWrtShell->GetOut()->EnableMapMode();
+ long nRet = mpWrtShell->GetOut()->PixelToLogic(Size(aWidth, 0)).Width();
+ if (bEnableMapMode)
+ mpWrtShell->GetOut()->EnableMapMode(false);
+ return nRet;
+ }
}
unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const