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

sw lok comments: fix sidebar width with custom zoom

Change-Id: I6772cce10d157421d983d6b93efb52bf8b95f5b8
(cherry picked from commit dc65f048)
üst 4158227d
...@@ -1865,19 +1865,19 @@ bool SwPostItMgr::HasNotes() const ...@@ -1865,19 +1865,19 @@ bool SwPostItMgr::HasNotes() const
unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const
{ {
unsigned long aWidth = (unsigned long)(mpWrtShell->GetViewOptions()->GetZoom() * 1.8); sal_uInt16 nZoom = mpWrtShell->GetViewOptions()->GetZoom();
if (comphelper::LibreOfficeKit::isActive())
{
// The output device contains the real wanted scale factor.
double fScaleX = mpWrtShell->GetOut()->GetMapMode().GetScaleX();
nZoom = fScaleX * 100;
}
unsigned long aWidth = (unsigned long)(nZoom * 1.8);
if (bPx) if (bPx)
return aWidth; return aWidth;
else else
{ return mpWrtShell->GetOut()->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 unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const
...@@ -1885,7 +1885,7 @@ unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const ...@@ -1885,7 +1885,7 @@ unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const
if (bPx) if (bPx)
return 2; return 2;
else else
return mpEditWin->PixelToLogic(Size(2,0)).Width(); return mpWrtShell->GetOut()->PixelToLogic(Size(2,0)).Width();
} }
unsigned long SwPostItMgr::GetNoteWidth() unsigned long SwPostItMgr::GetNoteWidth()
......
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