diff options
Diffstat (limited to 'svgio/inc/svgmarkernode.hxx')
-rw-r--r-- | svgio/inc/svgmarkernode.hxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/svgio/inc/svgmarkernode.hxx b/svgio/inc/svgmarkernode.hxx index e993961462a5..0818be37a85a 100644 --- a/svgio/inc/svgmarkernode.hxx +++ b/svgio/inc/svgmarkernode.hxx @@ -22,6 +22,7 @@ #include <svgnode.hxx> #include <svgstyleattributes.hxx> +#include <memory> namespace svgio { @@ -44,7 +45,8 @@ namespace svgio SvgStyleAttributes maSvgStyleAttributes; /// variable scan values, dependent of given XAttributeList - basegfx::B2DRange* mpViewBox; + std::unique_ptr<basegfx::B2DRange> + mpViewBox; SvgAspectRatio maSvgAspectRatio; SvgNumber maRefX; SvgNumber maRefY; @@ -71,8 +73,8 @@ namespace svgio virtual const basegfx::B2DRange getCurrentViewPort() const override; /// viewBox content - const basegfx::B2DRange* getViewBox() const { return mpViewBox; } - void setViewBox(const basegfx::B2DRange* pViewBox) { if(mpViewBox) delete mpViewBox; mpViewBox = nullptr; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); } + const basegfx::B2DRange* getViewBox() const { return mpViewBox.get(); } + void setViewBox(const basegfx::B2DRange* pViewBox) { mpViewBox.reset(); if(pViewBox) mpViewBox.reset( new basegfx::B2DRange(*pViewBox) ); } /// SvgAspectRatio content const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; } |