diff options
author | rash419 <rashesh.padia@collabora.com> | 2022-09-15 18:02:06 +0530 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-12-02 08:33:57 +0000 |
commit | c88d891cead135731a18d025698c1213de98b573 (patch) | |
tree | 8564fc3e9d4ca1f048804ea2ee65e3e3a8001f33 /svx/source | |
parent | 4affd6a5472c71d9070402d3b84b9b3d2865f9a7 (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>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143556
Tested-by: Jenkins
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/items/hlnkitem.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx index fa635b22b13c..93ef9f6d6da5 100644 --- a/svx/source/items/hlnkitem.cxx +++ b/svx/source/items/hlnkitem.cxx @@ -34,6 +34,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() ) ); @@ -42,12 +43,13 @@ SvxHyperlinkItem::SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem ): SvxHyperlinkItem::SvxHyperlinkItem( TypedWhichId<SvxHyperlinkItem> _nWhich, OUString aName, OUString aURL, OUString aTarget, OUString aIntName, SvxLinkInsertMode eTyp, - HyperDialogEvent nEvents, SvxMacroTableDtor const *pMacroTbl ): + HyperDialogEvent nEvents, SvxMacroTableDtor const *pMacroTbl, OUString aReplacementText): SfxPoolItem (_nWhich), sName (std::move(aName)), sURL (std::move(aURL)), sTarget (std::move(aTarget)), eType (eTyp), + sReplacementText (std::move(aReplacementText)), sIntName (std::move(aIntName)), nMacroEvents (nEvents) { @@ -71,7 +73,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; @@ -136,6 +139,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; } @@ -175,6 +181,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; } |