summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2018-06-30 20:37:47 +0200
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2018-06-30 23:07:54 +0200
commitefd08467b41365dff4a270393efb588de765eaef (patch)
tree8d785ed887cb464a31e0c20e8722481ab3b7e0db /vcl
parenta272704cb04fee27a5934433fe59a006b2ddaf0e (diff)
cppcheck: variableScope
and use unique_ptr for vector elements Change-Id: I5421a53e96928699fd451d4ff3e2eef0bf847f42 Reviewed-on: https://gerrit.libreoffice.org/56772 Tested-by: Jenkins Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/animate.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 71028e5b41c5..6896b1736a48 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -326,7 +326,6 @@ void Animation::ImplRestartTimer( sal_uLong nTimeout )
IMPL_LINK_NOARG(Animation, ImplTimeoutHdl, Timer *, void)
{
const size_t nAnimCount = maList.size();
- std::vector< AInfo* > aAInfoList;
if( nAnimCount )
{
@@ -335,14 +334,15 @@ IMPL_LINK_NOARG(Animation, ImplTimeoutHdl, Timer *, void)
if( maNotifyLink.IsSet() )
{
+ std::vector< std::unique_ptr<AInfo> > aAInfoList;
// create AInfo-List
for(auto const & i : maViewList)
- aAInfoList.push_back( i->createAInfo() );
+ aAInfoList.emplace_back( i->createAInfo() );
maNotifyLink.Call( this );
// set view state from AInfo structure
- for(AInfo* pAInfo : aAInfoList)
+ for(auto& pAInfo : aAInfoList)
{
if( !pAInfo->pViewData )
{
@@ -358,11 +358,6 @@ IMPL_LINK_NOARG(Animation, ImplTimeoutHdl, Timer *, void)
pView->setMarked( true );
}
- // delete AInfo structures
- for(AInfo* i : aAInfoList)
- delete i;
- aAInfoList.clear();
-
// delete all unmarked views and reset marked state
for( size_t i = 0; i < maViewList.size(); )
{