From 2d1d1279790807235b1edcee8f807d594636fda7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 3 Jul 2023 21:35:14 +0200 Subject: ImplGetUnmirroredOutOffX can be const which avoids some unnecessary const_cast Change-Id: I8bf6a2ab36928dd1df302b64d9552f07f3f1003f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153932 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/source/window/window.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vcl/source/window') diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index f79918fd7f52..c07433173287 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2818,11 +2818,11 @@ Point Window::ScreenToOutputPixel( const Point& rPos ) const return Point( rPos.X() - GetOutDev()->mnOutOffX, rPos.Y() - GetOutDev()->mnOutOffY ); } -tools::Long Window::ImplGetUnmirroredOutOffX() +tools::Long Window::ImplGetUnmirroredOutOffX() const { // revert mnOutOffX changes that were potentially made in ImplPosSizeWindow tools::Long offx = GetOutDev()->mnOutOffX; - OutputDevice *pOutDev = GetOutDev(); + const OutputDevice *pOutDev = GetOutDev(); if( pOutDev->HasMirroredGraphics() ) { if( mpWindowImpl->mpParent && !mpWindowImpl->mpParent->mpWindowImpl->mbFrame && mpWindowImpl->mpParent->GetOutDev()->ImplIsAntiparallel() ) @@ -2844,14 +2844,14 @@ tools::Long Window::ImplGetUnmirroredOutOffX() Point Window::OutputToNormalizedScreenPixel( const Point& rPos ) const { // relative to top level parent - tools::Long offx = const_cast(this)->ImplGetUnmirroredOutOffX(); + tools::Long offx = ImplGetUnmirroredOutOffX(); return Point( rPos.X()+offx, rPos.Y() + GetOutDev()->mnOutOffY ); } Point Window::NormalizedScreenToOutputPixel( const Point& rPos ) const { // relative to top level parent - tools::Long offx = const_cast(this)->ImplGetUnmirroredOutOffX(); + tools::Long offx = ImplGetUnmirroredOutOffX(); return Point( rPos.X()-offx, rPos.Y() - GetOutDev()->mnOutOffY ); } -- cgit