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 /vcl/source/gdi/bitmap3.cxx | |
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 'vcl/source/gdi/bitmap3.cxx')
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 9a656d60daa6..130f065b87e5 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -26,7 +26,7 @@ #include <vcl/bitmapscalesuper.hxx> #include <vcl/opengl/OpenGLHelper.hxx> -#include <boost/scoped_array.hpp> +#include <memory> #include <impbmp.hxx> #include <impoct.hxx> @@ -1087,8 +1087,8 @@ bool Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY ) { const double nWidth = pReadAcc->Width(); const double nHeight = pReadAcc->Height(); - boost::scoped_array<long> pLutX(new long[ nNewWidth ]); - boost::scoped_array<long> pLutY(new long[ nNewHeight ]); + std::unique_ptr<long[]> pLutX(new long[ nNewWidth ]); + std::unique_ptr<long[]> pLutY(new long[ nNewHeight ]); for( long nX = 0L; nX < nNewWidth; nX++ ) pLutX[ nX ] = long(nX * nWidth / nNewWidth); @@ -1150,8 +1150,8 @@ bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY const long nWidth1 = pReadAcc->Width() - 1L; const double fRevScaleX = (double) nWidth1 / nNewWidth1; - boost::scoped_array<long> pLutInt(new long[ nNewWidth ]); - boost::scoped_array<long> pLutFrac(new long[ nNewWidth ]); + std::unique_ptr<long[]> pLutInt(new long[ nNewWidth ]); + std::unique_ptr<long[]> pLutFrac(new long[ nNewWidth ]); for( long nX = 0L, nTemp = nWidth - 2L; nX < nNewWidth; nX++ ) { @@ -1237,8 +1237,8 @@ bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY const long nHeight1 = pReadAcc->Height() - 1L; const double fRevScaleY = (double) nHeight1 / nNewHeight1; - boost::scoped_array<long> pLutInt(new long[ nNewHeight ]); - boost::scoped_array<long> pLutFrac(new long[ nNewHeight ]); + std::unique_ptr<long[]> pLutInt(new long[ nNewHeight ]); + std::unique_ptr<long[]> pLutFrac(new long[ nNewHeight ]); for( long nY = 0L, nTemp = nHeight - 2L; nY < nNewHeight; nY++ ) { @@ -1776,8 +1776,8 @@ bool Bitmap::ImplDitherFloyd() long nW2 = nW - 3L; long nRErr, nGErr, nBErr; long nRC, nGC, nBC; - boost::scoped_array<long> p1(new long[ nW ]); - boost::scoped_array<long> p2(new long[ nW ]); + std::unique_ptr<long[]> p1(new long[ nW ]); + std::unique_ptr<long[]> p2(new long[ nW ]); long* p1T = p1.get(); long* p2T = p2.get(); long* pTmp; @@ -1905,8 +1905,8 @@ bool Bitmap::ImplDitherFloyd16() BitmapColor aColor; BitmapColor aBestCol; ImpErrorQuad aErrQuad; - boost::scoped_array<ImpErrorQuad> pErrQuad1(new ImpErrorQuad[ nWidth ]); - boost::scoped_array<ImpErrorQuad> pErrQuad2(new ImpErrorQuad[ nWidth ]); + std::unique_ptr<ImpErrorQuad[]> pErrQuad1(new ImpErrorQuad[ nWidth ]); + std::unique_ptr<ImpErrorQuad[]> pErrQuad2(new ImpErrorQuad[ nWidth ]); ImpErrorQuad* pQLine1 = pErrQuad1.get(); ImpErrorQuad* pQLine2 = 0; long nYTmp = 0L; @@ -2107,7 +2107,7 @@ bool Bitmap::ImplReducePopular( sal_uInt16 nColCount ) const sal_uInt32 nTotalColors = nColorsPerComponent * nColorsPerComponent * nColorsPerComponent; const long nWidth = pRAcc->Width(); const long nHeight = pRAcc->Height(); - boost::scoped_array<PopularColorCount> pCountTable(new PopularColorCount[ nTotalColors ]); + std::unique_ptr<PopularColorCount[]> pCountTable(new PopularColorCount[ nTotalColors ]); memset( pCountTable.get(), 0, nTotalColors * sizeof( PopularColorCount ) ); @@ -2168,7 +2168,7 @@ bool Bitmap::ImplReducePopular( sal_uInt16 nColCount ) if( pWAcc ) { BitmapColor aDstCol( (sal_uInt8) 0 ); - boost::scoped_array<sal_uInt8> pIndexMap(new sal_uInt8[ nTotalColors ]); + std::unique_ptr<sal_uInt8[]> pIndexMap(new sal_uInt8[ nTotalColors ]); for( long nR = 0, nIndex = 0; nR < 256; nR += nColorOffset ) for( long nG = 0; nG < 256; nG += nColorOffset ) @@ -2477,9 +2477,9 @@ bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent, BitmapColor aCol; const long nW = pAcc->Width(); const long nH = pAcc->Height(); - boost::scoped_array<sal_uInt8> cMapR(new sal_uInt8[ 256 ]); - boost::scoped_array<sal_uInt8> cMapG(new sal_uInt8[ 256 ]); - boost::scoped_array<sal_uInt8> cMapB(new sal_uInt8[ 256 ]); + std::unique_ptr<sal_uInt8[]> cMapR(new sal_uInt8[ 256 ]); + std::unique_ptr<sal_uInt8[]> cMapG(new sal_uInt8[ 256 ]); + std::unique_ptr<sal_uInt8[]> cMapB(new sal_uInt8[ 256 ]); double fM, fROff, fGOff, fBOff, fOff; // calculate slope |