summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-06-15 17:58:15 +0900
committerCaolán McNamara <caolanm@redhat.com>2015-06-17 15:50:45 +0000
commit09800956191c90035872cbc18cd304fee043c710 (patch)
tree9d255ad7629fedc181e8b5cf965a3075a328caaf /comphelper
parent9cc52266bd1a4d01552675f151ce2da8c5210f84 (diff)
Replace boost::scoped_array<T> with std::unique_ptr<T[]>
This may reduce some degree of dependency on boost. Done by running a script like: git grep -l '#include *.boost/scoped_array.hpp.' \ | xargs sed -i -e 's@#include *.boost/scoped_array.hpp.@#include <memory>@' git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \ | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/' ... and then killing duplicate or unnecessary includes, while changing manually m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx, extensions/source/ole/unoconversionutilities.hxx, and extensions/source/ole/oleobjw.cxx. Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd Reviewed-on: https://gerrit.libreoffice.org/16289 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/inc/pch/precompiled_comphelper.hxx2
-rw-r--r--comphelper/source/property/propagg.cxx14
-rw-r--r--comphelper/source/property/propertysethelper.cxx8
3 files changed, 12 insertions, 12 deletions
diff --git a/comphelper/inc/pch/precompiled_comphelper.hxx b/comphelper/inc/pch/precompiled_comphelper.hxx
index 63497211d0f9..d0de0e32d18a 100644
--- a/comphelper/inc/pch/precompiled_comphelper.hxx
+++ b/comphelper/inc/pch/precompiled_comphelper.hxx
@@ -19,7 +19,7 @@
#include <boost/bind.hpp>
#include <boost/current_function.hpp>
#include <boost/noncopyable.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <boost/shared_ptr.hpp>
#include <cassert>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
diff --git a/comphelper/source/property/propagg.cxx b/comphelper/source/property/propagg.cxx
index 9d4930c54e3b..815a095185a7 100644
--- a/comphelper/source/property/propagg.cxx
+++ b/comphelper/source/property/propagg.cxx
@@ -30,7 +30,7 @@
#include <algorithm>
#include <set>
-#include <boost/scoped_array.hpp>
+#include <memory>
namespace comphelper
@@ -506,9 +506,9 @@ void SAL_CALL OPropertySetAggregationHelper::propertiesChange(const ::com::sun:
}
else
{
- boost::scoped_array<sal_Int32> pHandles(new sal_Int32[nLen]);
- boost::scoped_array< ::com::sun::star::uno::Any> pNewValues(new ::com::sun::star::uno::Any[nLen]);
- boost::scoped_array< ::com::sun::star::uno::Any> pOldValues(new ::com::sun::star::uno::Any[nLen]);
+ std::unique_ptr<sal_Int32[]> pHandles(new sal_Int32[nLen]);
+ std::unique_ptr< ::com::sun::star::uno::Any[]> pNewValues(new ::com::sun::star::uno::Any[nLen]);
+ std::unique_ptr< ::com::sun::star::uno::Any[]> pOldValues(new ::com::sun::star::uno::Any[nLen]);
const ::com::sun::star::beans::PropertyChangeEvent* pEvents = _rEvents.getConstArray();
sal_Int32 nDest = 0;
@@ -797,7 +797,7 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues(
// reset, needed below
pDelValues = DelValues.getArray();
- boost::scoped_array<sal_Int32> pHandles(new sal_Int32[ nLen - nAggCount ]);
+ std::unique_ptr<sal_Int32[]> pHandles(new sal_Int32[ nLen - nAggCount ]);
// get the map table
cppu::IPropertyArrayHelper& rPH2 = getInfoHelper();
@@ -806,8 +806,8 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues(
sal_Int32 nHitCount = rPH2.fillHandles( pHandles.get(), DelPropertyNames );
if (nHitCount != 0)
{
- boost::scoped_array< ::com::sun::star::uno::Any> pConvertedValues(new ::com::sun::star::uno::Any[ nHitCount ]);
- boost::scoped_array< ::com::sun::star::uno::Any> pOldValues(new ::com::sun::star::uno::Any[ nHitCount ]);
+ std::unique_ptr< ::com::sun::star::uno::Any[]> pConvertedValues(new ::com::sun::star::uno::Any[ nHitCount ]);
+ std::unique_ptr< ::com::sun::star::uno::Any[]> pOldValues(new ::com::sun::star::uno::Any[ nHitCount ]);
nHitCount = 0;
sal_Int32 i;
diff --git a/comphelper/source/property/propertysethelper.cxx b/comphelper/source/property/propertysethelper.cxx
index 35b574fe9006..de7df6a28b9d 100644
--- a/comphelper/source/property/propertysethelper.cxx
+++ b/comphelper/source/property/propertysethelper.cxx
@@ -21,7 +21,7 @@
#include <comphelper/propertysethelper.hxx>
#include <osl/diagnose.h>
-#include <boost/scoped_array.hpp>
+#include <memory>
using namespace ::comphelper;
using namespace ::com::sun::star;
@@ -141,7 +141,7 @@ void SAL_CALL PropertySetHelper::setPropertyValues( const Sequence< OUString >&
if( nCount )
{
- boost::scoped_array<PropertyMapEntry const *> pEntries(new PropertyMapEntry const *[nCount+1]);
+ std::unique_ptr<PropertyMapEntry const *[]> pEntries(new PropertyMapEntry const *[nCount+1]);
pEntries[nCount] = NULL;
const OUString* pNames = rPropertyNames.getConstArray();
@@ -169,7 +169,7 @@ Sequence< Any > SAL_CALL PropertySetHelper::getPropertyValues(const Sequence< OU
Sequence< Any > aValues;
if( nCount )
{
- boost::scoped_array<PropertyMapEntry const *> pEntries(new PropertyMapEntry const *[nCount+1]);
+ std::unique_ptr<PropertyMapEntry const *[]> pEntries(new PropertyMapEntry const *[nCount+1]);
pEntries[nCount] = NULL;
const OUString* pNames = rPropertyNames.getConstArray();
@@ -238,7 +238,7 @@ Sequence< PropertyState > SAL_CALL PropertySetHelper::getPropertyStates( const S
bool bUnknown = false;
- boost::scoped_array<PropertyMapEntry const *> pEntries(new PropertyMapEntry const *[nCount+1]);
+ std::unique_ptr<PropertyMapEntry const *[]> pEntries(new PropertyMapEntry const *[nCount+1]);
sal_Int32 n;
for( n = 0; !bUnknown && (n < nCount); n++, pNames++ )