diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-02 14:16:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-02 17:14:36 +0200 |
commit | 5761a23608e3ed9744711666e7465d11a450dc58 (patch) | |
tree | 1054b4fdebdac3fa44a460abc1ccc8c0e6f68274 /sw | |
parent | 62b337a3d6650b8b3045dd98f59a8c0188f0a6fa (diff) |
Resolves: tdf#127924 give hyperlink tooltip an area
instead of just a point
Change-Id: Ibadecd64f3296264790373528427a7a528646c73
Reviewed-on: https://gerrit.libreoffice.org/80038
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/draw/dpage.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx index 36d887aa6cbf..b5f1698eebfe 100644 --- a/sw/source/core/draw/dpage.cxx +++ b/sw/source/core/draw/dpage.cxx @@ -166,9 +166,13 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView const * pView, SdrObject* pObj = pView->PickObj(aPos, 0, pPV, SdrSearchOptions::PICKMACRO); SwVirtFlyDrawObj* pDrawObj = dynamic_cast<SwVirtFlyDrawObj*>(pObj); OUString sText; + tools::Rectangle aPixRect; if (pDrawObj) { SwFlyFrame *pFly = pDrawObj->GetFlyFrame(); + + aPixRect = pWindow->LogicToPixel(pFly->getFrameArea().SVRect()); + const SwFormatURL &rURL = pFly->GetFormat()->GetURL(); if( rURL.GetMap() ) { @@ -211,6 +215,7 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView const * pView, if (aVEvt.eEvent == SdrEventKind::ExecuteUrl) { sText = aVEvt.pURLField->GetURL(); + aPixRect = pWindow->LogicToPixel(aVEvt.pObj->GetLogicRect()); } } @@ -222,11 +227,13 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView const * pView, sText = SfxHelp::GetURLHelpText(sText); // then display the help: - tools::Rectangle aRect(rEvt.GetMousePosPixel(), Size(1, 1)); + tools::Rectangle aScreenRect(pWindow->OutputToScreenPixel(aPixRect.TopLeft()), + pWindow->OutputToScreenPixel(aPixRect.BottomRight())); + if (rEvt.GetMode() & HelpEventMode::BALLOON) - Help::ShowBalloon(pWindow, rEvt.GetMousePosPixel(), aRect, sText); + Help::ShowBalloon(pWindow, rEvt.GetMousePosPixel(), aScreenRect, sText); else - Help::ShowQuickHelp(pWindow, aRect, sText); + Help::ShowQuickHelp(pWindow, aScreenRect, sText); bContinue = false; } } |