summaryrefslogtreecommitdiff
path: root/svx/source/items/hlnkitem.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-11 13:04:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-16 06:10:36 +0000
commit0b272cdf0025ce4bca31ee01c8b3aaca042dcb62 (patch)
treee5d3ec93289598ebfe0121e7a3d0c880c3054844 /svx/source/items/hlnkitem.cxx
parent570d8dab6d6754ab8020cbe6624020dff7b8b624 (diff)
new loplugin: useuniqueptr: svx
Change-Id: I0eb3d43d7bcfc491df16a72997a0720a6aec2c5c Reviewed-on: https://gerrit.libreoffice.org/32959 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/items/hlnkitem.cxx')
-rw-r--r--svx/source/items/hlnkitem.cxx16
1 files changed, 5 insertions, 11 deletions
diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx
index 04cf184759d4..cfac4a37e620 100644
--- a/svx/source/items/hlnkitem.cxx
+++ b/svx/source/items/hlnkitem.cxx
@@ -200,9 +200,7 @@ SvxHyperlinkItem::SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem ):
nMacroEvents = rHyperlinkItem.nMacroEvents;
if( rHyperlinkItem.GetMacroTable() )
- pMacroTable = new SvxMacroTableDtor( *rHyperlinkItem.GetMacroTable() );
- else
- pMacroTable=nullptr;
+ pMacroTable.reset( new SvxMacroTableDtor( *rHyperlinkItem.GetMacroTable() ) );
};
@@ -218,9 +216,7 @@ SvxHyperlinkItem::SvxHyperlinkItem( sal_uInt16 _nWhich, const OUString& rName, c
nMacroEvents (nEvents)
{
if (pMacroTbl)
- pMacroTable = new SvxMacroTableDtor ( *pMacroTbl );
- else
- pMacroTable=nullptr;
+ pMacroTable.reset( new SvxMacroTableDtor ( *pMacroTbl ) );
}
SfxPoolItem* SvxHyperlinkItem::Clone( SfxItemPool* ) const
@@ -243,7 +239,7 @@ bool SvxHyperlinkItem::operator==( const SfxPoolItem& rAttr ) const
if (!bRet)
return false;
- const SvxMacroTableDtor* pOther = static_cast<const SvxHyperlinkItem&>(rAttr).pMacroTable;
+ const SvxMacroTableDtor* pOther = static_cast<const SvxHyperlinkItem&>(rAttr).pMacroTable.get();
if( !pMacroTable )
return ( !pOther || pOther->empty() );
if( !pOther )
@@ -273,16 +269,14 @@ void SvxHyperlinkItem::SetMacro( HyperDialogEvent nEvent, const SvxMacro& rMacro
}
if( !pMacroTable )
- pMacroTable = new SvxMacroTableDtor;
+ pMacroTable.reset( new SvxMacroTableDtor );
pMacroTable->Insert( nSfxEvent, rMacro);
}
void SvxHyperlinkItem::SetMacroTable( const SvxMacroTableDtor& rTbl )
{
- delete pMacroTable;
-
- pMacroTable = new SvxMacroTableDtor ( rTbl );
+ pMacroTable.reset( new SvxMacroTableDtor ( rTbl ) );
}
bool SvxHyperlinkItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const