summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-22 14:03:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-23 10:46:05 +0100
commit0bbfb4733289782e042a76e3c87c8df6c1819c05 (patch)
tree0c355d742fd44ab859b9e77f06a80b77222b680e /slideshow
parent3c8a6b0a183e5fa78024b5e0bb83584269068c3e (diff)
loplugin:useuniqueptr in PluginSlideChange
Change-Id: I60474c40012c2afa2573bc5ba5013e46551d1309 Reviewed-on: https://gerrit.libreoffice.org/51760 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/transitions/slidetransitionfactory.cxx17
1 files changed, 3 insertions, 14 deletions
diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx
index 8b675e975d13..5ed99a951026 100644
--- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx
+++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx
@@ -154,13 +154,6 @@ public:
virtual ~PluginSlideChange() override
{
mxFactory.clear();
-
- for( const auto& pCurrView : maTransitions )
- {
- delete pCurrView;
- }
-
- maTransitions.clear();
}
bool addTransition( const UnoViewSharedPtr& rView )
@@ -173,7 +166,7 @@ public:
getEnteringBitmap(ViewEntry(rView))->getXBitmap() );
if( rTransition.is() )
- maTransitions.push_back( new TransitionViewPair( rTransition, rView ) );
+ maTransitions.emplace_back( new TransitionViewPair( rTransition, rView ) );
else
return false;
@@ -213,15 +206,11 @@ public:
SAL_INFO("slideshow", "PluginSlideChange viewRemoved");
SlideChangeBase::viewRemoved( rView );
- ::std::vector< TransitionViewPair* >::const_iterator aEnd(maTransitions.end());
- for( ::std::vector< TransitionViewPair* >::iterator aIter =maTransitions.begin();
- aIter != aEnd;
- ++aIter )
+ for( auto aIter = maTransitions.begin(); aIter != maTransitions.end(); ++aIter )
{
if( ( *aIter )->mpView == rView )
{
SAL_INFO("slideshow", "view removed" );
- delete *aIter;
maTransitions.erase( aIter );
break;
}
@@ -264,7 +253,7 @@ public:
private:
// One transition object per view
- std::vector< TransitionViewPair* > maTransitions;
+ std::vector< std::unique_ptr<TransitionViewPair> > maTransitions;
// bool
bool mbSuccess;