summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-07-12 10:37:41 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-07-15 08:53:22 +0200
commit86cb2a1f98c0585d2121e6ae34fe62f072ef9a63 (patch)
tree0942e25c030c99bf7d2efd2542b40483a2e348ef /sw/source/uibase
parent349c525fd30121ad2148f6061d155815b8c83303 (diff)
tdf#112543 Add Edit/Remove hyperlink to text boxes/shapes in Writer
Change-Id: I9052387cf39135c2324b9db03662dc0365323400 Reviewed-on: https://gerrit.libreoffice.org/75479 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/shells/drwtxtex.cxx25
1 files changed, 24 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index 16f5ca169daf..898cc8743fe5 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -47,6 +47,7 @@
#include <editeng/contouritem.hxx>
#include <editeng/postitem.hxx>
#include <editeng/frmdiritem.hxx>
+#include <editeng/urlfieldhelper.hxx>
#include <svx/svdoutl.hxx>
#include <sfx2/viewfrm.hxx>
#include <svl/stritem.hxx>
@@ -485,6 +486,21 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
}
break;
+ case FN_EDIT_HYPERLINK:
+ {
+ // Ensure the field is selected first
+ pOLV->GetFieldAtCursor();
+ GetView().GetViewFrame()->GetDispatcher()->Execute(SID_HYPERLINK_DIALOG);
+ }
+ break;
+
+ case FN_REMOVE_HYPERLINK:
+ {
+ URLFieldHelper::RemoveURLField(pSdrView->GetTextEditOutliner(),
+ pOLV);
+ }
+ break;
+
case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
// Shell switch!
@@ -884,12 +900,19 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet)
rSet.DisableItem(nWhich);
}
break;
+ case FN_REMOVE_HYPERLINK:
+ case FN_EDIT_HYPERLINK:
+ {
+ if (!URLFieldHelper::IsCursorAtURLField(pOLV))
+ rSet.DisableItem(nWhich);
+ }
+ break;
default:
nSlotId = 0; // don't know this slot
break;
}
- if (nSlotId)
+ if (nSlotId && bFlag)
rSet.Put(SfxBoolItem(nWhich, bFlag));
nWhich = aIter.NextWhich();