diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-18 09:48:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-19 05:40:55 +0000 |
commit | 2da34e265db6ca56e43d9b2ab8cee04b1cc4fb29 (patch) | |
tree | e2cbed69babc7f551e0db01a9cd023db809b2204 /svgio/inc/svglinenode.hxx | |
parent | 9767537e22e178eb23872de138ea70e57c1a6725 (diff) |
new loplugin: useuniqueptr: svgio
Change-Id: I645ac954ac519fe713f4347cdf69780b0f8070e4
Reviewed-on: https://gerrit.libreoffice.org/33252
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svgio/inc/svglinenode.hxx')
-rw-r--r-- | svgio/inc/svglinenode.hxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/svgio/inc/svglinenode.hxx b/svgio/inc/svglinenode.hxx index 5f595888ea27..1611e22602cf 100644 --- a/svgio/inc/svglinenode.hxx +++ b/svgio/inc/svglinenode.hxx @@ -22,6 +22,7 @@ #include <svgnode.hxx> #include <svgstyleattributes.hxx> +#include <memory> namespace svgio { @@ -38,7 +39,7 @@ namespace svgio SvgNumber maY1; SvgNumber maX2; SvgNumber maY2; - basegfx::B2DHomMatrix* mpaTransform; + std::unique_ptr<basegfx::B2DHomMatrix> mpaTransform; public: SvgLineNode( @@ -63,8 +64,8 @@ namespace svgio const SvgNumber& getY2() const { return maY2; } /// transform content, set if found in current context - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform.get(); } + void setTransform(const basegfx::B2DHomMatrix* pMatrix) { mpaTransform.reset(); if(pMatrix) mpaTransform.reset( new basegfx::B2DHomMatrix(*pMatrix) ); } }; } // end of namespace svgreader } // end of namespace svgio |