diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-11-06 12:02:06 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-11-08 09:33:13 +0100 |
commit | a70d007ad6fef6820154c394d802e66491dc1576 (patch) | |
tree | b3dacaae549098db6d969fddd4d3c70f6e9c8328 /sw | |
parent | c6e7a70d2afea8b9641c515bf40c1e4c97e54bf5 (diff) |
Revert "tdf#120734 Only enable "Remove hyperlink" when hyperlink selected"
This reverts commit cae4b4951f061a67fab779493e6992d9097f4a4d.
Change-Id: I06f6a828e2766058b90dde14e8efbe5759867084
Reviewed-on: https://gerrit.libreoffice.org/82228
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index cf45dc26e513..9f7dee3aeb2b 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1793,7 +1793,6 @@ void SwTextShell::GetState( SfxItemSet &rSet ) break; case SID_EDIT_HYPERLINK: - case SID_REMOVE_HYPERLINK: case SID_COPY_HYPERLINK_LOCATION: { SfxItemSet aSet(GetPool(), @@ -1806,6 +1805,22 @@ void SwTextShell::GetState( SfxItemSet &rSet ) } } break; + case SID_REMOVE_HYPERLINK: + { + SfxItemSet aSet(GetPool(), + svl::Items<RES_TXTATR_INETFMT, + RES_TXTATR_INETFMT>{}); + rSh.GetCurAttr(aSet); + + // If a hyperlink is selected, either alone or along with other text... + if ((aSet.GetItemState(RES_TXTATR_INETFMT) < SfxItemState::SET && + aSet.GetItemState(RES_TXTATR_INETFMT) != SfxItemState::DONTCARE) || + rSh.HasReadonlySel()) + { + rSet.DisableItem(nWhich); + } + } + break; case SID_TRANSLITERATE_HALFWIDTH: case SID_TRANSLITERATE_FULLWIDTH: case SID_TRANSLITERATE_HIRAGANA: |