From 2da34e265db6ca56e43d9b2ab8cee04b1cc4fb29 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 18 Jan 2017 09:48:47 +0200 Subject: new loplugin: useuniqueptr: svgio Change-Id: I645ac954ac519fe713f4347cdf69780b0f8070e4 Reviewed-on: https://gerrit.libreoffice.org/33252 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- svgio/inc/svgtextnode.hxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'svgio/inc/svgtextnode.hxx') diff --git a/svgio/inc/svgtextnode.hxx b/svgio/inc/svgtextnode.hxx index e3bd3102dd5e..db1f26076e03 100644 --- a/svgio/inc/svgtextnode.hxx +++ b/svgio/inc/svgtextnode.hxx @@ -23,6 +23,7 @@ #include #include #include +#include namespace svgio { @@ -35,7 +36,8 @@ namespace svgio SvgStyleAttributes maSvgStyleAttributes; /// variable scan values, dependent of given XAttributeList - basegfx::B2DHomMatrix* mpaTransform; + std::unique_ptr + mpaTransform; SvgTextPositions maSvgTextPositions; /// local helpers @@ -61,8 +63,8 @@ namespace svgio virtual double getCurrentFontSize() const override; /// 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 -- cgit