summaryrefslogtreecommitdiff
path: root/cppuhelper/source
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-06-15 17:58:15 +0900
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-02-06 09:39:03 -0500
commitba4fac9c7543e92001cf8ae81a2a017e4d34aa34 (patch)
tree0afc3c1c6fb5947fd7aad119e4ed755276dfb197 /cppuhelper/source
parenta9e376dbfeb3109398dcb83e56a7f9c8b7521a73 (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<[]>/' ... 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. 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> (cherry picked from commit 09800956191c90035872cbc18cd304fee043c710) Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd
Diffstat (limited to 'cppuhelper/source')
-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
4 files changed, 13 insertions, 13 deletions
diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx
index 7451daf4cf56..eeb426fa5f49 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 5be08741b499..5d850eae511d 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 6c4238415283..3ec649ca3d7c 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]);