diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-18 09:48:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-19 05:40:55 +0000 |
commit | 2da34e265db6ca56e43d9b2ab8cee04b1cc4fb29 (patch) | |
tree | e2cbed69babc7f551e0db01a9cd023db809b2204 /svgio/inc/svgmarkernode.hxx | |
parent | 9767537e22e178eb23872de138ea70e57c1a6725 (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/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; } |