sw/source/uibase/docvw/PostItMgr.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
New commits: commit dc65f048fd1b08d17e71e4d3a3a3c114aae871e6 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Mon Nov 16 16:30:21 2015 +0100 sw lok comments: fix sidebar width with custom zoom Change-Id: I6772cce10d157421d983d6b93efb52bf8b95f5b8 diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 662dd4a..2889e21 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -1865,19 +1865,19 @@ bool SwPostItMgr::HasNotes() 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) return aWidth; else - { - 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; - } + return mpWrtShell->GetOut()->PixelToLogic(Size(aWidth, 0)).Width(); } unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const @@ -1885,7 +1885,7 @@ unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const if (bPx) return 2; else - return mpEditWin->PixelToLogic(Size(2,0)).Width(); + return mpWrtShell->GetOut()->PixelToLogic(Size(2,0)).Width(); } unsigned long SwPostItMgr::GetNoteWidth() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits