summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-09 13:43:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-14 11:19:21 +0200
commit6e32a6575bd375ab3a5212fe07d3fb2525338ee6 (patch)
tree03b58f370592b7b1cc49fd3d4c4806f394a9d34c /editeng
parent3f32388fd4ed343ff1e3036edfc7f97127202949 (diff)
loplugin:useuniqueptr in SvxItemPropertySet
Change-Id: Ie4fa2f1a9d1cea52936f978a4dcbcaf1a616df2a Reviewed-on: https://gerrit.libreoffice.org/54179 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/uno/unoipset.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index 01e014a47530..f7b503fccdae 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -54,7 +54,7 @@ SvxItemPropertySet::~SvxItemPropertySet()
uno::Any* SvxItemPropertySet::GetUsrAnyForID(sal_uInt16 nWID) const
{
- for (SvxIDPropertyCombine* pActual : aCombineList)
+ for (auto const & pActual : aCombineList)
{
if( pActual->nWID == nWID )
return &pActual->aAny;
@@ -65,17 +65,15 @@ uno::Any* SvxItemPropertySet::GetUsrAnyForID(sal_uInt16 nWID) const
void SvxItemPropertySet::AddUsrAnyForID(const uno::Any& rAny, sal_uInt16 nWID)
{
- SvxIDPropertyCombine* pNew = new SvxIDPropertyCombine;
+ std::unique_ptr<SvxIDPropertyCombine> pNew(new SvxIDPropertyCombine);
pNew->nWID = nWID;
pNew->aAny = rAny;
- aCombineList.push_back( pNew );
+ aCombineList.push_back( std::move(pNew) );
}
void SvxItemPropertySet::ClearAllUsrAny()
{
- for (SvxIDPropertyCombine* i : aCombineList)
- delete i;
aCombineList.clear();
}