diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-08-27 08:20:24 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-08-27 14:40:36 +0200 |
commit | 423d16487b6d8bc048f546017da3b8274bc289cf (patch) | |
tree | 72177a5c84d02d5f6335e3ea68f05dfc4f55166a /svx/source/sdr | |
parent | 3005c107f356ead72d18b5136361e75d82ab1dff (diff) |
Remove duplicated sc imagemap functions
Change-Id: Ie1001abb5b57e73fece9f028041e683143a7008b
Reviewed-on: https://gerrit.libreoffice.org/78162
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'svx/source/sdr')
-rw-r--r-- | svx/source/sdr/misc/ImageMapInfo.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
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 <svx/svdograf.hxx> #include <svx/svdoole2.hxx> #include <svx/unoshape.hxx> +#include <vcl/imapobj.hxx> #include <vcl/svapp.hxx> #include <vcl/window.hxx> -#include <vcl/imapobj.hxx> 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<ImageMap&>(pIMapInfo->GetImageMap()); - const ::tools::Rectangle& rRect = pObj->GetLogicRect(); + tools::Rectangle& rRect = const_cast<tools::Rectangle&>(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 |