diff options
author | Mark Page <aptitude@btconnect.com> | 2016-12-05 12:25:30 +0000 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-06 09:23:55 +0000 |
commit | 13e77648265a91ec2b7d649d30a108e4e1eff3c8 (patch) | |
tree | 807a7acaad95374f5f434c3d0a414967345abcfd /include | |
parent | 9b8fb821504079e6fb1636dad06e7644a302f39f (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 'include')
-rw-r--r-- | include/drawinglayer/animation/animationtiming.hxx | 13 | ||||
-rw-r--r-- | include/drawinglayer/primitive2d/animatedprimitive2d.hxx | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/include/drawinglayer/animation/animationtiming.hxx b/include/drawinglayer/animation/animationtiming.hxx index 4514349744aa..67d13eeede0b 100644 --- a/include/drawinglayer/animation/animationtiming.hxx +++ b/include/drawinglayer/animation/animationtiming.hxx @@ -23,6 +23,7 @@ #include <drawinglayer/drawinglayerdllapi.h> #include <vector> +#include <memory> namespace drawinglayer @@ -40,7 +41,7 @@ namespace drawinglayer public: AnimationEntry(); virtual ~AnimationEntry(); - virtual AnimationEntry* clone() const = 0; + virtual std::unique_ptr<AnimationEntry> clone() const = 0; virtual bool operator==(const AnimationEntry& rCandidate) const = 0; virtual double getDuration() const = 0; @@ -58,7 +59,7 @@ namespace drawinglayer public: AnimationEntryFixed(double fDuration, double fState); virtual ~AnimationEntryFixed() override; - virtual AnimationEntry* clone() const override; + virtual std::unique_ptr<AnimationEntry> clone() const override; virtual bool operator==(const AnimationEntry& rCandidate) const override; virtual double getDuration() const override; @@ -78,7 +79,7 @@ namespace drawinglayer public: AnimationEntryLinear(double fDuration, double fFrequency, double fStart, double fStop); virtual ~AnimationEntryLinear() override; - virtual AnimationEntry* clone() const override; + virtual std::unique_ptr<AnimationEntry> clone() const override; virtual bool operator==(const AnimationEntry& rCandidate) const override; virtual double getDuration() const override; @@ -91,7 +92,7 @@ namespace drawinglayer { protected: double mfDuration; - ::std::vector< AnimationEntry* > maEntries; + ::std::vector< std::unique_ptr<AnimationEntry> > maEntries; // helpers sal_uInt32 impGetIndexAtTime(double fTime, double &rfAddedTime) const; @@ -99,7 +100,7 @@ namespace drawinglayer public: AnimationEntryList(); virtual ~AnimationEntryList() override; - virtual AnimationEntry* clone() const override; + virtual std::unique_ptr<AnimationEntry> clone() const override; virtual bool operator==(const AnimationEntry& rCandidate) const override; void append(const AnimationEntry& rCandidate); @@ -117,7 +118,7 @@ namespace drawinglayer public: AnimationEntryLoop(sal_uInt32 nRepeat); virtual ~AnimationEntryLoop() override; - virtual AnimationEntry* clone() const override; + virtual std::unique_ptr<AnimationEntry> clone() const override; virtual bool operator==(const AnimationEntry& rCandidate) const override; virtual double getDuration() const override; diff --git a/include/drawinglayer/primitive2d/animatedprimitive2d.hxx b/include/drawinglayer/primitive2d/animatedprimitive2d.hxx index 580271bac434..0e86019b8f4b 100644 --- a/include/drawinglayer/primitive2d/animatedprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/animatedprimitive2d.hxx @@ -25,7 +25,7 @@ #include <drawinglayer/primitive2d/groupprimitive2d.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> - +#include <memory> // predefines namespace drawinglayer { namespace animation { @@ -58,7 +58,7 @@ namespace drawinglayer to an animation state [0.0 .. 1.0]. This member contains a cloned definition and is owned by this implementation. */ - animation::AnimationEntry* mpAnimationEntry; + std::unique_ptr<animation::AnimationEntry> mpAnimationEntry; /** flag if this is a text or graphic animation. Necessary since SdrViews need to differentiate between both types if they are on/off |