diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-03 21:35:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-04 09:12:10 +0200 |
commit | 2d1d1279790807235b1edcee8f807d594636fda7 (patch) | |
tree | e330b92efc133f69b5445474a574c90caaabb9f6 /vcl/source/window | |
parent | 42bbc9fbdf940e55213ee2a259c1d31de2e4cbec (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/window.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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<vcl::Window*>(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<vcl::Window*>(this)->ImplGetUnmirroredOutOffX(); + tools::Long offx = ImplGetUnmirroredOutOffX(); return Point( rPos.X()-offx, rPos.Y() - GetOutDev()->mnOutOffY ); } |