summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/editsh.cxx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-07-30 11:55:34 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-08-06 10:13:00 +0200
commit967644f09b8b7abe3b86d1647820f14e0196f8b4 (patch)
treead8fadfa70a22e7711f1d19e7e0eb118422bc7c7 /sc/source/ui/view/editsh.cxx
parent960eb45ad2e21fdaec9ef39a6b83e752e95088ca (diff)
Improve hyperlink selection in sc
Change-Id: Ia8c6b9f9994cbe3e503061b4762dbd8648a4b857 Reviewed-on: https://gerrit.libreoffice.org/76598 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sc/source/ui/view/editsh.cxx')
-rw-r--r--sc/source/ui/view/editsh.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index c2e3e3a4c118..7140f7499c06 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -819,16 +819,12 @@ const SvxURLField* ScEditShell::GetURLField()
{
ScInputHandler* pHdl = GetMyInputHdl();
EditView* pActiveView = pHdl ? pHdl->GetActiveView() : pEditView;
- if ( pActiveView )
- {
- const SvxFieldItem* pFieldItem = pActiveView->GetFieldAtSelection();
- if (pFieldItem)
- {
- const SvxFieldData* pField = pFieldItem->GetField();
- if ( auto pURLField = dynamic_cast<const SvxURLField*>( pField) )
- return pURLField;
- }
- }
+ if (!pActiveView)
+ return nullptr;
+
+ const SvxFieldData* pField = pActiveView->GetFieldAtCursor();
+ if (auto pURLField = dynamic_cast<const SvxURLField*>(pField))
+ return pURLField;
return nullptr;
}