diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-26 12:06:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-26 13:30:49 +0200 |
commit | 4054dff516367b332b7e3ce6fa91a452bf690571 (patch) | |
tree | 74ce35623e84933e4da9b134855ac1c74c4bce1d /sc/source/ui/unoobj/defltuno.cxx | |
parent | c0cc59adca23580864a2e5cdadf66212246cbfcc (diff) |
use unique_ptr when Clone()'ing PoolItems
and fix a handful of small leaks in the process
Change-Id: I876e12ff5305f9dda84532d4182fb91657d6fa0c
Reviewed-on: https://gerrit.libreoffice.org/62389
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj/defltuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/defltuno.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx index 87867b79f929..bec8a82e0429 100644 --- a/sc/source/ui/unoobj/defltuno.cxx +++ b/sc/source/ui/unoobj/defltuno.cxx @@ -186,13 +186,12 @@ void SAL_CALL ScDocDefaultsObj::setPropertyValue( else { ScDocumentPool* pPool = pDocShell->GetDocument().GetPool(); - SfxPoolItem* pNewItem = pPool->GetDefaultItem(pEntry->nWID).Clone(); + std::unique_ptr<SfxPoolItem> pNewItem(pPool->GetDefaultItem(pEntry->nWID).Clone()); if( !pNewItem->PutValue( aValue, pEntry->nMemberId ) ) throw lang::IllegalArgumentException(); pPool->SetPoolDefaultItem( *pNewItem ); - delete pNewItem; // copied in SetPoolDefaultItem ItemsChanged(); } |