[Libreoffice-commits] core.git: sd/source

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 30 17:53:39 UTC 2019


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

New commits:
commit 3e4a311d22ee3f20621537db3db25f1481c9f66b
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Jun 5 15:44:15 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Aug 30 19:52:43 2019 +0200

    Open links when editing the text in impress
    
    Change-Id: Ibfead6dce019400ad5fa32a5f5351fa3e8fdea7d
    Reviewed-on: https://gerrit.libreoffice.org/78315
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index c834fd3aa4c6..fdb04d4a7894 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -253,6 +253,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


More information about the Libreoffice-commits mailing list