diff options
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; |