summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-07-13 11:52:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-07-13 17:58:23 +0200
commitdeb9236d71dddbda6517bdc3a6f0911d38a77113 (patch)
tree4abbf557379908054cdedaa6a398c6d17bc25068
parent5eae366cbdfb4c2e9f7a9b88257d12c400831456 (diff)
remove very dodgy const_cast in SvxIMapInfo::GetHitIMapObject
This code has been here since commit 8a6861a404c082226b52df335e3b0046164e6432 Author: Jens-Heiner Rechtien <hr@openoffice.org> Date: Mon Sep 18 23:16:46 2000 +0000 initial import but it really does not seem likely that it actually wants to update the internal LogicRect of the svx object. Change-Id: If0523c1e353faf96ca70c6afb3c0125472ca256d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154382 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--svx/source/sdr/misc/ImageMapInfo.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/svx/source/sdr/misc/ImageMapInfo.cxx b/svx/source/sdr/misc/ImageMapInfo.cxx
index a37e65247815..1d5600810f09 100644
--- a/svx/source/sdr/misc/ImageMapInfo.cxx
+++ b/svx/source/sdr/misc/ImageMapInfo.cxx
@@ -58,13 +58,13 @@ IMapObject* SvxIMapInfo::GetHitIMapObject(const SdrObject* pObj, const Point& rW
Size aGraphSize;
Point aRelPoint(rWinPoint);
ImageMap& rImageMap = const_cast<ImageMap&>(pIMapInfo->GetImageMap());
- tools::Rectangle& rRect = const_cast<tools::Rectangle&>(pObj->GetLogicRect());
+ tools::Rectangle aRect = pObj->GetLogicRect();
if (pCmpWnd)
{
MapMode aWndMode = pCmpWnd->GetMapMode();
aRelPoint = pCmpWnd->LogicToLogic(rWinPoint, &aWndMode, &aMap100);
- rRect = pCmpWnd->LogicToLogic(pObj->GetLogicRect(), &aWndMode, &aMap100);
+ aRect = pCmpWnd->LogicToLogic(pObj->GetLogicRect(), &aWndMode, &aMap100);
}
bool bObjSupported = false;
@@ -78,16 +78,16 @@ IMapObject* SvxIMapInfo::GetHitIMapObject(const SdrObject* pObj, const Point& rW
// Undo rotation
if (rGeo.m_nRotationAngle)
- RotatePoint(aRelPoint, rRect.TopLeft(), -rGeo.mfSinRotationAngle,
+ RotatePoint(aRelPoint, aRect.TopLeft(), -rGeo.mfSinRotationAngle,
rGeo.mfCosRotationAngle);
// Undo mirroring
if (pGeoData->bMirrored)
- aRelPoint.setX(rRect.Right() + rRect.Left() - aRelPoint.X());
+ aRelPoint.setX(aRect.Right() + aRect.Left() - aRelPoint.X());
// Undo shearing
if (rGeo.m_nShearAngle)
- ShearPoint(aRelPoint, rRect.TopLeft(), -rGeo.mfTanShearAngle);
+ ShearPoint(aRelPoint, aRect.TopLeft(), -rGeo.mfTanShearAngle);
if (pGrafObj->GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel)
aGraphSize = Application::GetDefaultDevice()->PixelToLogic(
@@ -108,8 +108,8 @@ IMapObject* SvxIMapInfo::GetHitIMapObject(const SdrObject* pObj, const Point& rW
if (bObjSupported)
{
// Calculate relative position of mouse cursor
- aRelPoint -= rRect.TopLeft();
- pIMapObj = rImageMap.GetHitIMapObject(aGraphSize, rRect.GetSize(), aRelPoint);
+ aRelPoint -= aRect.TopLeft();
+ pIMapObj = rImageMap.GetHitIMapObject(aGraphSize, aRect.GetSize(), aRelPoint);
// We don't care about deactivated objects
if (pIMapObj && !pIMapObj->IsActive())