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:
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <rtl/ustring.hxx>
|
#include <rtl/ustring.hxx>
|
||||||
#include <com/sun/star/uno/Sequence.hxx>
|
#include <com/sun/star/uno/Sequence.hxx>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
namespace com { namespace sun { namespace star {
|
namespace com { namespace sun { namespace star {
|
||||||
@@ -65,7 +66,7 @@ class MultiPropertySetHelper
|
|||||||
|
|
||||||
/// an array of indices that maps from pPropertyNames indices to
|
/// an array of indices that maps from pPropertyNames indices to
|
||||||
/// aPropertySequence indices
|
/// aPropertySequence indices
|
||||||
sal_Int16* pSequenceIndex;
|
std::unique_ptr<sal_Int16[]> pSequenceIndex;
|
||||||
|
|
||||||
/// the last set of values retrieved by getValues
|
/// the last set of values retrieved by getValues
|
||||||
css::uno::Sequence< css::uno::Any > aValues;
|
css::uno::Sequence< css::uno::Any > aValues;
|
||||||
|
@@ -56,7 +56,6 @@ MultiPropertySetHelper::~MultiPropertySetHelper()
|
|||||||
{
|
{
|
||||||
pValues = nullptr; // memory 'owned' by aValues
|
pValues = nullptr; // memory 'owned' by aValues
|
||||||
|
|
||||||
delete[] pSequenceIndex;
|
|
||||||
delete[] pPropertyNames;
|
delete[] pPropertyNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,8 +66,8 @@ void MultiPropertySetHelper::hasProperties(
|
|||||||
SAL_WARN_IF( !rInfo.is(), "xmloff", "I'd really like an XPropertySetInfo here." );
|
SAL_WARN_IF( !rInfo.is(), "xmloff", "I'd really like an XPropertySetInfo here." );
|
||||||
|
|
||||||
// allocate sequence index
|
// allocate sequence index
|
||||||
if ( nullptr == pSequenceIndex )
|
if ( !pSequenceIndex )
|
||||||
pSequenceIndex = new sal_Int16[nLength] ;
|
pSequenceIndex.reset( new sal_Int16[nLength] );
|
||||||
|
|
||||||
// construct pSequenceIndex
|
// construct pSequenceIndex
|
||||||
sal_Int16 nNumberOfProperties = 0;
|
sal_Int16 nNumberOfProperties = 0;
|
||||||
|
Reference in New Issue
Block a user