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>
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 198543e..b940ffe 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -326,7 +326,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
        if ( !aHelpText.isEmpty() )
        {
            tools::Rectangle aScreenRect(OutputToScreenPixel(aPixRect.TopLeft()),
                                    OutputToScreenPixel(aPixRect.BottomRight()));
                                         OutputToScreenPixel(aPixRect.BottomRight()));

            if ( rHEvt.GetMode() & HelpEventMode::BALLOON )
                Help::ShowBalloon(this,rHEvt.GetMousePosPixel(), aScreenRect, aHelpText);
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 36d887a..b5f1698 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;
        }
    }