From 09800956191c90035872cbc18cd304fee043c710 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Mon, 15 Jun 2015 17:58:15 +0900 Subject: Replace boost::scoped_array with std::unique_ptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 @' 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 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- basic/inc/pch/precompiled_sb.hxx | 2 +- basic/source/classes/image.cxx | 6 +++--- basic/source/classes/sb.cxx | 4 ++-- basic/source/classes/sbunoobj.cxx | 8 ++++---- basic/source/runtime/methods.cxx | 4 ++-- basic/source/runtime/methods1.cxx | 4 ++-- basic/source/runtime/runtime.cxx | 14 +++++++------- basic/source/sbx/sbxdec.cxx | 4 ++-- 8 files changed, 23 insertions(+), 23 deletions(-) (limited to 'basic') diff --git a/basic/inc/pch/precompiled_sb.hxx b/basic/inc/pch/precompiled_sb.hxx index d797b0b9cc39..089523cac22c 100644 --- a/basic/inc/pch/precompiled_sb.hxx +++ b/basic/inc/pch/precompiled_sb.hxx @@ -16,7 +16,7 @@ #include "math.h" #include -#include +#include #include #include #include diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index d99259b0082c..0fa3d1398d17 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -25,7 +25,7 @@ #include #include "image.hxx" #include -#include +#include SbiImage::SbiImage() { @@ -229,7 +229,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion ) pStrings = new sal_Unicode[ nLen ]; nStringSize = (sal_uInt16) nLen; - boost::scoped_array pByteStrings(new char[ nLen ]); + std::unique_ptr pByteStrings(new char[ nLen ]); r.Read( pByteStrings.get(), nStringSize ); for( short j = 0; j < nStrings; j++ ) { @@ -347,7 +347,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) r.WriteUInt32( pStringOff[ i ] ); } // Then the String-Block - boost::scoped_array pByteStrings(new char[ nStringSize ]); + std::unique_ptr pByteStrings(new char[ nStringSize ]); for( i = 0; i < nStrings; i++ ) { sal_uInt16 nOff = (sal_uInt16) pStringOff[ i ]; diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index e449e82613f6..e1730d758dbb 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -44,7 +44,7 @@ #include #include #include "errobject.hxx" -#include +#include #include #include @@ -1888,7 +1888,7 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer ) // #95459 Delete dialogs, otherwise endless recursion // in SbxVarable::GetType() if dialogs are accessed sal_uInt16 nObjCount = pObjs->Count(); - boost::scoped_array ppDeleteTab(new SbxVariable*[ nObjCount ]); + std::unique_ptr ppDeleteTab(new SbxVariable*[ nObjCount ]); sal_uInt16 nObj; for( nObj = 0 ; nObj < nObjCount ; nObj++ ) diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 572613786219..9cd21d04b2e5 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -82,7 +82,7 @@ #include #include -#include +#include #include #include #include @@ -1401,9 +1401,9 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper if( nSeqLevel == nDims ) { - boost::scoped_array pLowerBounds(new sal_Int32[nDims]); - boost::scoped_array pUpperBounds(new sal_Int32[nDims]); - boost::scoped_array pActualIndices(new sal_Int32[nDims]); + std::unique_ptr pLowerBounds(new sal_Int32[nDims]); + std::unique_ptr pUpperBounds(new sal_Int32[nDims]); + std::unique_ptr pActualIndices(new sal_Int32[nDims]); for( short i = 1 ; i <= nDims ; i++ ) { sal_Int32 lBound, uBound; diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 48e9d871202a..73cd355389f1 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include #include @@ -436,7 +436,7 @@ RTLFUNC(CurDir) const int PATH_INCR = 250; int nSize = PATH_INCR; - boost::scoped_array pMem; + std::unique_ptr pMem; while( true ) { pMem.reset(new char[nSize]); diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 9740bc13b465..55c80d6fe793 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -59,7 +59,7 @@ #include #include #include -#include +#include using namespace comphelper; using namespace com::sun::star::i18n; @@ -1283,7 +1283,7 @@ void PutGet( SbxArray& rPar, bool bPut ) { sal_Size nFPos = pStrm->Tell(); short nDims = pArr->GetDims(); - boost::scoped_array pDims(new short[ nDims ]); + std::unique_ptr pDims(new short[ nDims ]); bRet = lcl_WriteReadSbxArray(*pArr,pStrm,!bRandom,nDims,pDims.get(),bPut); pDims.reset(); if( nBlockLen ) diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 4ccf50582a40..e71fe1352ada 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -67,7 +67,7 @@ #include "sbintern.hxx" #include "sbunoobj.hxx" #include -#include +#include using com::sun::star::uno::Reference; @@ -2263,9 +2263,9 @@ void SbiRuntime::StepREDIMP() else if (nDims > 0) { // Store dims to use them for copying later - boost::scoped_array pLowerBounds(new sal_Int32[nDims]); - boost::scoped_array pUpperBounds(new sal_Int32[nDims]); - boost::scoped_array pActualIndices(new sal_Int32[nDims]); + std::unique_ptr pLowerBounds(new sal_Int32[nDims]); + std::unique_ptr pUpperBounds(new sal_Int32[nDims]); + std::unique_ptr pActualIndices(new sal_Int32[nDims]); // Compare bounds for( short i = 1 ; i <= nDims ; i++ ) @@ -4436,9 +4436,9 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) bool bRangeError = false; // Store dims to use them for copying later - boost::scoped_array pLowerBounds(new sal_Int32[nDims]); - boost::scoped_array pUpperBounds(new sal_Int32[nDims]); - boost::scoped_array pActualIndices(new sal_Int32[nDims]); + std::unique_ptr pLowerBounds(new sal_Int32[nDims]); + std::unique_ptr pUpperBounds(new sal_Int32[nDims]); + std::unique_ptr pActualIndices(new sal_Int32[nDims]); if( nDimsOld != nDimsNew ) { bRangeError = true; diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx index 267bee9a3c0a..ae07e212a6b4 100644 --- a/basic/source/sbx/sbxdec.cxx +++ b/basic/source/sbx/sbxdec.cxx @@ -23,7 +23,7 @@ #include "sbxconv.hxx" #include -#include +#include // Implementation SbxDecimal SbxDecimal::SbxDecimal() @@ -208,7 +208,7 @@ bool SbxDecimal::setString( OUString* pOUString ) if( cDecimalSep != '.' || cThousandSep != ',' ) { int nLen = pOUString->getLength(); - boost::scoped_array pBuffer(new sal_Unicode[nLen + 1]); + std::unique_ptr pBuffer(new sal_Unicode[nLen + 1]); pBuffer[nLen] = 0; const sal_Unicode* pSrc = pOUString->getStr(); -- cgit