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/svgsymbolnode.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/svgsymbolnode.hxx')
-rw-r--r-- | svgio/inc/svgsymbolnode.hxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/svgio/inc/svgsymbolnode.hxx b/svgio/inc/svgsymbolnode.hxx index a6458fe1d21e..fbf03c22c61c 100644 --- a/svgio/inc/svgsymbolnode.hxx +++ b/svgio/inc/svgsymbolnode.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SVGIO_INC_SVGSYMBOLNODE_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; public: @@ -46,7 +48,7 @@ namespace svgio virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; /// viewBox content - 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) ); } }; } // end of namespace svgreader } // end of namespace svgio |