sc/source/ui/view/gridwin5.cxx |    2 +-
 sw/source/core/draw/dpage.cxx  |   13 ++++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 5761a23608e3ed9744711666e7465d11a450dc58
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Oct 2 14:16:50 2019 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Oct 2 17:14:36 2019 +0200

    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 <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 198543e5ffcb..b940ffe200b1 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 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;
         }
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to