From 423d16487b6d8bc048f546017da3b8274bc289cf Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Tue, 27 Aug 2019 08:20:24 +0200 Subject: Remove duplicated sc imagemap functions Change-Id: Ie1001abb5b57e73fece9f028041e683143a7008b Reviewed-on: https://gerrit.libreoffice.org/78162 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- svx/source/sdr/misc/ImageMapInfo.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'svx/source/sdr') diff --git a/svx/source/sdr/misc/ImageMapInfo.cxx b/svx/source/sdr/misc/ImageMapInfo.cxx index ca820a240b82..39a0091116c4 100644 --- a/svx/source/sdr/misc/ImageMapInfo.cxx +++ b/svx/source/sdr/misc/ImageMapInfo.cxx @@ -23,9 +23,9 @@ #include #include #include +#include #include #include -#include SvxIMapInfo* SvxIMapInfo::GetIMapInfo(SdrObject const* pObject) { @@ -47,7 +47,8 @@ SvxIMapInfo* SvxIMapInfo::GetIMapInfo(SdrObject const* pObject) return pIMapInfo; } -IMapObject* SvxIMapInfo::GetHitIMapObject(SdrObject const* pObj, const Point& rWinPoint) +IMapObject* SvxIMapInfo::GetHitIMapObject(const SdrObject* pObj, const Point& rWinPoint, + const vcl::Window* rCmpWnd) { SvxIMapInfo* pIMapInfo = GetIMapInfo(pObj); IMapObject* pIMapObj = nullptr; @@ -58,7 +59,15 @@ IMapObject* SvxIMapInfo::GetHitIMapObject(SdrObject const* pObj, const Point& rW Size aGraphSize; Point aRelPoint(rWinPoint); ImageMap& rImageMap = const_cast(pIMapInfo->GetImageMap()); - const ::tools::Rectangle& rRect = pObj->GetLogicRect(); + tools::Rectangle& rRect = const_cast(pObj->GetLogicRect()); + + if (rCmpWnd) + { + MapMode aWndMode = rCmpWnd->GetMapMode(); + aRelPoint = rCmpWnd->LogicToLogic(rWinPoint, &aWndMode, &aMap100); + rRect = rCmpWnd->LogicToLogic(pObj->GetLogicRect(), &aWndMode, &aMap100); + } + bool bObjSupported = false; // execute HitTest -- cgit