summaryrefslogtreecommitdiff
path: root/sfx2/source/control/bindings.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-12-19 11:00:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-12-20 10:02:54 +0100
commit146f98e7100ae57ced080c7d9fa028f01df99ca8 (patch)
treeef57681dd80fbfba0b555f4cf3a0ebf319d9865f /sfx2/source/control/bindings.cxx
parent4e6be990eaf6a524740299e8d00fb5401c1a21c0 (diff)
use unique_ptr in sfx2
Change-Id: I4e0bba9b8bebdeb9263ad71d3ab505d8beed17b7 Reviewed-on: https://gerrit.libreoffice.org/65441 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/control/bindings.cxx')
-rw-r--r--sfx2/source/control/bindings.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index c5f564444b74..e1803db01f56 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -259,7 +259,7 @@ void SfxBindings::Update_Impl(SfxStateCache& rCache /*The up to date SfxStatusCa
const SfxSlot *pRealSlot = nullptr;
const SfxSlotServer* pMsgServer = nullptr;
SfxFoundCacheArr_Impl aFound;
- SfxItemSet *pSet = CreateSet_Impl(rCache, pRealSlot, &pMsgServer, aFound);
+ std::unique_ptr<SfxItemSet> pSet = CreateSet_Impl(rCache, pRealSlot, &pMsgServer, aFound);
bool bUpdated = false;
if ( pSet )
{
@@ -280,7 +280,7 @@ void SfxBindings::Update_Impl(SfxStateCache& rCache /*The up to date SfxStatusCa
bUpdated = true;
}
- delete pSet;
+ pSet.reset();
}
if (!bUpdated)
@@ -1093,7 +1093,7 @@ void SfxBindings::UpdateSlotServer_Impl()
}
-SfxItemSet* SfxBindings::CreateSet_Impl
+std::unique_ptr<SfxItemSet> SfxBindings::CreateSet_Impl
(
SfxStateCache& rCache, // in: Status-Cache from nId
const SfxSlot*& pRealSlot, // out: RealSlot to nId
@@ -1182,7 +1182,7 @@ SfxItemSet* SfxBindings::CreateSet_Impl
pRanges[j++] = rFound[i++].nWhichId;
}
pRanges[j] = 0; // terminating NULL
- SfxItemSet *pSet = new SfxItemSet(rPool, pRanges.get());
+ std::unique_ptr<SfxItemSet> pSet(new SfxItemSet(rPool, pRanges.get()));
pRanges.reset();
return pSet;
}