solenv/vs/LibreOffice.natvis  |    7 +++++-
 sw/source/core/draw/dpage.cxx |   48 +++++++++++++++++++++++-------------------
 2 files changed, 33 insertions(+), 22 deletions(-)

New commits:
commit 44df407f63bc20c402b513e9e38470517a775317
Author:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
AuthorDate: Thu Jul 11 16:24:47 2019 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Jul 12 07:57:17 2019 +0200

    tdf#121014 Display tooltip for URLs in Writer textboxes/shapes
    
    Change-Id: I7be36f804079bf415b1b548c997c97513f34730d
    Reviewed-on: https://gerrit.libreoffice.org/75423
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 15466ed11be8..36d887aa6cbf 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <basic/basmgr.hxx>
+#include <editeng/flditem.hxx>
 #include <vcl/imapobj.hxx>
 #include <svl/urihelper.hxx>
 #include <sfx2/sfxhelp.hxx>
@@ -164,11 +165,11 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView 
const * pView,
         SdrPageView* pPV;
         SdrObject* pObj = pView->PickObj(aPos, 0, pPV, 
SdrSearchOptions::PICKMACRO);
         SwVirtFlyDrawObj* pDrawObj = dynamic_cast<SwVirtFlyDrawObj*>(pObj);
+        OUString sText;
         if (pDrawObj)
         {
             SwFlyFrame *pFly = pDrawObj->GetFlyFrame();
             const SwFormatURL &rURL = pFly->GetFormat()->GetURL();
-            OUString sText;
             if( rURL.GetMap() )
             {
                 IMapObject *pTmpObj = pFly->GetFormat()->GetIMapObject( aPos, 
pFly );
@@ -200,29 +201,34 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView 
const * pView,
                           + "," + OUString::number( aPt.getY() );
                 }
             }
-
-            if ( !sText.isEmpty() )
+        }
+        else
+        {
+            SdrViewEvent aVEvt;
+            MouseEvent 
aMEvt(pWindow->ScreenToOutputPixel(rEvt.GetMousePosPixel()), 1,
+                             MouseEventModifiers::NONE, MOUSE_LEFT);
+            pView->PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
+            if (aVEvt.eEvent == SdrEventKind::ExecuteUrl)
             {
-                // #i80029#
-                bool bExecHyperlinks = pDoc->GetDocShell()->IsReadOnly();
-                if ( !bExecHyperlinks )
-                {
-                    sText = SfxHelp::GetURLHelpText(sText);
-                }
-
-                // then display the help:
-                tools::Rectangle aRect( rEvt.GetMousePosPixel(), Size(1,1) );
-                if( rEvt.GetMode() & HelpEventMode::BALLOON )
-                {
-                    Help::ShowBalloon( pWindow, rEvt.GetMousePosPixel(), 
aRect, sText );
-                }
-                else
-                {
-                    Help::ShowQuickHelp( pWindow, aRect, sText );
-                }
-                bContinue = false;
+                sText = aVEvt.pURLField->GetURL();
             }
         }
+
+        if (!sText.isEmpty())
+        {
+            // #i80029#
+            bool bExecHyperlinks = pDoc->GetDocShell()->IsReadOnly();
+            if (!bExecHyperlinks)
+                sText = SfxHelp::GetURLHelpText(sText);
+
+            // then display the help:
+            tools::Rectangle aRect(rEvt.GetMousePosPixel(), Size(1, 1));
+            if (rEvt.GetMode() & HelpEventMode::BALLOON)
+                Help::ShowBalloon(pWindow, rEvt.GetMousePosPixel(), aRect, 
sText);
+            else
+                Help::ShowQuickHelp(pWindow, aRect, sText);
+            bContinue = false;
+        }
     }
 
     if( bContinue )
commit 295c3eb9f86b6928f82d79c6705daa2e0f61b5a4
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Fri Jul 12 07:42:36 2019 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Fri Jul 12 07:44:59 2019 +0200

    Natvis: improve ErrCode visualizer
    
    Change-Id: I5046a2642e2167495ea7efa0fd1b04f5e2163657
    Reviewed-on: https://gerrit.libreoffice.org/75464
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/solenv/vs/LibreOffice.natvis b/solenv/vs/LibreOffice.natvis
index a9b9f561b791..549d5c96c9c7 100644
--- a/solenv/vs/LibreOffice.natvis
+++ b/solenv/vs/LibreOffice.natvis
@@ -469,6 +469,11 @@
     </Expand>
   </Type>
   <Type Name="ErrCode">
-    <DisplayString>Area: {static_cast&lt;ErrCodeArea&gt;((m_value >> 13) &amp; 
0x01fff),en}, class: {static_cast&lt;ErrCodeClass&gt;((m_value >> 8) &amp; 
0x1f),en}, code: {m_value &amp; 0xff}</DisplayString>
+    <DisplayString Condition="m_value == 0">None</DisplayString>
+    <DisplayString IncludeView="dynamic" Condition="m_value &amp; (31UL 
&lt;&lt; 26)">dynamic: {(m_value >> 26) &amp; 31UL} </DisplayString>
+    <DisplayString IncludeView="dynamic"/>
+    <DisplayString IncludeView="detail">{{{*this,view(dynamic)}area: 
{static_cast&lt;ErrCodeArea>((m_value >> 13) &amp; 0x01fff),en}, class: 
{static_cast&lt;ErrCodeClass>((m_value >> 8) &amp; 0x1f),en}, code: {m_value 
&amp; 0xff}}}</DisplayString>
+    <DisplayString Condition="m_value &amp; 0x80000000UL">Warning: 
{*this,view(detail)}</DisplayString>
+    <DisplayString>Error: {*this,view(detail)}</DisplayString>
   </Type>
 </AutoVisualizer>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to