diff options
Diffstat (limited to 'svgio/inc/svgtextnode.hxx')
-rw-r--r-- | svgio/inc/svgtextnode.hxx | 8 |
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 |