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/svgsvgnode.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/svgsvgnode.hxx')
-rw-r--r-- | svgio/inc/svgsvgnode.hxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/svgio/inc/svgsvgnode.hxx b/svgio/inc/svgsvgnode.hxx index 10204ee3c975..d0b707abb198 100644 --- a/svgio/inc/svgsvgnode.hxx +++ b/svgio/inc/svgsvgnode.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SVGIO_INC_SVGSVGNODE_HXX #include <svgstyleattributes.hxx> +#include <memory> namespace svgio { @@ -33,7 +34,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; @@ -70,8 +72,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; } |