diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-05 11:23:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-07 13:09:52 +0100 |
commit | ef83e5fba10187a0ec50dab6d381ff2d4ecdc5d2 (patch) | |
tree | 4348f55b6ee1624aaf9326f9ad8dba4cc1b12778 /svx/source/svdraw | |
parent | 420d2c48bc2afc262d04d20ecab90517d07f3aa8 (diff) |
loplugin:useuniqueptr in SdrOutlinerCache
Change-Id: Ie34f1bd9e46bf767ec2e1918c2b88cf289f4b410
Reviewed-on: https://gerrit.libreoffice.org/49330
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/svdoutlinercache.cxx | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/svx/source/svdraw/svdoutlinercache.cxx b/svx/source/svdraw/svdoutlinercache.cxx index bd95f359fe1a..419837070d4f 100644 --- a/svx/source/svdraw/svdoutlinercache.cxx +++ b/svx/source/svdraw/svdoutlinercache.cxx @@ -36,12 +36,12 @@ SdrOutliner* SdrOutlinerCache::createOutliner( OutlinerMode nOutlinerMode ) if( (OutlinerMode::OutlineObject == nOutlinerMode) && !maModeOutline.empty() ) { - pOutliner = maModeOutline.back(); + pOutliner = maModeOutline.back().release(); maModeOutline.pop_back(); } else if( (OutlinerMode::TextObject == nOutlinerMode) && !maModeText.empty() ) { - pOutliner = maModeText.back(); + pOutliner = maModeText.back().release(); maModeText.pop_back(); } else @@ -57,19 +57,6 @@ SdrOutliner* SdrOutlinerCache::createOutliner( OutlinerMode nOutlinerMode ) SdrOutlinerCache::~SdrOutlinerCache() { - for( auto candA : maModeOutline ) - { - delete candA; - } - - maModeOutline.clear(); - - for( auto candB : maModeText ) - { - delete candB; - } - - maModeText.clear(); } void SdrOutlinerCache::disposeOutliner( SdrOutliner* pOutliner ) @@ -80,7 +67,7 @@ void SdrOutlinerCache::disposeOutliner( SdrOutliner* pOutliner ) if( OutlinerMode::OutlineObject == nOutlMode ) { - maModeOutline.push_back(pOutliner); + maModeOutline.emplace_back(pOutliner); pOutliner->Clear(); pOutliner->SetVertical( false ); @@ -89,7 +76,7 @@ void SdrOutlinerCache::disposeOutliner( SdrOutliner* pOutliner ) } else if( OutlinerMode::TextObject == nOutlMode ) { - maModeText.push_back(pOutliner); + maModeText.emplace_back(pOutliner); pOutliner->Clear(); pOutliner->SetVertical( false ); |