summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-04-20 12:17:28 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-04-20 13:07:08 +0200
commit89948bd544516604af057588676b0f979f21c163 (patch)
tree7d5a003a52a29f4fd48679ceddf770e82ddae4a5 /sfx2
parent65075a76ff177ac40df726b2174297c8c774fbaa (diff)
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.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/lokstarmathhelper.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sfx2/source/view/lokstarmathhelper.cxx b/sfx2/source/view/lokstarmathhelper.cxx
index 885decdc2fea..9df48759528d 100644
--- a/sfx2/source/view/lokstarmathhelper.cxx
+++ b/sfx2/source/view/lokstarmathhelper.cxx
@@ -122,7 +122,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();