summaryrefslogtreecommitdiff
path: root/basic
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 /basic
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 'basic')
-rw-r--r--basic/inc/pch/precompiled_sb.hxx2
-rw-r--r--basic/source/classes/image.cxx6
-rw-r--r--basic/source/classes/sb.cxx4
-rw-r--r--basic/source/classes/sbunoobj.cxx8
-rw-r--r--basic/source/runtime/methods.cxx4
-rw-r--r--basic/source/runtime/methods1.cxx4
-rw-r--r--basic/source/runtime/runtime.cxx14
-rw-r--r--basic/source/sbx/sbxdec.cxx4
8 files changed, 23 insertions, 23 deletions
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 <boost/optional.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <boost/scoped_ptr.hpp>
#include <com/sun/star/bridge/oleautomation/Decimal.hpp>
#include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
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 <string.h>
#include "image.hxx"
#include <codegen.hxx>
-#include <boost/scoped_array.hpp>
+#include <memory>
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<char> pByteStrings(new char[ nLen ]);
+ std::unique_ptr<char[]> 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<char> pByteStrings(new char[ nStringSize ]);
+ std::unique_ptr<char[]> 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 <com/sun/star/util/XCloseBroadcaster.hpp>
#include <com/sun/star/util/XCloseListener.hpp>
#include "errobject.hxx"
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <unordered_map>
#include <com/sun/star/script/ModuleType.hpp>
@@ -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<SbxVariable*> ppDeleteTab(new SbxVariable*[ nObjCount ]);
+ std::unique_ptr<SbxVariable*[]> 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 <runtime.hxx>
#include <math.h>
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <unordered_map>
#include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
#include <com/sun/star/reflection/XConstantsTypeDescription.hpp>
@@ -1401,9 +1401,9 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
if( nSeqLevel == nDims )
{
- boost::scoped_array<sal_Int32> pLowerBounds(new sal_Int32[nDims]);
- boost::scoped_array<sal_Int32> pUpperBounds(new sal_Int32[nDims]);
- boost::scoped_array<sal_Int32> pActualIndices(new sal_Int32[nDims]);
+ std::unique_ptr<sal_Int32[]> pLowerBounds(new sal_Int32[nDims]);
+ std::unique_ptr<sal_Int32[]> pUpperBounds(new sal_Int32[nDims]);
+ std::unique_ptr<sal_Int32[]> 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 <com/sun/star/script/XErrorQuery.hpp>
#include <ooo/vba/XHelperInterface.hpp>
#include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <boost/scoped_ptr.hpp>
#include <random>
@@ -436,7 +436,7 @@ RTLFUNC(CurDir)
const int PATH_INCR = 250;
int nSize = PATH_INCR;
- boost::scoped_array<char> pMem;
+ std::unique_ptr<char[]> 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 <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/i18n/LocaleCalendar2.hpp>
#include <com/sun/star/sheet/XFunctionAccess.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
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<short> pDims(new short[ nDims ]);
+ std::unique_ptr<short[]> 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 <basic/codecompletecache.hxx>
-#include <boost/scoped_array.hpp>
+#include <memory>
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<sal_Int32> pLowerBounds(new sal_Int32[nDims]);
- boost::scoped_array<sal_Int32> pUpperBounds(new sal_Int32[nDims]);
- boost::scoped_array<sal_Int32> pActualIndices(new sal_Int32[nDims]);
+ std::unique_ptr<sal_Int32[]> pLowerBounds(new sal_Int32[nDims]);
+ std::unique_ptr<sal_Int32[]> pUpperBounds(new sal_Int32[nDims]);
+ std::unique_ptr<sal_Int32[]> 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<sal_Int32> pLowerBounds(new sal_Int32[nDims]);
- boost::scoped_array<sal_Int32> pUpperBounds(new sal_Int32[nDims]);
- boost::scoped_array<sal_Int32> pActualIndices(new sal_Int32[nDims]);
+ std::unique_ptr<sal_Int32[]> pLowerBounds(new sal_Int32[nDims]);
+ std::unique_ptr<sal_Int32[]> pUpperBounds(new sal_Int32[nDims]);
+ std::unique_ptr<sal_Int32[]> 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 <com/sun/star/bridge/oleautomation/Decimal.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
// Implementation SbxDecimal
SbxDecimal::SbxDecimal()
@@ -208,7 +208,7 @@ bool SbxDecimal::setString( OUString* pOUString )
if( cDecimalSep != '.' || cThousandSep != ',' )
{
int nLen = pOUString->getLength();
- boost::scoped_array<sal_Unicode> pBuffer(new sal_Unicode[nLen + 1]);
+ std::unique_ptr<sal_Unicode[]> pBuffer(new sal_Unicode[nLen + 1]);
pBuffer[nLen] = 0;
const sal_Unicode* pSrc = pOUString->getStr();