diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-06-15 17:58:15 +0900 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-06-17 15:50:45 +0000 |
commit | 09800956191c90035872cbc18cd304fee043c710 (patch) | |
tree | 9d255ad7629fedc181e8b5cf965a3075a328caaf /svx | |
parent | 9cc52266bd1a4d01552675f151ce2da8c5210f84 (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 'svx')
-rw-r--r-- | svx/inc/pch/precompiled_svx.hxx | 2 | ||||
-rw-r--r-- | svx/inc/pch/precompiled_svxcore.hxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/_bmpmask.cxx | 14 | ||||
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 4 | ||||
-rw-r--r-- | svx/source/gallery2/codec.cxx | 6 | ||||
-rw-r--r-- | svx/source/gallery2/galtheme.cxx | 4 | ||||
-rw-r--r-- | svx/source/sidebar/line/LinePropertyPanel.hxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdhdl.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 8 | ||||
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 6 |
10 files changed, 27 insertions, 27 deletions
diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index db9d7fed3000..fb6c52896c3d 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -64,7 +64,7 @@ #include <basic/sbxvar.hxx> #include <boost/bind.hpp> #include <boost/noncopyable.hpp> -#include <boost/scoped_array.hpp> +#include <memory> #include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include <cassert> diff --git a/svx/inc/pch/precompiled_svxcore.hxx b/svx/inc/pch/precompiled_svxcore.hxx index 48875a7a60a9..88b47f3e4210 100644 --- a/svx/inc/pch/precompiled_svxcore.hxx +++ b/svx/inc/pch/precompiled_svxcore.hxx @@ -95,7 +95,7 @@ #include <boost/noncopyable.hpp> #include <boost/optional.hpp> #include <boost/ptr_container/ptr_vector.hpp> -#include <boost/scoped_array.hpp> +#include <memory> #include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include <boost/spirit/include/classic_core.hpp> diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index f544be3fc852..83bb285511d8 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -30,7 +30,7 @@ #include <svx/dialogs.hrc> #include <bmpmask.hrc> #include <svx/svxids.hrc> -#include <boost/scoped_array.hpp> +#include <memory> #include <boost/scoped_ptr.hpp> #include "helpid.hrc" @@ -725,12 +725,12 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf ) long nR; long nG; long nB; - boost::scoped_array<long> pMinR(new long[nCount]); - boost::scoped_array<long> pMaxR(new long[nCount]); - boost::scoped_array<long> pMinG(new long[nCount]); - boost::scoped_array<long> pMaxG(new long[nCount]); - boost::scoped_array<long> pMinB(new long[nCount]); - boost::scoped_array<long> pMaxB(new long[nCount]); + std::unique_ptr<long[]> pMinR(new long[nCount]); + std::unique_ptr<long[]> pMaxR(new long[nCount]); + std::unique_ptr<long[]> pMinG(new long[nCount]); + std::unique_ptr<long[]> pMaxG(new long[nCount]); + std::unique_ptr<long[]> pMinB(new long[nCount]); + std::unique_ptr<long[]> pMaxB(new long[nCount]); sal_uInt16 i; aMtf.SetPrefSize( rMtf.GetPrefSize() ); diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 64bd0bf7af39..124d545b62b0 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -68,7 +68,7 @@ #include <tools/resary.hxx> #include <svx/svxdlg.hxx> #include <vcl/toolbox.hxx> -#include <boost/scoped_array.hpp> +#include <memory> #include <boost/scoped_ptr.hpp> using namespace com::sun::star::i18n; @@ -1897,7 +1897,7 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl) while( *pTmp ) pTmp++; nCnt = pTmp - pPtr + 7; - boost::scoped_array<sal_uInt16> pWhRanges(new sal_uInt16[nCnt]); + std::unique_ptr<sal_uInt16[]> pWhRanges(new sal_uInt16[nCnt]); sal_uInt16 nPos = 0; while( *pPtr ) diff --git a/svx/source/gallery2/codec.cxx b/svx/source/gallery2/codec.cxx index ca4a14e57d7b..40412ed1270f 100644 --- a/svx/source/gallery2/codec.cxx +++ b/svx/source/gallery2/codec.cxx @@ -21,7 +21,7 @@ #include <tools/stream.hxx> #include <tools/zcodec.hxx> #include "codec.hxx" -#include <boost/scoped_array.hpp> +#include <memory> // - GalleryCodec - @@ -98,10 +98,10 @@ void GalleryCodec::Read( SvStream& rStmToRead ) // decompress if( 1 == nVersion ) { - boost::scoped_array<sal_uInt8> pCompressedBuffer(new sal_uInt8[ nCompressedSize ]); + std::unique_ptr<sal_uInt8[]> pCompressedBuffer(new sal_uInt8[ nCompressedSize ]); rStm.Read( pCompressedBuffer.get(), nCompressedSize ); sal_uInt8* pInBuf = pCompressedBuffer.get(); - boost::scoped_array<sal_uInt8> pOutBuf(new sal_uInt8[ nUnCompressedSize ]); + std::unique_ptr<sal_uInt8[]> pOutBuf(new sal_uInt8[ nUnCompressedSize ]); sal_uInt8* pTmpBuf = pOutBuf.get(); sal_uInt8* pLast = pOutBuf.get() + nUnCompressedSize - 1; sal_uIntPtr nIndex = 0UL, nCountByte, nRunByte; diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index b63d7fd87d2d..f1b8ecac0ef1 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -55,7 +55,7 @@ #include "galtheme.hrc" #include <vcl/lstbox.hxx> #include "gallerydrawmodel.hxx" -#include <boost/scoped_array.hpp> +#include <memory> #include <boost/scoped_ptr.hpp> using namespace ::com::sun::star; @@ -1367,7 +1367,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const if( nRest ) { - boost::scoped_array<char> pReserve(new char[ nRest ]); + std::unique_ptr<char[]> pReserve(new char[ nRest ]); memset( pReserve.get(), 0, nRest ); rOStm.Write( pReserve.get(), nRest ); } diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx index a62dc3d2ee6f..9e39384031eb 100644 --- a/svx/source/sidebar/line/LinePropertyPanel.hxx +++ b/svx/source/sidebar/line/LinePropertyPanel.hxx @@ -25,7 +25,7 @@ #include <sfx2/sidebar/ControllerItem.hxx> #include <vcl/fixed.hxx> #include <vcl/field.hxx> -#include <boost/scoped_array.hpp> +#include <memory> #include <svx/sidebar/PanelLayout.hxx> #include <svx/xtable.hxx> #include "LineWidthPopup.hxx" @@ -137,7 +137,7 @@ private: Image maIMGNone; // multi-images - boost::scoped_array<Image> mpIMGWidthIcon; + std::unique_ptr<Image[]> mpIMGWidthIcon; css::uno::Reference<css::frame::XFrame> mxFrame; SfxBindings* mpBindings; diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index d0d6e70af045..0a4a9aaf5d42 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -65,7 +65,7 @@ #include <drawinglayer/primitive2d/maskprimitive2d.hxx> #include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> -#include <boost/scoped_array.hpp> +#include <memory> #include <boost/scoped_ptr.hpp> @@ -1897,7 +1897,7 @@ void SdrHdlList::TravelFocusHdl(bool bForward) } // allocate pointer array for sorted handle list - boost::scoped_array<ImplHdlAndIndex> pHdlAndIndex(new ImplHdlAndIndex[aList.size()]); + std::unique_ptr<ImplHdlAndIndex[]> pHdlAndIndex(new ImplHdlAndIndex[aList.size()]); // build sorted handle list for( size_t a = 0; a < aList.size(); ++a) diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 47c3c21d7aa2..e8a1dc35300b 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -86,7 +86,7 @@ #include <svl/itemset.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> -#include <boost/scoped_array.hpp> +#include <memory> #include <libxml/xmlwriter.h> using namespace ::com::sun::star; @@ -1559,7 +1559,7 @@ void SdrModel::CopyPages(sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum, // at first, save the pointers of the affected pages in an array sal_uInt16 nPageNum=nFirstPageNum; sal_uInt16 nCopyAnz=((!bReverse)?(nLastPageNum-nFirstPageNum):(nFirstPageNum-nLastPageNum))+1; - boost::scoped_array<SdrPage*> pPagePtrs(new SdrPage*[nCopyAnz]); + std::unique_ptr<SdrPage*[]> pPagePtrs(new SdrPage*[nCopyAnz]); sal_uInt16 nCopyNum; for(nCopyNum=0; nCopyNum<nCopyAnz; nCopyNum++) { @@ -1637,8 +1637,8 @@ void SdrModel::Merge(SdrModel& rSourceModel, if (nLastPageNum>nMaxSrcPage) nLastPageNum =nMaxSrcPage; bool bReverse=nLastPageNum<nFirstPageNum; - boost::scoped_array<sal_uInt16> pMasterMap; - boost::scoped_array<bool> pMasterNeed; + std::unique_ptr<sal_uInt16[]> pMasterMap; + std::unique_ptr<bool[]> pMasterNeed; sal_uInt16 nMasterNeed=0; if (bMergeMasterPages && nSrcMasterPageAnz!=0) { // determine which MasterPages from rSrcModel we need diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index e7c1a37ebfc1..fe581c43c7cf 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -31,7 +31,7 @@ #include <vcl/graphicfilter.hxx> #include <vcl/cvtgrf.hxx> #include <sax/tools/converter.hxx> -#include <boost/scoped_array.hpp> +#include <memory> #define FORMAT_BMP "bmp" #define FORMAT_GIF "gif" @@ -516,8 +516,8 @@ Polygon XOutBitmap::GetCountour( const Bitmap& rBmp, const sal_uIntPtr nFlags, const long nStartY1 = aWorkRect.Top() + 1L; const long nEndY1 = aWorkRect.Bottom(); const long nStartY2 = nEndY1 - 1L; - boost::scoped_array<Point> pPoints1; - boost::scoped_array<Point> pPoints2; + std::unique_ptr<Point[]> pPoints1; + std::unique_ptr<Point[]> pPoints2; long nX, nY; sal_uInt16 nPolyPos = 0; const BitmapColor aBlack = pAcc->GetBestMatchingColor( Color( COL_BLACK ) ); |