summaryrefslogtreecommitdiff
path: root/sot
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 /sot
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 'sot')
-rw-r--r--sot/inc/pch/precompiled_sot.hxx2
-rw-r--r--sot/source/sdstor/stgdir.cxx4
-rw-r--r--sot/source/sdstor/stgole.cxx4
-rw-r--r--sot/source/sdstor/stgstrms.cxx6
-rw-r--r--sot/source/sdstor/storage.cxx4
-rw-r--r--sot/source/sdstor/storinfo.cxx4
-rw-r--r--sot/source/sdstor/ucbstorage.cxx4
7 files changed, 14 insertions, 14 deletions
diff --git a/sot/inc/pch/precompiled_sot.hxx b/sot/inc/pch/precompiled_sot.hxx
index b38649a4b1dc..eb156a53042c 100644
--- a/sot/inc/pch/precompiled_sot.hxx
+++ b/sot/inc/pch/precompiled_sot.hxx
@@ -17,7 +17,7 @@
#include "rtl/string.h"
#include <algorithm>
#include <assert.h>
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <boost/scoped_ptr.hpp>
#include <com/sun/star/beans/Property.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 653e10abd259..f48141ad2906 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -30,7 +30,7 @@
#include <osl/diagnose.h>
#include <sal/log.hxx>
-#include <boost/scoped_array.hpp>
+#include <memory>
//////////////////////////// class StgDirEntry
@@ -356,7 +356,7 @@ bool StgDirEntry::SetSize( sal_Int32 nNewSize )
// if so, we probably need to copy the old data
if( nOldSize )
{
- boost::scoped_array<sal_uInt8> pBuf(new sal_uInt8[ nOldSize ]);
+ std::unique_ptr<sal_uInt8[]> pBuf(new sal_uInt8[ nOldSize ]);
pOld->Pos2Page( 0L );
pStgStrm->Pos2Page( 0L );
if( pOld->Read( pBuf.get(), nOldSize )
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx
index 72a3a29ea6f0..ae5b58c39e8a 100644
--- a/sot/source/sdstor/stgole.cxx
+++ b/sot/source/sdstor/stgole.cxx
@@ -22,7 +22,7 @@
#include "rtl/string.h"
#include "stgole.hxx"
#include "sot/storinfo.hxx"
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <sot/exchange.hxx>
#ifdef _MSC_VER
@@ -121,7 +121,7 @@ bool StgCompObjStream::Load()
// higher bits are ignored
sal_uLong nStrLen = ::std::min( nLen1, (sal_Int32)0xFFFE );
- boost::scoped_array<sal_Char> p(new sal_Char[ nStrLen+1 ]);
+ std::unique_ptr<sal_Char[]> p(new sal_Char[ nStrLen+1 ]);
p[nStrLen] = 0;
if( Read( p.get(), nStrLen ) == nStrLen )
{
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index acc0417fefc4..e85e0c67eac9 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -31,7 +31,7 @@
#include "stgstrms.hxx"
#include "stgdir.hxx"
#include "stgio.hxx"
-#include <boost/scoped_array.hpp>
+#include <memory>
///////////////////////////// class StgFAT
@@ -1148,7 +1148,7 @@ bool StgTmpStrm::Copy( StgTmpStrm& rSrc )
SetSize( n );
if( GetError() == SVSTREAM_OK )
{
- boost::scoped_array<sal_uInt8> p(new sal_uInt8[ 4096 ]);
+ std::unique_ptr<sal_uInt8[]> p(new sal_uInt8[ 4096 ]);
rSrc.Seek( 0L );
Seek( 0L );
while( n )
@@ -1209,7 +1209,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n)
sal_uLong i = nEndOfData;
if( i )
{
- boost::scoped_array<sal_uInt8> p(new sal_uInt8[ 4096 ]);
+ std::unique_ptr<sal_uInt8[]> p(new sal_uInt8[ 4096 ]);
Seek( 0L );
while( i )
{
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index faa6fcd5d787..4421bcdd1ad0 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -36,7 +36,7 @@
#include <unotools/localfilehelper.hxx>
#include <unotools/ucbhelper.hxx>
#include <comphelper/processfactory.hxx>
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star;
@@ -225,7 +225,7 @@ bool SotStorageStream::CopyTo( SotStorageStream * pDestStm )
Seek( 0L );
pDestStm->SetSize( 0 ); // Ziel-Stream leeren
- boost::scoped_array<sal_uInt8> pMem(new sal_uInt8[ 8192 ]);
+ std::unique_ptr<sal_uInt8[]> pMem(new sal_uInt8[ 8192 ]);
sal_uLong nRead;
while( 0 != (nRead = Read( pMem.get(), 8192 )) )
{
diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx
index bba6d8f058eb..d1ea728ec4d4 100644
--- a/sot/source/sdstor/storinfo.cxx
+++ b/sot/source/sdstor/storinfo.cxx
@@ -21,7 +21,7 @@
#include <sot/stg.hxx>
#include <sot/storinfo.hxx>
#include <sot/exchange.hxx>
-#include <boost/scoped_array.hpp>
+#include <memory>
/************** class SvStorageInfo **************************************
*************************************************************************/
@@ -35,7 +35,7 @@ SotClipboardFormatId ReadClipboardFormat( SvStream & rStm )
if( nLen > 0 )
{
// get a string name
- boost::scoped_array<sal_Char> p(new( ::std::nothrow ) sal_Char[ nLen ]);
+ std::unique_ptr<sal_Char[]> p(new( ::std::nothrow ) sal_Char[ nLen ]);
if( p && rStm.Read( p.get(), nLen ) == (sal_uLong) nLen )
{
nFormat = SotExchange::RegisterFormatName(OUString(p.get(), nLen-1, RTL_TEXTENCODING_ASCII_US));
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index a4e1110610a7..47f659f793cd 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -43,7 +43,7 @@
#include <com/sun/star/packages/manifest/ManifestReader.hpp>
#include <com/sun/star/ucb/InteractiveIOException.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
#include <boost/scoped_ptr.hpp>
#include <rtl/digest.h>
#include <osl/diagnose.h>
@@ -1399,7 +1399,7 @@ bool UCBStorageStream::CopyTo( BaseStorageStream* pDestStm )
if( pDestStm->SetSize( n ) && n )
{
- boost::scoped_array<sal_uInt8> p(new sal_uInt8[ 4096 ]);
+ std::unique_ptr<sal_uInt8[]> p(new sal_uInt8[ 4096 ]);
Seek( 0L );
pDestStm->Seek( 0L );
while( n )