diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-14 14:36:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-17 07:23:22 +0200 |
commit | db3860062ebf4109f48139c2556ff4041aff5d6e (patch) | |
tree | b6ab4df909c8922e48a9c4eefa9a8f0f6a47c41f /svgio | |
parent | 846f557fd591626931a9dadb38180786e090104c (diff) |
extend loplugin useuniqueptr to OUString pointers
Change-Id: Ieb5bab3895e1edaff497c4a1a88303ccac097edc
Reviewed-on: https://gerrit.libreoffice.org/39948
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/inc/svgnode.hxx | 9 | ||||
-rw-r--r-- | svgio/source/svgreader/svgnode.cxx | 12 |
2 files changed, 9 insertions, 12 deletions
diff --git a/svgio/inc/svgnode.hxx b/svgio/inc/svgnode.hxx index 2d2c95bf2cc1..0633e0aae390 100644 --- a/svgio/inc/svgnode.hxx +++ b/svgio/inc/svgnode.hxx @@ -25,6 +25,7 @@ #include <svgpaint.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <memory> #include <vector> // predefines @@ -94,10 +95,10 @@ namespace svgio SvgNodeVector maChildren; /// Id svan value - OUString* mpId; + std::unique_ptr<OUString> mpId; /// Class svan value - OUString* mpClass; + std::unique_ptr<OUString> mpClass; /// XmlSpace value XmlSpace maXmlSpace; @@ -163,11 +164,11 @@ namespace svgio double getCurrentXHeight() const; /// Id access - const OUString* getId() const { return mpId; } + const OUString* getId() const { return mpId.get(); } void setId(const OUString* pfId); /// Class access - const OUString* getClass() const { return mpClass; } + const OUString* getClass() const { return mpClass.get(); } void setClass(const OUString* pfClass); /// XmlSpace access diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx index de546314956c..160774ad35e4 100644 --- a/svgio/source/svgreader/svgnode.cxx +++ b/svgio/source/svgreader/svgnode.cxx @@ -296,8 +296,6 @@ namespace svgio maChildren.pop_back(); } - delete mpId; - delete mpClass; delete mpLocalCssStyle; } @@ -643,13 +641,12 @@ namespace svgio if(mpId) { mrDocument.removeSvgNodeFromMapper(*mpId); - delete mpId; - mpId = nullptr; + mpId.reset(); } if(pfId) { - mpId = new OUString(*pfId); + mpId.reset( new OUString(*pfId) ); mrDocument.addSvgNodeToMapper(*mpId, *this); } } @@ -659,13 +656,12 @@ namespace svgio if(mpClass) { mrDocument.removeSvgNodeFromMapper(*mpClass); - delete mpClass; - mpClass = nullptr; + mpClass.reset(); } if(pfClass) { - mpClass = new OUString(*pfClass); + mpClass.reset( new OUString(*pfClass) ); mrDocument.addSvgNodeToMapper(*mpClass, *this); } } |