summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Johansson <sleeping.pillow@gmail.com>2015-01-15 14:43:21 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2015-01-21 14:00:53 +0000
commit2be982d5b7e3409aca610d2f6e986550f348f81f (patch)
tree1fe7a2a2107f3eb513558fdbc9ca35c37a2021a8
parent5417429d0ef2d968b227dd2a533c1bf9cb0156b9 (diff)
fdo#86844 - CONTEXT MENU: Remove hyperlink not accessible
At the moment Remove hyperlink is only shown when text is selected together with a hyperlink but not when you right click directly on a link. Let's reuse the logic from when edit hyperlink should be shown and append it to the currently working case where text and link is selected. Change-Id: I2524f1c3037f3101d24e592eadf2e7d5d66ab4f9 Reviewed-on: https://gerrit.libreoffice.org/13926 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 4f4dcd527ee4ef7365389b5a70d0f199263628e7) Reviewed-on: https://gerrit.libreoffice.org/13959 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--sw/source/uibase/shells/textsh1.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 51d9a9d030aa..b4e845040b81 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1674,7 +1674,9 @@ void SwTextShell::GetState( SfxItemSet &rSet )
rSh.GetCurAttr(aSet);
// If a hyperlink is selected, either alone or along with other text...
- if(aSet.GetItemState( RES_TXTATR_INETFMT, true ) != SfxItemState::DONTCARE || rSh.HasReadonlySel())
+ if ((aSet.GetItemState(RES_TXTATR_INETFMT, true) < SfxItemState::SET &&
+ aSet.GetItemState(RES_TXTATR_INETFMT, true) != SfxItemState::DONTCARE) ||
+ rSh.HasReadonlySel())
{
rSet.DisableItem(nWhich);
}