diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-18 13:57:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-19 09:35:21 +0000 |
commit | 0415cb335b953b9c10075fa524d7707db4aa55e5 (patch) | |
tree | f714106565c6c58a4711b21f966ecc09c8b83157 /stoc/source/corereflection | |
parent | c3e6d12301b42a44bd0d4584005686e324533b60 (diff) |
new loplugin: useuniqueptr: sot..tools
Change-Id: Ided435d016ae28e7c3f2726e41eedd981572ae10
Reviewed-on: https://gerrit.libreoffice.org/33263
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc/source/corereflection')
-rw-r--r-- | stoc/source/corereflection/base.hxx | 10 | ||||
-rw-r--r-- | stoc/source/corereflection/crcomp.cxx | 3 | ||||
-rw-r--r-- | stoc/source/corereflection/crenum.cxx | 3 |
3 files changed, 8 insertions, 8 deletions
diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx index b92da9a59866..15a95309c8b0 100644 --- a/stoc/source/corereflection/base.hxx +++ b/stoc/source/corereflection/base.hxx @@ -42,6 +42,7 @@ #include <algorithm> #endif #include <unordered_map> +#include <memory> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -229,9 +230,10 @@ public: class CompoundIdlClassImpl : public IdlClassImpl { - css::uno::Reference< css::reflection::XIdlClass > _xSuperClass; - - css::uno::Sequence< css::uno::Reference< css::reflection::XIdlField > > * _pFields; + css::uno::Reference< css::reflection::XIdlClass > + _xSuperClass; + std::unique_ptr< css::uno::Sequence< css::uno::Reference< css::reflection::XIdlField > > > + _pFields; OUString2Field _aName2Field; public: @@ -294,7 +296,7 @@ public: class EnumIdlClassImpl : public IdlClassImpl { - css::uno::Sequence< css::uno::Reference< css::reflection::XIdlField > > * _pFields; + std::unique_ptr< css::uno::Sequence< css::uno::Reference< css::reflection::XIdlField > > > _pFields; OUString2Field _aName2Field; public: diff --git a/stoc/source/corereflection/crcomp.cxx b/stoc/source/corereflection/crcomp.cxx index 6e76911b2fff..3596e220a3c4 100644 --- a/stoc/source/corereflection/crcomp.cxx +++ b/stoc/source/corereflection/crcomp.cxx @@ -277,7 +277,6 @@ void IdlCompFieldImpl::set( Any & rObj, const Any & rValue ) CompoundIdlClassImpl::~CompoundIdlClassImpl() { - delete _pFields; } @@ -374,7 +373,7 @@ Sequence< Reference< XIdlField > > CompoundIdlClassImpl::getFields() } } - _pFields = pFields; + _pFields.reset( pFields ); } return *_pFields; } diff --git a/stoc/source/corereflection/crenum.cxx b/stoc/source/corereflection/crenum.cxx index 74c7a565bdca..594897049fef 100644 --- a/stoc/source/corereflection/crenum.cxx +++ b/stoc/source/corereflection/crenum.cxx @@ -165,7 +165,6 @@ void IdlEnumFieldImpl::set( Any &, const Any & ) EnumIdlClassImpl::~EnumIdlClassImpl() { - delete _pFields; } // IdlClassImpl modifications @@ -203,7 +202,7 @@ Sequence< Reference< XIdlField > > EnumIdlClassImpl::getFields() getReflection(), aName, IdlClassImpl::getTypeDescr(), getTypeDescr()->pEnumValues[nFields] ); } - _pFields = pFields; + _pFields.reset( pFields ); } } return *_pFields; |