diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-12 09:35:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-12 15:53:12 +0200 |
commit | 57ffece4297f51bb1abd5093c58fc56be8aea2b8 (patch) | |
tree | 6d138efd9788263d909406db7fdc451467d045f9 /xmloff | |
parent | 0088f365b1c1e3103b310ac3371bc5c918fe617e (diff) |
loplugin:useuniqueptr in xmloff
Change-Id: I686706adcf598ec63eea6d288bc1e202120a9276
Reviewed-on: https://gerrit.libreoffice.org/39853
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/MultiPropertySetHelper.hxx | 3 | ||||
-rw-r--r-- | xmloff/source/style/MultiPropertySetHelper.cxx | 5 |
2 files changed, 4 insertions, 4 deletions
diff --git a/xmloff/inc/MultiPropertySetHelper.hxx b/xmloff/inc/MultiPropertySetHelper.hxx index 661266883661..7218c89a9617 100644 --- a/xmloff/inc/MultiPropertySetHelper.hxx +++ b/xmloff/inc/MultiPropertySetHelper.hxx @@ -21,6 +21,7 @@ #include <rtl/ustring.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <memory> namespace com { namespace sun { namespace star { @@ -65,7 +66,7 @@ class MultiPropertySetHelper /// an array of indices that maps from pPropertyNames indices to /// aPropertySequence indices - sal_Int16* pSequenceIndex; + std::unique_ptr<sal_Int16[]> pSequenceIndex; /// the last set of values retrieved by getValues css::uno::Sequence< css::uno::Any > aValues; diff --git a/xmloff/source/style/MultiPropertySetHelper.cxx b/xmloff/source/style/MultiPropertySetHelper.cxx index a7f3d597b292..498491199c8a 100644 --- a/xmloff/source/style/MultiPropertySetHelper.cxx +++ b/xmloff/source/style/MultiPropertySetHelper.cxx @@ -56,7 +56,6 @@ MultiPropertySetHelper::~MultiPropertySetHelper() { pValues = nullptr; // memory 'owned' by aValues - delete[] pSequenceIndex; delete[] pPropertyNames; } @@ -67,8 +66,8 @@ void MultiPropertySetHelper::hasProperties( SAL_WARN_IF( !rInfo.is(), "xmloff", "I'd really like an XPropertySetInfo here." ); // allocate sequence index - if ( nullptr == pSequenceIndex ) - pSequenceIndex = new sal_Int16[nLength] ; + if ( !pSequenceIndex ) + pSequenceIndex.reset( new sal_Int16[nLength] ); // construct pSequenceIndex sal_Int16 nNumberOfProperties = 0; |