summaryrefslogtreecommitdiff
path: root/drawinglayer/source/animation/animationtiming.cxx
diff options
context:
space:
mode:
authorMark Page <aptitude@btconnect.com>2016-12-05 12:25:30 +0000
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-12-06 09:23:55 +0000
commit13e77648265a91ec2b7d649d30a108e4e1eff3c8 (patch)
tree807a7acaad95374f5f434c3d0a414967345abcfd /drawinglayer/source/animation/animationtiming.cxx
parent9b8fb821504079e6fb1636dad06e7644a302f39f (diff)
Use std::unique_ptr for AnimationEntry
Change-Id: Ia089be3677adadb4250003b78b7c6bc15ab8bc42 Reviewed-on: https://gerrit.libreoffice.org/31631 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer/source/animation/animationtiming.cxx')
-rw-r--r--drawinglayer/source/animation/animationtiming.cxx30
1 files changed, 13 insertions, 17 deletions
diff --git a/drawinglayer/source/animation/animationtiming.cxx b/drawinglayer/source/animation/animationtiming.cxx
index 72400c1cd5dd..683c5f5b830c 100644
--- a/drawinglayer/source/animation/animationtiming.cxx
+++ b/drawinglayer/source/animation/animationtiming.cxx
@@ -19,7 +19,7 @@
#include <drawinglayer/animation/animationtiming.hxx>
#include <basegfx/numeric/ftools.hxx>
-
+#include <o3tl/make_unique.hxx>
namespace drawinglayer
{
@@ -46,9 +46,9 @@ namespace drawinglayer
{
}
- AnimationEntry* AnimationEntryFixed::clone() const
+ std::unique_ptr<AnimationEntry> AnimationEntryFixed::clone() const
{
- return new AnimationEntryFixed(mfDuration, mfState);
+ return o3tl::make_unique<AnimationEntryFixed>(mfDuration, mfState);
}
bool AnimationEntryFixed::operator==(const AnimationEntry& rCandidate) const
@@ -95,9 +95,9 @@ namespace drawinglayer
{
}
- AnimationEntry* AnimationEntryLinear::clone() const
+ std::unique_ptr<AnimationEntry> AnimationEntryLinear::clone() const
{
- return new AnimationEntryLinear(mfDuration, mfFrequency, mfStart, mfStop);
+ return o3tl::make_unique<AnimationEntryLinear>(mfDuration, mfFrequency, mfStart, mfStop);
}
bool AnimationEntryLinear::operator==(const AnimationEntry& rCandidate) const
@@ -178,22 +178,18 @@ namespace drawinglayer
AnimationEntryList::~AnimationEntryList()
{
- for(AnimationEntry* i : maEntries)
- {
- delete i;
- }
}
- AnimationEntry* AnimationEntryList::clone() const
+ std::unique_ptr<AnimationEntry> AnimationEntryList::clone() const
{
- AnimationEntryList* pNew = new AnimationEntryList();
+ std::unique_ptr<AnimationEntryList> pNew(o3tl::make_unique<AnimationEntryList>());
- for(AnimationEntry* i : maEntries)
+ for(const auto &i : maEntries)
{
pNew->append(*i);
}
- return pNew;
+ return std::move(pNew);
}
bool AnimationEntryList::operator==(const AnimationEntry& rCandidate) const
@@ -277,16 +273,16 @@ namespace drawinglayer
{
}
- AnimationEntry* AnimationEntryLoop::clone() const
+ std::unique_ptr<AnimationEntry> AnimationEntryLoop::clone() const
{
- AnimationEntryLoop* pNew = new AnimationEntryLoop(mnRepeat);
+ std::unique_ptr<AnimationEntryLoop> pNew(o3tl::make_unique<AnimationEntryLoop>(mnRepeat));
- for(AnimationEntry* i : maEntries)
+ for(const auto &i : maEntries)
{
pNew->append(*i);
}
- return pNew;
+ return std::move(pNew);
}
bool AnimationEntryLoop::operator==(const AnimationEntry& rCandidate) const