tdf#111707 Add 'Remove Hyperlink' to context menu in Impress
"Clear formatting" no longer removes the hyperlink, as now there is a dedicated context menu entry for this. Change-Id: Ic47795b9ecb238470f853da527c648f6edb94c09 Reviewed-on: https://gerrit.libreoffice.org/74272 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
@@ -497,6 +497,7 @@ class SvxSetItem;
|
||||
#define SID_GROUP ( SID_SVX_START + 454 )
|
||||
#define SID_UNGROUP ( SID_SVX_START + 455 )
|
||||
#define SID_SET_DEFAULT ( SID_SVX_START + 456 )
|
||||
#define SID_REMOVE_HYPERLINK ( SID_SVX_START + 457 )
|
||||
|
||||
// CAUTION! Range <457 .. 457> used by EditEngine (!)
|
||||
|
||||
|
||||
@@ -7013,6 +7013,14 @@
|
||||
<value xml:lang="en-US">Regenerate Diagram</value>
|
||||
</prop>
|
||||
</node>
|
||||
<node oor:name=".uno:RemoveHyperlink" oor:op="replace">
|
||||
<prop oor:name="Label" oor:type="xs:string">
|
||||
<value xml:lang="en-US">~Remove Hyperlink</value>
|
||||
</prop>
|
||||
<prop oor:name="Properties" oor:type="xs:int">
|
||||
<value>1</value>
|
||||
</prop>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</oor:component-data>
|
||||
|
||||
@@ -457,14 +457,6 @@
|
||||
<value>1</value>
|
||||
</prop>
|
||||
</node>
|
||||
<node oor:name=".uno:RemoveHyperlink" oor:op="replace">
|
||||
<prop oor:name="Label" oor:type="xs:string">
|
||||
<value xml:lang="en-US">Remove Hyperlink</value>
|
||||
</prop>
|
||||
<prop oor:name="Properties" oor:type="xs:int">
|
||||
<value>1</value>
|
||||
</prop>
|
||||
</node>
|
||||
<node oor:name=".uno:CopyHyperlinkLocation" oor:op="replace">
|
||||
<prop oor:name="Label" oor:type="xs:string">
|
||||
<value xml:lang="en-US">Copy Hyperlink Location</value>
|
||||
|
||||
@@ -1522,6 +1522,11 @@ interface DrawView
|
||||
ExecMethod = FuTemporary ;
|
||||
StateMethod = GetAttrState ;
|
||||
]
|
||||
SID_REMOVE_HYPERLINK // ole : no, status : ?
|
||||
[
|
||||
ExecMethod = FuTemporary ;
|
||||
StateMethod = GetAttrState ;
|
||||
]
|
||||
SID_RULER_PAGE_POS // ole : no, status : ?
|
||||
[
|
||||
ExecMethod = ExecRuler ;
|
||||
|
||||
@@ -1145,18 +1145,24 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
|
||||
rReq.Done ();
|
||||
break;
|
||||
|
||||
case SID_REMOVE_HYPERLINK:
|
||||
{
|
||||
if (mpDrawView->IsTextEdit())
|
||||
{
|
||||
Outliner* pOutl = mpDrawView->GetTextEditOutliner();
|
||||
if (pOutl)
|
||||
{
|
||||
pOutl->RemoveFields(checkSvxFieldData<SvxURLField>);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SID_SET_DEFAULT:
|
||||
{
|
||||
std::unique_ptr<SfxItemSet> pSet;
|
||||
|
||||
if (mpDrawView->IsTextEdit())
|
||||
{
|
||||
::Outliner* pOutl = mpDrawView->GetTextEditOutliner();
|
||||
if (pOutl)
|
||||
{
|
||||
pOutl->RemoveFields(checkSvxFieldData<SvxURLField>);
|
||||
}
|
||||
|
||||
pSet.reset(new SfxItemSet( GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} ));
|
||||
mpDrawView->SetAttributes( *pSet, true );
|
||||
}
|
||||
@@ -1213,7 +1219,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
|
||||
if( nLevel == 1 )
|
||||
// text frame listens on StyleSheet of level1
|
||||
pObj->NbcSetStyleSheet(pSheet, false);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,6 +482,27 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
|
||||
}
|
||||
break;
|
||||
|
||||
case SID_REMOVE_HYPERLINK:
|
||||
{
|
||||
OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
|
||||
if (pOLV)
|
||||
{
|
||||
bool bField = false;
|
||||
const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer();
|
||||
if (!pFieldItem)
|
||||
pFieldItem = pOLV->GetFieldAtSelection();
|
||||
if (pFieldItem)
|
||||
{
|
||||
const SvxFieldData* pField = pFieldItem->GetField();
|
||||
if (dynamic_cast<const SvxURLField*>(pField))
|
||||
bField = true;
|
||||
}
|
||||
if (!bField)
|
||||
rSet.DisableItem(nWhich);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SID_STYLE_WATERCAN:
|
||||
{
|
||||
std::unique_ptr<SfxPoolItem> pItem;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<menu:menuitem menu:id=".uno:OutlineBullet"/>
|
||||
<menu:menuseparator/>
|
||||
<menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
|
||||
<menu:menuitem menu:id=".uno:RemoveHyperlink"/>
|
||||
<menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
|
||||
<menu:menuseparator/>
|
||||
<menu:menuitem menu:id=".uno:SetDefault"/>
|
||||
|
||||
@@ -12047,3 +12047,20 @@ SfxVoidItem SignSignatureLine SID_SIGN_SIGNATURELINE
|
||||
ToolBoxConfig = FALSE,
|
||||
GroupId = SfxGroupId::Edit;
|
||||
]
|
||||
|
||||
SfxVoidItem RemoveHyperlink SID_REMOVE_HYPERLINK
|
||||
()
|
||||
[
|
||||
AutoUpdate = FALSE,
|
||||
FastCall = FALSE,
|
||||
ReadOnlyDoc = FALSE,
|
||||
Toggle = FALSE,
|
||||
Container = FALSE,
|
||||
RecordAbsolute = FALSE,
|
||||
RecordPerSet;
|
||||
|
||||
AccelConfig = TRUE,
|
||||
MenuConfig = TRUE,
|
||||
ToolBoxConfig = TRUE,
|
||||
GroupId = SfxGroupId::Edit;
|
||||
]
|
||||
Reference in New Issue
Block a user