summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOctavio Alvarez <alvarezp@alvarezp.ods.org>2010-09-13 17:26:19 +0200
committerC├ędric Bosdonnat <cedricbosdo@openoffice.org>2010-09-13 17:26:19 +0200
commit151636e58c07b40f9ab26fb265f22a06a303a37f (patch)
treefe4f6785387aa74ecab2493930d80486d405b7d0
parente30fb4609b9d7333deb4401e0c41ee64b8da9f1b (diff)
sw-show-Remove-Hyperlink-even-with-selection.diff:
-rw-r--r--sw/source/ui/shells/textsh1.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index b13aaed44ee2..a3daee3d8222 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -1596,7 +1596,6 @@ void SwTextShell::GetState( SfxItemSet &rSet )
GetViewFrame()->GetChildWindow( nWhich ) ));
break;
case FN_EDIT_HYPERLINK:
- case FN_REMOVE_HYPERLINK:
case FN_COPY_HYPERLINK_LOCATION:
{
SfxItemSet aSet(GetPool(),
@@ -1609,6 +1608,20 @@ void SwTextShell::GetState( SfxItemSet &rSet )
}
}
break;
+ case FN_REMOVE_HYPERLINK:
+ {
+ SfxItemSet aSet(GetPool(),
+ RES_TXTATR_INETFMT,
+ RES_TXTATR_INETFMT);
+ rSh.GetCurAttr(aSet);
+
+ // If a hyperlink is selected, either alone or along with other text...
+ if( ((SFX_ITEM_DONTCARE & aSet.GetItemState( RES_TXTATR_INETFMT, TRUE )) == 0) || rSh.HasReadonlySel())
+ {
+ rSet.DisableItem(nWhich);
+ }
+ }
+ break;
case SID_TRANSLITERATE_HALFWIDTH:
case SID_TRANSLITERATE_FULLWIDTH:
case SID_TRANSLITERATE_HIRAGANA: