Kaydet (Commit) ade5aa14 authored tarafından Miklos Vajna's avatar Miklos Vajna

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
(cherry picked from commit acec324b0c753877cf913e8064c02603307b5ebb)
üst f326e5b1
...@@ -1865,10 +1865,11 @@ bool SwPostItMgr::HasNotes() const ...@@ -1865,10 +1865,11 @@ bool SwPostItMgr::HasNotes() const
unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const
{ {
bool bEnableMapMode = !mpWrtShell->GetOut()->IsMapModeEnabled();
sal_uInt16 nZoom = mpWrtShell->GetViewOptions()->GetZoom(); 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(); double fScaleX = mpWrtShell->GetOut()->GetMapMode().GetScaleX();
nZoom = fScaleX * 100; nZoom = fScaleX * 100;
} }
...@@ -1877,7 +1878,15 @@ unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const ...@@ -1877,7 +1878,15 @@ unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const
if (bPx) if (bPx)
return aWidth; return aWidth;
else 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 unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment