summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/afmtuno.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-26 12:06:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-26 13:30:49 +0200
commit4054dff516367b332b7e3ce6fa91a452bf690571 (patch)
tree74ce35623e84933e4da9b134855ac1c74c4bce1d /sc/source/ui/unoobj/afmtuno.cxx
parentc0cc59adca23580864a2e5cdadf66212246cbfcc (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/afmtuno.cxx')
-rw-r--r--sc/source/ui/unoobj/afmtuno.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx
index d2f03486c794..1aff21e72fdb 100644
--- a/sc/source/ui/unoobj/afmtuno.cxx
+++ b/sc/source/ui/unoobj/afmtuno.cxx
@@ -659,11 +659,10 @@ void SAL_CALL ScAutoFormatFieldObj::setPropertyValue(
}
break;
default:
- SfxPoolItem* pNewItem = pItem->Clone();
+ std::unique_ptr<SfxPoolItem> pNewItem(pItem->Clone());
bDone = pNewItem->PutValue( aValue, pEntry->nMemberId );
if (bDone)
pData->PutItem( nFieldIndex, *pNewItem );
- delete pNewItem;
}
if (bDone)