diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2019-06-05 15:44:15 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-08-30 19:52:43 +0200 |
commit | 3e4a311d22ee3f20621537db3db25f1481c9f66b (patch) | |
tree | 54c801a0a2737cf56eabef7eedc298175937f44f /sd/source/ui/func | |
parent | 1928ced074260d2d40345bdf4c96767abb99bb4f (diff) |
Open links when editing the text in impress
Change-Id: Ibfead6dce019400ad5fa32a5f5351fa3e8fdea7d
Reviewed-on: https://gerrit.libreoffice.org/78315
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sd/source/ui/func')
-rw-r--r-- | sd/source/ui/func/futext.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
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 |