summaryrefslogtreecommitdiff
path: root/svgio/inc/svgtextnode.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/svgtextnode.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/svgtextnode.hxx')
-rw-r--r--svgio/inc/svgtextnode.hxx8
1 files changed, 5 insertions, 3 deletions
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 <svgnode.hxx>
#include <svgstyleattributes.hxx>
#include <svgcharacternode.hxx>
+#include <memory>
namespace svgio
{
@@ -35,7 +36,8 @@ namespace svgio
SvgStyleAttributes maSvgStyleAttributes;
/// variable scan values, dependent of given XAttributeList
- basegfx::B2DHomMatrix* mpaTransform;
+ std::unique_ptr<basegfx::B2DHomMatrix>
+ 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