summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/editsh.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/editsh.cxx')
-rw-r--r--sc/source/ui/view/editsh.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index f15ee1903f12..75080dce163e 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -639,6 +639,12 @@ void ScEditShell::Execute( SfxRequest& rReq )
}
}
break;
+ case SID_INSERT_HYPERLINK:
+ {
+ rViewData.GetViewShell()->GetViewFrame().GetDispatcher()->Execute(
+ SID_HYPERLINK_DIALOG);
+ }
+ break;
case SID_EDIT_HYPERLINK:
{
// Ensure the field is selected first
@@ -823,6 +829,16 @@ void ScEditShell::GetState( SfxItemSet& rSet )
}
break;
+ case SID_INSERT_HYPERLINK:
+ {
+ // Disable insert hyperlink if no text is selected or cursor is at a URL field
+ ESelection aSel( pActiveView->GetSelection() );
+ if (!aSel.HasRange() || URLFieldHelper::IsCursorAtURLField(*pEditView,
+ /*AlsoCheckBeforeCursor=*/true))
+ rSet.DisableItem (nWhich);
+ }
+ break;
+
case SID_EDIT_HYPERLINK:
case SID_COPY_HYPERLINK_LOCATION:
case SID_REMOVE_HYPERLINK: