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>
This commit is contained in:
Noel Grandin
2017-07-12 09:35:20 +02:00
parent 0088f365b1
commit 57ffece429
2 changed files with 4 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;