sfx2/source/view/lokstarmathhelper.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 5e0a3293ecfba225e144241e750359b7d3998666 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Wed Apr 20 12:17:28 2022 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Sep 26 16:04:35 2022 +0200 lok: use correct window for the MapMode ... otherwise, using a zoomed document, the returned bounding box does not account for that zoom. Change-Id: Id7834bbc2bebaa923414cf029c37a8e22f9c1078 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133205 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> (cherry picked from commit 89948bd544516604af057588676b0f979f21c163) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140602 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sfx2/source/view/lokstarmathhelper.cxx b/sfx2/source/view/lokstarmathhelper.cxx index 62c2fd56b102..9a704683aaec 100644 --- a/sfx2/source/view/lokstarmathhelper.cxx +++ b/sfx2/source/view/lokstarmathhelper.cxx @@ -131,7 +131,9 @@ tools::Rectangle LokStarMathHelper::GetBoundingBox() { // In all cases, the following code fragment // returns the bounding box in twips. - const MapMode& aMapMode = pWindow->GetMapMode(); + // Note: the correct mapmode (representing document zoom) is provided by + // GraphicWindow, not WidgetWindow + const MapMode& aMapMode = GetGraphicWindow()->GetMapMode(); const auto & [ m, d ] = o3tl::getConversionMulDiv(o3tl::Length::px, o3tl::Length::twip); const Fraction& scaleX = aMapMode.GetScaleX();