summaryrefslogtreecommitdiff
path: root/svgio/inc/svggnode.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-18 09:48:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-19 05:40:55 +0000
commit2da34e265db6ca56e43d9b2ab8cee04b1cc4fb29 (patch)
treee2cbed69babc7f551e0db01a9cd023db809b2204 /svgio/inc/svggnode.hxx
parent9767537e22e178eb23872de138ea70e57c1a6725 (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/svggnode.hxx')
-rw-r--r--svgio/inc/svggnode.hxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/svgio/inc/svggnode.hxx b/svgio/inc/svggnode.hxx
index 6f631da1a26c..8a5000014953 100644
--- a/svgio/inc/svggnode.hxx
+++ b/svgio/inc/svggnode.hxx
@@ -22,6 +22,7 @@
#include <svgnode.hxx>
#include <svgstyleattributes.hxx>
+#include <memory>
namespace svgio
{
@@ -34,7 +35,7 @@ namespace svgio
SvgStyleAttributes maSvgStyleAttributes;
/// variable scan values, dependent of given XAttributeList
- basegfx::B2DHomMatrix* mpaTransform;
+ std::unique_ptr<basegfx::B2DHomMatrix> mpaTransform;
public:
SvgGNode(
@@ -48,8 +49,8 @@ namespace svgio
virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override;
/// transform content
- 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