diff options
-rw-r--r-- | svgio/inc/svgpatternnode.hxx | 10 | ||||
-rw-r--r-- | svgio/source/svgreader/svgpatternnode.cxx | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/svgio/inc/svgpatternnode.hxx b/svgio/inc/svgpatternnode.hxx index d0b2ca02cc93..5aa93b373217 100644 --- a/svgio/inc/svgpatternnode.hxx +++ b/svgio/inc/svgpatternnode.hxx @@ -38,7 +38,8 @@ namespace svgio SvgStyleAttributes maSvgStyleAttributes; /// variable scan values, dependent of given XAttributeList - basegfx::B2DRange* mpViewBox; + std::unique_ptr<basegfx::B2DRange> + mpViewBox; SvgAspectRatio maSvgAspectRatio; SvgNumber maX; SvgNumber maY; @@ -48,7 +49,8 @@ namespace svgio mpPatternUnits; std::unique_ptr<SvgUnits> mpPatternContentUnits; - basegfx::B2DHomMatrix* mpaPatternTransform; + std::unique_ptr<basegfx::B2DHomMatrix> + mpaPatternTransform; /// link to another pattern used as style. If maXLink /// is set, the node can be fetched on demand by using @@ -79,7 +81,7 @@ namespace svgio /// viewBox content const basegfx::B2DRange* getViewBox() const; - void setViewBox(const basegfx::B2DRange* pViewBox) { if(mpViewBox) delete mpViewBox; mpViewBox = nullptr; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); } + void setViewBox(const basegfx::B2DRange* pViewBox) { mpViewBox.reset(); if(pViewBox) mpViewBox.reset(new basegfx::B2DRange(*pViewBox)); } /// SvgAspectRatio content const SvgAspectRatio& getSvgAspectRatio() const; @@ -106,7 +108,7 @@ namespace svgio /// PatternTransform content const basegfx::B2DHomMatrix* getPatternTransform() const; - void setPatternTransform(const basegfx::B2DHomMatrix* pMatrix) { if(mpaPatternTransform) delete mpaPatternTransform; mpaPatternTransform = nullptr; if(pMatrix) mpaPatternTransform = new basegfx::B2DHomMatrix(*pMatrix); } + void setPatternTransform(const basegfx::B2DHomMatrix* pMatrix) { mpaPatternTransform.reset(); if(pMatrix) mpaPatternTransform.reset(new basegfx::B2DHomMatrix(*pMatrix)); } }; } // end of namespace svgreader diff --git a/svgio/source/svgreader/svgpatternnode.cxx b/svgio/source/svgreader/svgpatternnode.cxx index 50e2a38b6fe8..758a6022f841 100644 --- a/svgio/source/svgreader/svgpatternnode.cxx +++ b/svgio/source/svgreader/svgpatternnode.cxx @@ -54,8 +54,6 @@ namespace svgio SvgPatternNode::~SvgPatternNode() { - delete mpViewBox; - delete mpaPatternTransform; } const SvgStyleAttributes* SvgPatternNode::getSvgStyleAttributes() const @@ -298,7 +296,7 @@ namespace svgio { if(mpViewBox) { - return mpViewBox; + return mpViewBox.get(); } const_cast< SvgPatternNode* >(this)->tryToFindLink(); @@ -434,7 +432,7 @@ namespace svgio { if(mpaPatternTransform) { - return mpaPatternTransform; + return mpaPatternTransform.get(); } const_cast< SvgPatternNode* >(this)->tryToFindLink(); |