sd/source/ui/func/futext.cxx |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

New commits:
commit 5512ac595eb87fffda43f4dd91eaaa1ba90aac74
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Wed Jun 5 15:44:15 2019 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Mon Mar 2 08:07:47 2020 +0100

    Open links when editing the text in impress
    
    Change-Id: Ibfead6dce019400ad5fa32a5f5351fa3e8fdea7d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89538
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index b8beb4e50408..8b2b1108119b 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -262,6 +262,28 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
     SdrViewEvent aVEvt;
     SdrHitKind eHit = mpView->PickAnything(rMEvt, 
SdrMouseEventKind::BUTTONDOWN, aVEvt);
 
+    // handle URL also during the text editing
+    if (rMEvt.GetClicks() == 1 && rMEvt.IsLeft() && rMEvt.IsMod1())
+    {
+        OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
+
+        if (mxTextObj.is() && pOLV && pOLV->GetFieldUnderMousePointer())
+        {
+            const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer();
+            if (pFieldItem)
+            {
+                const SvxFieldData* pField = pFieldItem->GetField();
+
+                if (pField && dynamic_cast< const SvxURLField *>( pField ) !=  
nullptr)
+                {
+                    eHit = SdrHitKind::MarkedObject;
+                    aVEvt.eEvent = SdrEventKind::ExecuteUrl;
+                    aVEvt.pURLField = static_cast<const SvxURLField*>(pField);
+                }
+            }
+        }
+    }
+
     if (eHit == SdrHitKind::TextEdit)
     {
         // hit text -> SdrView handles event
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to