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 /svl | |
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 'svl')
-rw-r--r-- | svl/source/items/poolitem.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index 40e9ef895d42..346e38324bce 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -129,9 +129,9 @@ void SfxPoolItem::dumpAsXml(xmlTextWriterPtr pWriter) const std::unique_ptr<SfxPoolItem> SfxPoolItem::CloneSetWhich( sal_uInt16 nNewWhich ) const { - SfxPoolItem* pItem = Clone(); + std::unique_ptr<SfxPoolItem> pItem(Clone()); pItem->SetWhich(nNewWhich); - return std::unique_ptr<SfxPoolItem>(pItem); + return pItem; } bool SfxPoolItem::IsVoidItem() const |