diff options
author | rash419 <rashesh.padia@collabora.com> | 2022-09-15 18:02:06 +0530 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-09-27 11:15:56 +0200 |
commit | fb3597932ad9322feb58115528ca1dae070edfa5 (patch) | |
tree | 8f1e7f79de4fb6fdfc44768e5b15064d63466498 /svx/source | |
parent | d8b04077bb63f05efa256f353bfd6acb409a6983 (diff) |
svx: extended SvxHyperlinkItem to have a new property sReplacementText
this property is use to pass text that needs to be replaced when
executing uno:SetHyperlink command in online for inserting the mention
Signed-off-by: rash419 <rashesh.padia@collabora.com>
Change-Id: I48fba347bda0652f7b657524f23c2dd837cd8186
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140015
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/items/hlnkitem.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx index 7a092b36fc5a..f8500277316a 100644 --- a/svx/source/items/hlnkitem.cxx +++ b/svx/source/items/hlnkitem.cxx @@ -33,6 +33,7 @@ SvxHyperlinkItem::SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem ): eType = rHyperlinkItem.eType; sIntName = rHyperlinkItem.sIntName; nMacroEvents = rHyperlinkItem.nMacroEvents; + sReplacementText = rHyperlinkItem.sReplacementText; if( rHyperlinkItem.GetMacroTable() ) pMacroTable.reset( new SvxMacroTableDtor( *rHyperlinkItem.GetMacroTable() ) ); @@ -41,14 +42,15 @@ SvxHyperlinkItem::SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem ): SvxHyperlinkItem::SvxHyperlinkItem( sal_uInt16 _nWhich, const OUString& rName, const OUString& rURL, const OUString& rTarget, const OUString& rIntName, SvxLinkInsertMode eTyp, - HyperDialogEvent nEvents, SvxMacroTableDtor const *pMacroTbl ): + HyperDialogEvent nEvents, SvxMacroTableDtor const *pMacroTbl, const OUString& rReplacementText): SfxPoolItem (_nWhich), sName (rName), sURL (rURL), sTarget (rTarget), eType (eTyp), sIntName (rIntName), - nMacroEvents (nEvents) + nMacroEvents (nEvents), + sReplacementText (rReplacementText) { if (pMacroTbl) pMacroTable.reset( new SvxMacroTableDtor ( *pMacroTbl ) ); @@ -70,7 +72,8 @@ bool SvxHyperlinkItem::operator==( const SfxPoolItem& rAttr ) const sTarget == rItem.sTarget && eType == rItem.eType && sIntName == rItem.sIntName && - nMacroEvents == rItem.nMacroEvents); + nMacroEvents == rItem.nMacroEvents && + sReplacementText == rItem.sReplacementText); if (!bRet) return false; @@ -135,6 +138,9 @@ bool SvxHyperlinkItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) co case MID_HLINK_TYPE: rVal <<= static_cast<sal_Int32>(eType); break; + case MID_HLINK_REPLACEMENTTEXT: + rVal <<= sReplacementText; + break; default: return false; } @@ -174,6 +180,11 @@ bool SvxHyperlinkItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId return false; eType = static_cast<SvxLinkInsertMode>(static_cast<sal_uInt16>(nVal)); break; + case MID_HLINK_REPLACEMENTTEXT: + if(!(rVal >>= aStr)) + return false; + sReplacementText = aStr; + break; default: return false; } |