summaryrefslogtreecommitdiff
path: root/cppuhelper
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 /cppuhelper
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 'cppuhelper')
-rw-r--r--cppuhelper/inc/pch/precompiled_cppuhelper.hxx2
-rw-r--r--cppuhelper/source/component_context.cxx4
-rw-r--r--cppuhelper/source/interfacecontainer.cxx6
-rw-r--r--cppuhelper/source/propshlp.cxx12
-rw-r--r--cppuhelper/source/tdmgr.cxx4
5 files changed, 14 insertions, 14 deletions
diff --git a/cppuhelper/inc/pch/precompiled_cppuhelper.hxx b/cppuhelper/inc/pch/precompiled_cppuhelper.hxx
index 3bcc6fd16e0c..0eae67893273 100644
--- a/cppuhelper/inc/pch/precompiled_cppuhelper.hxx
+++ b/cppuhelper/inc/pch/precompiled_cppuhelper.hxx
@@ -16,7 +16,7 @@
#include <algorithm>
#include <boost/noncopyable.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <cassert>
diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx
index 4dede24cd3a7..f5d5e9795f16 100644
--- a/cppuhelper/source/component_context.cxx
+++ b/cppuhelper/source/component_context.cxx
@@ -55,7 +55,7 @@
#include <com/sun/star/uno/DeploymentException.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
#define SMGR_SINGLETON "/singletons/com.sun.star.lang.theServiceManager"
#define TDMGR_SINGLETON "/singletons/com.sun.star.reflection.theTypeDescriptionManager"
@@ -864,7 +864,7 @@ Reference< XComponentContext > SAL_CALL createComponentContext(
uno::Mapping curr2source(curr_env, source_env);
uno::Mapping source2curr(source_env, curr_env);
- boost::scoped_array<ContextEntry_Init> mapped_entries(new ContextEntry_Init[nEntries]);
+ std::unique_ptr<ContextEntry_Init[]> mapped_entries(new ContextEntry_Init[nEntries]);
for (sal_Int32 nPos = 0; nPos < nEntries; ++ nPos)
{
mapped_entries[nPos].bLateInitService = pEntries[nPos].bLateInitService;
diff --git a/cppuhelper/source/interfacecontainer.cxx b/cppuhelper/source/interfacecontainer.cxx
index 9800a191a751..5bd20a442128 100644
--- a/cppuhelper/source/interfacecontainer.cxx
+++ b/cppuhelper/source/interfacecontainer.cxx
@@ -25,7 +25,7 @@
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <com/sun/star/lang/XEventListener.hpp>
@@ -454,7 +454,7 @@ sal_Int32 OMultiTypeInterfaceContainerHelper::removeInterface(
void OMultiTypeInterfaceContainerHelper::disposeAndClear( const EventObject & rEvt )
{
t_type2ptr::size_type nSize = 0;
- boost::scoped_array<OInterfaceContainerHelper *> ppListenerContainers;
+ std::unique_ptr<OInterfaceContainerHelper *[]> ppListenerContainers;
{
::osl::MutexGuard aGuard( rMutex );
t_type2ptr * pMap = static_cast<t_type2ptr *>(m_pMap);
@@ -628,7 +628,7 @@ sal_Int32 OMultiTypeInterfaceContainerHelperInt32::removeInterface(
void OMultiTypeInterfaceContainerHelperInt32::disposeAndClear( const EventObject & rEvt )
{
t_long2ptr::size_type nSize = 0;
- boost::scoped_array<OInterfaceContainerHelper *> ppListenerContainers;
+ std::unique_ptr<OInterfaceContainerHelper *[]> ppListenerContainers;
{
::osl::MutexGuard aGuard( rMutex );
if (!m_pMap)
diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx
index 904bf9ab09a6..199b53b2ccc3 100644
--- a/cppuhelper/source/propshlp.cxx
+++ b/cppuhelper/source/propshlp.cxx
@@ -26,7 +26,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <sal/log.hxx>
using namespace osl;
@@ -841,8 +841,8 @@ void OPropertySetHelper::setFastPropertyValues(
// get the map table
IPropertyArrayHelper & rPH = getInfoHelper();
- boost::scoped_array<Any> pConvertedValues(new Any[ nHitCount ]);
- boost::scoped_array<Any> pOldValues(new Any[ nHitCount ]);
+ std::unique_ptr<Any[]> pConvertedValues(new Any[ nHitCount ]);
+ std::unique_ptr<Any[]> pOldValues(new Any[ nHitCount ]);
sal_Int32 n = 0;
sal_Int32 i;
@@ -901,7 +901,7 @@ void OPropertySetHelper::setPropertyValues(
throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception)
{
sal_Int32 nSeqLen = rPropertyNames.getLength();
- boost::scoped_array<sal_Int32> pHandles(new sal_Int32[ nSeqLen ]);
+ std::unique_ptr<sal_Int32[]> pHandles(new sal_Int32[ nSeqLen ]);
// get the map table
IPropertyArrayHelper & rPH = getInfoHelper();
// fill the handle array
@@ -915,7 +915,7 @@ Sequence<Any> OPropertySetHelper::getPropertyValues( const Sequence<OUString>& r
throw(::com::sun::star::uno::RuntimeException, std::exception)
{
sal_Int32 nSeqLen = rPropertyNames.getLength();
- boost::scoped_array<sal_Int32> pHandles(new sal_Int32[ nSeqLen ]);
+ std::unique_ptr<sal_Int32[]> pHandles(new sal_Int32[ nSeqLen ]);
Sequence< Any > aValues( nSeqLen );
// get the map table
@@ -957,7 +957,7 @@ void OPropertySetHelper::firePropertiesChangeEvent(
throw(::com::sun::star::uno::RuntimeException, std::exception)
{
sal_Int32 nLen = rPropertyNames.getLength();
- boost::scoped_array<sal_Int32> pHandles(new sal_Int32[nLen]);
+ std::unique_ptr<sal_Int32[]> pHandles(new sal_Int32[nLen]);
IPropertyArrayHelper & rPH = getInfoHelper();
rPH.fillHandles( pHandles.get(), rPropertyNames );
const OUString* pNames = rPropertyNames.getConstArray();
diff --git a/cppuhelper/source/tdmgr.cxx b/cppuhelper/source/tdmgr.cxx
index d93d107bd21b..6aaf34e6ece5 100644
--- a/cppuhelper/source/tdmgr.cxx
+++ b/cppuhelper/source/tdmgr.cxx
@@ -49,7 +49,7 @@
#include <com/sun/star/reflection/XStructTypeDescription.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -318,7 +318,7 @@ inline static typelib_TypeDescription * createCTD(
sal_Int32 nBases = aBases.getLength();
// Exploit the fact that a typelib_TypeDescription for an interface type
// is also the typelib_TypeDescriptionReference for that type:
- boost::scoped_array< typelib_TypeDescription * > aBaseTypes(
+ std::unique_ptr< typelib_TypeDescription * []> aBaseTypes(
new typelib_TypeDescription *[nBases]);
for (sal_Int32 i = 0; i < nBases; ++i) {
typelib_TypeDescription * p = createCTD(access, aBases[i]);