summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/editsh.cxx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-07-12 15:30:12 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-07-15 11:32:02 +0200
commit040f348ee00a0d01653b3071be3d9886a08f87fe (patch)
tree0959fbc683b13b76445cdb67d43781fa07620610 /sc/source/ui/view/editsh.cxx
parentf74fbba22e435852c1ee37abf4384be7db6d8607 (diff)
tdf#62561 Add remove/edit hyperlink to calc context menu
Change-Id: Idb1b96dc4e95be40a796f9178975207099101b87 Reviewed-on: https://gerrit.libreoffice.org/75497 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.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index f458a0a75b8e..c2e3e3a4c118 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -45,6 +45,7 @@
#include <editeng/wghtitem.hxx>
#include <sfx2/basedlgs.hxx>
#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
#include <sfx2/msg.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/objsh.hxx>
@@ -627,6 +628,27 @@ void ScEditShell::Execute( SfxRequest& rReq )
ScGlobal::OpenURL( pURLField->GetURL(), pURLField->GetTargetFrame() );
return;
}
+ case SID_EDIT_HYPERLINK:
+ {
+ // Ensure the field is selected first
+ pEditView->GetFieldAtCursor();
+ pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(
+ SID_HYPERLINK_DIALOG);
+ }
+ break;
+ case SID_REMOVE_HYPERLINK:
+ {
+ // Ensure the field is selected first
+ pEditView->GetFieldAtCursor();
+ const SvxURLField* pURLField = GetURLField();
+ if (pURLField)
+ {
+ ESelection aSel = pEditView->GetSelection();
+ pEditView->GetEditEngine()->QuickInsertText(pURLField->GetRepresentation(), aSel);
+ }
+
+ }
+ break;
case FN_INSERT_SOFT_HYPHEN:
lclInsertCharacter( pTableView, pTopView, CHAR_SHY );
@@ -752,6 +774,8 @@ void ScEditShell::GetState( SfxItemSet& rSet )
break;
case SID_OPEN_HYPERLINK:
+ case SID_EDIT_HYPERLINK:
+ case SID_REMOVE_HYPERLINK:
{
if ( !GetURLField() )
rSet.DisableItem( nWhich );