From ba4fac9c7543e92001cf8ae81a2a017e4d34aa34 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<[]>/' ... 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. Reviewed-on: https://gerrit.libreoffice.org/16289 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara (cherry picked from commit 09800956191c90035872cbc18cd304fee043c710) Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd --- vcl/generic/fontmanager/helper.cxx | 6 +++--- vcl/inc/pch/precompiled_vcl.hxx | 2 +- vcl/source/app/dbggui.cxx | 4 ++-- vcl/source/bitmap/bitmapscalesuper.cxx | 10 ++++----- vcl/source/control/edit.cxx | 12 +++++------ vcl/source/filter/GraphicNativeMetadata.cxx | 4 ++-- vcl/source/filter/graphicfilter.cxx | 3 +-- vcl/source/filter/igif/gifread.cxx | 6 +++--- vcl/source/filter/jpeg/Exif.cxx | 4 ++-- vcl/source/filter/jpeg/JpegReader.cxx | 4 ++-- vcl/source/filter/jpeg/jpegc.cxx | 4 ++-- vcl/source/filter/sgfbram.cxx | 4 ++-- vcl/source/filter/sgvspln.cxx | 12 +++++------ vcl/source/filter/sgvtext.cxx | 5 ++--- vcl/source/filter/wmf/emfwr.cxx | 4 ++-- vcl/source/filter/wmf/enhwmf.cxx | 12 +++++------ vcl/source/filter/wmf/winwmf.cxx | 18 ++++++++-------- vcl/source/filter/wmf/wmfwr.cxx | 6 +++--- vcl/source/gdi/bitmap.cxx | 30 +++++++++++++-------------- vcl/source/gdi/bitmap3.cxx | 32 ++++++++++++++--------------- vcl/source/gdi/cvtsvm.cxx | 6 +++--- vcl/source/gdi/dibtools.cxx | 14 ++++++------- vcl/source/gdi/image.cxx | 2 -- vcl/source/gdi/impimage.cxx | 8 ++++---- vcl/source/gdi/impvect.cxx | 5 ++--- vcl/source/gdi/jobset.cxx | 4 ++-- vcl/source/gdi/pdfwriter_impl.cxx | 14 ++++++------- vcl/source/gdi/pngwrite.cxx | 4 ++-- vcl/source/gdi/salgdilayout.cxx | 11 +++++----- vcl/source/gdi/sallayout.cxx | 4 ++-- vcl/source/gdi/salmisc.cxx | 4 ++-- vcl/source/gdi/textlayout.cxx | 4 ++-- vcl/source/opengl/OpenGLContext.cxx | 1 - vcl/source/opengl/OpenGLHelper.cxx | 6 +++--- vcl/source/outdev/bitmap.cxx | 14 ++++++------- vcl/source/outdev/hatch.cxx | 4 ++-- vcl/source/outdev/pixel.cxx | 4 ++-- vcl/source/outdev/polygon.cxx | 6 +++--- vcl/source/outdev/transparent.cxx | 6 +++--- vcl/unx/generic/app/saldisp.cxx | 4 ++-- vcl/unx/generic/printer/jobdata.cxx | 4 ++-- 41 files changed, 152 insertions(+), 159 deletions(-) (limited to 'vcl') diff --git a/vcl/generic/fontmanager/helper.cxx b/vcl/generic/fontmanager/helper.cxx index ecd4cca6cfdc..4517c6dcbfbb 100644 --- a/vcl/generic/fontmanager/helper.cxx +++ b/vcl/generic/fontmanager/helper.cxx @@ -31,7 +31,7 @@ #include #include "vcl/helper.hxx" #include "vcl/ppdparser.hxx" -#include +#include using ::rtl::Bootstrap; @@ -289,7 +289,7 @@ bool psp::convertPfbToPfa( ::osl::File& rInFile, ::osl::File& rOutFile ) rInFile.getPos(nOrgPos); nBytesToRead = std::min(nBytesToRead, nSize - nOrgPos); - boost::scoped_array pBuffer(new unsigned char[nBytesToRead+1]); + std::unique_ptr pBuffer(new unsigned char[nBytesToRead+1]); pBuffer[nBytesToRead] = 0; if( ! rInFile.read( pBuffer.get(), nBytesToRead, nRead ) && nRead == nBytesToRead ) @@ -298,7 +298,7 @@ bool psp::convertPfbToPfa( ::osl::File& rInFile, ::osl::File& rOutFile ) { // ascii data, convert dos lineends( \r\n ) and // m_ac lineends( \r ) to \n - boost::scoped_array pWriteBuffer(new unsigned char[ nBytesToRead ]); + std::unique_ptr pWriteBuffer(new unsigned char[ nBytesToRead ]); unsigned int nBytesToWrite = 0; for( unsigned int i = 0; i < nBytesToRead; i++ ) { diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx index c2b8c9c72e6a..62f6612d8dbb 100644 --- a/vcl/inc/pch/precompiled_vcl.hxx +++ b/vcl/inc/pch/precompiled_vcl.hxx @@ -139,7 +139,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index d3ef95a5525c..f696bd3cce5f 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -57,7 +57,7 @@ #include "com/sun/star/i18n/XCharacterClassification.hpp" #include -#include +#include using namespace ::com::sun::star; @@ -484,7 +484,7 @@ void DbgDialogTest( vcl::Window* pWindow ) if ( !pGetChild ) return; - boost::scoped_array pRectAry(reinterpret_cast(new long[(sizeof(Rectangle)*nChildCount)/sizeof(long)])); + std::unique_ptr pRectAry(reinterpret_cast(new long[(sizeof(Rectangle)*nChildCount)/sizeof(long)])); memset( pRectAry.get(), 0, sizeof(Rectangle)*nChildCount ); if ( pWindow->IsDialog() ) diff --git a/vcl/source/bitmap/bitmapscalesuper.cxx b/vcl/source/bitmap/bitmapscalesuper.cxx index b19930409935..d48db93c1b86 100644 --- a/vcl/source/bitmap/bitmapscalesuper.cxx +++ b/vcl/source/bitmap/bitmapscalesuper.cxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include namespace { @@ -50,10 +50,10 @@ struct ScaleContext { long mnSrcW, mnDestW; long mnSrcH, mnDestH; bool mbHMirr, mbVMirr; - boost::scoped_array mpMapIX; - boost::scoped_array mpMapIY; - boost::scoped_array mpMapFX; - boost::scoped_array mpMapFY; + std::unique_ptr mpMapIX; + std::unique_ptr mpMapIY; + std::unique_ptr mpMapFX; + std::unique_ptr mpMapFY; ScaleContext( BitmapReadAccess *pSrc, BitmapWriteAccess *pDest, long nSrcW, long nDestW, diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index cd9681b693fa..f04be46a9545 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -65,7 +65,7 @@ #include #include -#include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -501,7 +501,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRec sal_Int32 nLen = aText.getLength(); long nDXBuffer[256]; - boost::scoped_array pDXBuffer; + std::unique_ptr pDXBuffer; long* pDX = nDXBuffer; if (!aText.isEmpty()) @@ -1113,7 +1113,7 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible ) long nTextPos = 0; long nDXBuffer[256]; - boost::scoped_array pDXBuffer; + std::unique_ptr pDXBuffer; long* pDX = nDXBuffer; if( !aText.isEmpty() ) @@ -1232,7 +1232,7 @@ sal_Int32 Edit::ImplGetCharPos( const Point& rWindowPos ) const OUString aText = ImplGetText(); long nDXBuffer[256]; - boost::scoped_array pDXBuffer; + std::unique_ptr pDXBuffer; long* pDX = nDXBuffer; if( (size_t) (2*aText.getLength()) > SAL_N_ELEMENTS(nDXBuffer) ) { @@ -2195,7 +2195,7 @@ void Edit::Command( const CommandEvent& rCEvt ) { OUString aText = ImplGetText(); long nDXBuffer[256]; - boost::scoped_array pDXBuffer; + std::unique_ptr pDXBuffer; long* pDX = nDXBuffer; if( !aText.isEmpty() ) @@ -2211,7 +2211,7 @@ void Edit::Command( const CommandEvent& rCEvt ) long nTH = GetTextHeight(); Point aPos( mnXOffset, ImplGetTextYPosition() ); - boost::scoped_array aRects(new Rectangle[ mpIMEInfos->nLen ]); + std::unique_ptr aRects(new Rectangle[ mpIMEInfos->nLen ]); for ( int nIndex = 0; nIndex < mpIMEInfos->nLen; ++nIndex ) { Rectangle aRect( aPos, Size( 10, nTH ) ); diff --git a/vcl/source/filter/GraphicNativeMetadata.cxx b/vcl/source/filter/GraphicNativeMetadata.cxx index 6503774a34b6..532e2d4284ab 100644 --- a/vcl/source/filter/GraphicNativeMetadata.cxx +++ b/vcl/source/filter/GraphicNativeMetadata.cxx @@ -22,7 +22,7 @@ #include #include "jpeg/Exif.hxx" -#include +#include GraphicNativeMetadata::GraphicNativeMetadata() : mRotation(0) @@ -38,7 +38,7 @@ bool GraphicNativeMetadata::read(Graphic& rGraphic) if ( aLink.GetType() != GFX_LINK_TYPE_NATIVE_JPG ) return false; sal_uInt32 aDataSize = aLink.GetDataSize(); - boost::scoped_array aBuffer(new sal_uInt8[aDataSize]); + std::unique_ptr aBuffer(new sal_uInt8[aDataSize]); memcpy(aBuffer.get(), aLink.GetData(), aDataSize); SvMemoryStream aMemoryStream(aBuffer.get(), aDataSize, StreamMode::READ); diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 0a2cd01a93b3..18997c169b1a 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -64,7 +64,6 @@ #include #include #include -#include #include #include "FilterConfigCache.hxx" @@ -624,7 +623,7 @@ static bool ImpPeekGraphicFormat( SvStream& rStream, OUString& rFormatExtension, if( !bTest ) { sal_uLong nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen; - boost::scoped_array pBuf(new sal_uInt8 [ nSize ]); + std::unique_ptr pBuf(new sal_uInt8 [ nSize ]); rStream.Seek( nStreamPos ); rStream.Read( pBuf.get(), nSize ); diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index 1e8daf928733..11bc80dcd82b 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -21,7 +21,7 @@ #include "decode.hxx" #include "gifread.hxx" -#include +#include #define NO_PENDING( rStm ) ( ( rStm ).GetError() != ERRCODE_IO_PENDING ) @@ -188,7 +188,7 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount ) const sal_uInt64 nMaxPossible = rIStm.remainingSize(); if (nLen > nMaxPossible) nLen = nMaxPossible; - boost::scoped_array pBuf(new sal_uInt8[ nLen ]); + std::unique_ptr pBuf(new sal_uInt8[ nLen ]); sal_Size nRead = rIStm.Read(pBuf.get(), nLen); nCount = nRead/3UL; if( NO_PENDING( rIStm ) ) @@ -333,7 +333,7 @@ bool GIFReader::ReadExtension() const sal_uInt64 nMaxPossible = rIStm.remainingSize(); if (nCount > nMaxPossible) nCount = nMaxPossible; - boost::scoped_array pBuffer(new sal_uInt8[nCount]); + std::unique_ptr pBuffer(new sal_uInt8[nCount]); bRet = false; sal_Size nRead = rIStm.Read(pBuffer.get(), nCount); diff --git a/vcl/source/filter/jpeg/Exif.cxx b/vcl/source/filter/jpeg/Exif.cxx index fc59664192cb..14f3ca4319bf 100644 --- a/vcl/source/filter/jpeg/Exif.cxx +++ b/vcl/source/filter/jpeg/Exif.cxx @@ -18,7 +18,7 @@ */ #include "Exif.hxx" -#include +#include Exif::Exif() : maOrientation(TOP_LEFT), @@ -208,7 +208,7 @@ bool Exif::processExif(SvStream& rStream, sal_uInt16 aSectionLength, bool bSetVa sal_uInt16 aLength = aSectionLength - 6; // Length = Section - Header - boost::scoped_array aExifData(new sal_uInt8[aLength]); + std::unique_ptr aExifData(new sal_uInt8[aLength]); sal_uInt32 aExifDataBeginPosition = rStream.Tell(); rStream.Read(aExifData.get(), aLength); diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx index f8bc787529bf..6ada56b8738c 100644 --- a/vcl/source/filter/jpeg/JpegReader.cxx +++ b/vcl/source/filter/jpeg/JpegReader.cxx @@ -28,7 +28,7 @@ #include #include #include -#include +#include #define JPEG_MIN_READ 512 #define BUFFER_SIZE 4096 @@ -314,7 +314,7 @@ void JPEGReader::FillBitmap() if( mpAcc->GetBitCount() == 8 ) { - boost::scoped_array pCols(new BitmapColor[ 256 ]); + std::unique_ptr pCols(new BitmapColor[ 256 ]); for( sal_uInt16 n = 0; n < 256; n++ ) { diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx index 831b390b87d5..47051d2819cc 100644 --- a/vcl/source/filter/jpeg/jpegc.cxx +++ b/vcl/source/filter/jpeg/jpegc.cxx @@ -35,7 +35,7 @@ extern "C" { #include "jpeg.h" #include #include -#include +#include #ifdef _MSC_VER #pragma warning(push, 1) /* disable to __declspec(align()) aligned warning */ @@ -77,7 +77,7 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines, long nHeight; long nAlignedWidth; JSAMPLE* aRangeLimit; - boost::scoped_array pScanLineBuffer; + std::unique_ptr pScanLineBuffer; if ( setjmp( jerr.setjmp_buffer ) ) { diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx index 277e4af32366..86bacd124b19 100644 --- a/vcl/source/filter/sgfbram.cxx +++ b/vcl/source/filter/sgfbram.cxx @@ -26,7 +26,7 @@ #include #include "sgffilt.hxx" #include "sgfbram.hxx" -#include +#include SgfHeader::SgfHeader() { @@ -210,7 +210,7 @@ bool SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) sal_uInt16 i,j,k; // column/row/plane counter sal_uInt16 a,b; // helper variables sal_uInt8 pl1 = 0; // masks for the planes - boost::scoped_array pBuf; // buffer for a pixel row + std::unique_ptr pBuf; // buffer for a pixel row PcxExpand aPcx; sal_uLong nOfs; sal_uInt8 cRGB[4]; diff --git a/vcl/source/filter/sgvspln.cxx b/vcl/source/filter/sgvspln.cxx index 8c9c09be4d2e..27ee2be09817 100644 --- a/vcl/source/filter/sgvspln.cxx +++ b/vcl/source/filter/sgvspln.cxx @@ -20,7 +20,7 @@ #include #include -#include +#include #include @@ -392,8 +392,8 @@ sal_uInt16 NaturalSpline(sal_uInt16 n, double* x, double* y, double* b, double* c, double* d) { sal_uInt16 i; - boost::scoped_array a; - boost::scoped_array h; + std::unique_ptr a; + std::unique_ptr h; sal_uInt16 error; if (n<2) return 1; @@ -487,9 +487,9 @@ sal_uInt16 PeriodicSpline(sal_uInt16 n, double* x, double* y, sal_uInt16 Error; sal_uInt16 i,im1,nm1; //integer double hr,hl; - boost::scoped_array a; - boost::scoped_array lowrow; - boost::scoped_array ricol; + std::unique_ptr a; + std::unique_ptr lowrow; + std::unique_ptr ricol; if (n<2) return 4; nm1=n-1; diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx index 575cc3e2104b..62e877bd4d5d 100644 --- a/vcl/source/filter/sgvtext.cxx +++ b/vcl/source/filter/sgvtext.cxx @@ -28,7 +28,6 @@ #include "sgffilt.hxx" #include "sgfbram.hxx" #include "sgvmain.hxx" -#include #include extern SgfFontLst* pSgfFonts; @@ -892,8 +891,8 @@ void TextType::Draw(OutputDevice& rOut) bool Ende = false; sal_uInt16 lc; bool TextFit; - boost::scoped_array xLine; - boost::scoped_array cLine; // Buffer for FormatLine + std::unique_ptr xLine; + std::unique_ptr cLine; // Buffer for FormatLine sal_uInt16 FitXMul; sal_uInt16 FitXDiv; sal_uInt16 FitYMul; diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 86ad5de1f19a..8b445597774a 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include #define WIN_EMR_POLYGON 3 #define WIN_EMR_POLYLINE 4 @@ -892,7 +892,7 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const OUString& rText, c if( nLen ) { sal_uInt32 nNormWidth; - boost::scoped_array pOwnArray; + std::unique_ptr pOwnArray; long* pDX; // get text sizes diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index 9aff0ccc5178..418d40f08f18 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include using namespace std; @@ -534,7 +534,7 @@ void EnhWMFReader::ReadAndDrawPolyLine() ( static_cast< sal_uInt32 >( nPoly ) * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) ) { - boost::scoped_array pnPoints(new sal_uInt16[ nPoly ]); + std::unique_ptr pnPoints(new sal_uInt16[ nPoly ]); for ( i = 0; i < nPoly && pWMF->good(); i++ ) { pWMF->ReadUInt32( nPoints ); @@ -578,7 +578,7 @@ void EnhWMFReader::ReadAndDrawPolyPolygon() ( ( nPoly * sizeof( sal_uInt16 ) ) <= ( nEndPos - pWMF->Tell() ) )) { // Get number of points in each polygon - boost::scoped_array pnPoints(new sal_uInt16[ nPoly ]); + std::unique_ptr pnPoints(new sal_uInt16[ nPoly ]); for (sal_uInt32 i = 0; i < nPoly && pWMF->good(); ++i) { sal_uInt32 nPoints(0); @@ -592,7 +592,7 @@ void EnhWMFReader::ReadAndDrawPolyPolygon() for (sal_uInt32 i = 0; i < nPoly && pWMF->good(); ++i) { const sal_uInt16 nPointCount(pnPoints[i]); - boost::scoped_array pPtAry(new Point[nPointCount]); + std::unique_ptr pPtAry(new Point[nPointCount]); for (sal_uInt16 j = 0; j < nPointCount && pWMF->good(); ++j) { T nX(0), nY(0); @@ -1475,7 +1475,7 @@ bool EnhWMFReader::ReadEnhWMF() { if ( nLen <= static_cast( nEndPos - pWMF->Tell() ) ) { - boost::scoped_array pBuf(new sal_Char[ nLen ]); + std::unique_ptr pBuf(new sal_Char[ nLen ]); pWMF->Read( pBuf.get(), nLen ); aText = OUString(pBuf.get(), nLen, pOut->GetCharSet()); pBuf.reset(); @@ -1500,7 +1500,7 @@ bool EnhWMFReader::ReadEnhWMF() { if ( ( nLen * sizeof(sal_Unicode) ) <= ( nEndPos - pWMF->Tell() ) ) { - boost::scoped_array pBuf(new sal_Unicode[ nLen ]); + std::unique_ptr pBuf(new sal_Unicode[ nLen ]); pWMF->Read( pBuf.get(), nLen << 1 ); #ifdef OSL_BIGENDIAN sal_Char nTmp, *pTmp = (sal_Char*)( pBuf.get() + nLen ); diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index e69b504348c6..828169e32560 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -19,7 +19,7 @@ #include "winmtf.hxx" -#include +#include #include #include #include @@ -383,7 +383,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) } // Number of points of each polygon. Determine total number of points - boost::scoped_array xPolygonPointCounts(new sal_uInt16[nPolyCount]); + std::unique_ptr xPolygonPointCounts(new sal_uInt16[nPolyCount]); sal_uInt16* pnPoints = xPolygonPointCounts.get(); tools::PolyPolygon aPolyPoly(nPolyCount, nPolyCount); sal_uInt16 nPoints = 0; @@ -421,7 +421,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) break; } - boost::scoped_array xPolygonPoints(new Point[nPointCount]); + std::unique_ptr xPolygonPoints(new Point[nPointCount]); Point* pPtAry = xPolygonPoints.get(); for(sal_uInt16 b(0); b < nPointCount && pWMF->good(); ++b) @@ -507,7 +507,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) pWMF->ReadUInt16( nLength ); if ( nLength ) { - boost::scoped_array pChar(new char[ ( nLength + 1 ) &~ 1 ]); + std::unique_ptr pChar(new char[ ( nLength + 1 ) &~ 1 ]); pWMF->Read( pChar.get(), ( nLength + 1 ) &~ 1 ); OUString aText( pChar.get(), nLength, pOut->GetCharSet() ); pChar.reset(); @@ -523,7 +523,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) sal_Int32 nRecordPos, nRecordSize = 0, nOriginalTextLen, nNewTextLen; Point aPosition; Rectangle aRect; - boost::scoped_array pDXAry; + std::unique_ptr pDXAry; pWMF->SeekRel(-6); nRecordPos = pWMF->Tell(); @@ -549,7 +549,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) const Point aPt2( ReadPoint() ); aRect = Rectangle( aPt1, aPt2 ); } - boost::scoped_array pChar(new char[ ( nOriginalTextLen + 1 ) &~ 1 ]); + std::unique_ptr pChar(new char[ ( nOriginalTextLen + 1 ) &~ 1 ]); pWMF->Read( pChar.get(), ( nOriginalTextLen + 1 ) &~ 1 ); OUString aText( pChar.get(), (sal_uInt16)nOriginalTextLen, pOut->GetCharSet() );// after this conversion the text may contain nNewTextLen = aText.getLength(); // less character (japanese version), so the @@ -1017,7 +1017,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) #else sal_uInt32 nCheckSum = rtl_crc32( 0, &nEsc, 4 ); #endif - boost::scoped_array pData; + std::unique_ptr pData; if ( ( static_cast< sal_uInt64 >( nEscLen ) + pWMF->Tell() ) > nMetaRecEndPos ) { @@ -1042,7 +1042,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) Point aPt; OUString aString; sal_uInt32 nStringLen, nDXCount; - boost::scoped_array pDXAry; + std::unique_ptr pDXAry; SvMemoryStream aMemoryStream( nEscLen ); aMemoryStream.Write( pData.get(), nEscLen ); aMemoryStream.Seek( STREAM_SEEK_TO_BEGIN ); @@ -1116,7 +1116,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) if( pEMFStream ) { - boost::scoped_array pBuf(new sal_Int8[ nCurRecSize ]); + std::unique_ptr pBuf(new sal_Int8[ nCurRecSize ]); sal_uInt32 nCount = pWMF->Read( pBuf.get(), nCurRecSize ); if( nCount == nCurRecSize ) pEMFStream->Write( pBuf.get(), nCount ); diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index ca3f77f9aa63..cd3536c68703 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -36,7 +36,7 @@ #include #include #include -#include +#include // MS Windows defines @@ -567,7 +567,7 @@ void WMFWriter::TrueExtTextOut( const Point& rPoint, const OUString& rString, pWMF->WriteUChar( 0 ); sal_Int32 nOriginalTextLen = rString.getLength(); - boost::scoped_array pConvertedDXAry(new sal_Int16[ nOriginalTextLen ]); + std::unique_ptr pConvertedDXAry(new sal_Int16[ nOriginalTextLen ]); sal_Int32 j = 0; pConvertedDXAry[ j++ ] = (sal_Int16)ScaleWidth( pDXAry[ 0 ] ); for (sal_Int32 i = 1; i < ( nOriginalTextLen - 1 ); ++i) @@ -1203,7 +1203,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) pVirDev->SetFont( aSrcFont ); nLen = aTemp.getLength(); - boost::scoped_array pDXAry(nLen ? new long[ nLen ] : NULL); + std::unique_ptr pDXAry(nLen ? new long[ nLen ] : NULL); nNormSize = pVirDev->GetTextArray( aTemp, pDXAry.get() ); if (nLen && nNormSize == 0) { diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index a66ff75dfbda..f18558ff27f0 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -32,7 +32,7 @@ #include #include -#include +#include Bitmap::Bitmap() : mpImpBmp( NULL ) @@ -551,7 +551,7 @@ bool Bitmap::Mirror( BmpMirrorFlags nMirrorFlags ) if( pAcc ) { const long nScanSize = pAcc->GetScanlineSize(); - boost::scoped_array pBuffer(new sal_uInt8[ nScanSize ]); + std::unique_ptr pBuffer(new sal_uInt8[ nScanSize ]); const long nHeight = pAcc->Height(); const long nHeight1 = nHeight - 1L; const long nHeight_2 = nHeight >> 1L; @@ -690,10 +690,10 @@ bool Bitmap::Rotate( long nAngle10, const Color& rFillColor ) long nY; long nRotX; long nRotY; - boost::scoped_array pCosX(new long[ nNewWidth ]); - boost::scoped_array pSinX(new long[ nNewWidth ]); - boost::scoped_array pCosY(new long[ nNewHeight ]); - boost::scoped_array pSinY(new long[ nNewHeight ]); + std::unique_ptr pCosX(new long[ nNewWidth ]); + std::unique_ptr pSinX(new long[ nNewWidth ]); + std::unique_ptr pCosY(new long[ nNewHeight ]); + std::unique_ptr pSinY(new long[ nNewHeight ]); for ( nX = 0; nX < nNewWidth; nX++ ) { @@ -883,7 +883,7 @@ bool Bitmap::CopyPixel( const Rectangle& rRectDst, if( pReadAcc->HasPalette() && pWriteAcc->HasPalette() ) { const sal_uInt16 nCount = pReadAcc->GetPaletteEntryCount(); - boost::scoped_array pMap(new sal_uInt8[ nCount ]); + std::unique_ptr pMap(new sal_uInt8[ nCount ]); // Create index map for the color table, as the bitmap should be copied // retaining it's color information relatively well @@ -1467,7 +1467,7 @@ bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor ) } else { - boost::scoped_array pFlags(new bool[ nMaxColors ]); + std::unique_ptr pFlags(new bool[ nMaxColors ]); // Set all entries to false std::fill( pFlags.get(), pFlags.get()+nMaxColors, false ); @@ -1641,12 +1641,12 @@ bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors, if( pAcc ) { - boost::scoped_array pMinR(new long[ nColorCount ]); - boost::scoped_array pMaxR(new long[ nColorCount ]); - boost::scoped_array pMinG(new long[ nColorCount ]); - boost::scoped_array pMaxG(new long[ nColorCount ]); - boost::scoped_array pMinB(new long[ nColorCount ]); - boost::scoped_array pMaxB(new long[ nColorCount ]); + std::unique_ptr pMinR(new long[ nColorCount ]); + std::unique_ptr pMaxR(new long[ nColorCount ]); + std::unique_ptr pMinG(new long[ nColorCount ]); + std::unique_ptr pMaxG(new long[ nColorCount ]); + std::unique_ptr pMinB(new long[ nColorCount ]); + std::unique_ptr pMaxB(new long[ nColorCount ]); long* pTols; sal_uLong i; @@ -1692,7 +1692,7 @@ bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors, else { BitmapColor aCol; - boost::scoped_array pReplaces(new BitmapColor[ nColorCount ]); + std::unique_ptr pReplaces(new BitmapColor[ nColorCount ]); for( i = 0UL; i < nColorCount; i++ ) pReplaces[ i ] = pAcc->GetBestMatchingColor( pReplaceColors[ i ] ); diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index f5f6c3257d09..661572cb82e9 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -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 pLutX(new long[ nNewWidth ]); - boost::scoped_array pLutY(new long[ nNewHeight ]); + std::unique_ptr pLutX(new long[ nNewWidth ]); + std::unique_ptr 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 pLutInt(new long[ nNewWidth ]); - boost::scoped_array pLutFrac(new long[ nNewWidth ]); + std::unique_ptr pLutInt(new long[ nNewWidth ]); + std::unique_ptr 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 pLutInt(new long[ nNewHeight ]); - boost::scoped_array pLutFrac(new long[ nNewHeight ]); + std::unique_ptr pLutInt(new long[ nNewHeight ]); + std::unique_ptr 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 p1(new long[ nW ]); - boost::scoped_array p2(new long[ nW ]); + std::unique_ptr p1(new long[ nW ]); + std::unique_ptr 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 pErrQuad1(new ImpErrorQuad[ nWidth ]); - boost::scoped_array pErrQuad2(new ImpErrorQuad[ nWidth ]); + std::unique_ptr pErrQuad1(new ImpErrorQuad[ nWidth ]); + std::unique_ptr 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 pCountTable(new PopularColorCount[ nTotalColors ]); + std::unique_ptr 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 pIndexMap(new sal_uInt8[ nTotalColors ]); + std::unique_ptr 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 cMapR(new sal_uInt8[ 256 ]); - boost::scoped_array cMapG(new sal_uInt8[ 256 ]); - boost::scoped_array cMapB(new sal_uInt8[ 256 ]); + std::unique_ptr cMapR(new sal_uInt8[ 256 ]); + std::unique_ptr cMapG(new sal_uInt8[ 256 ]); + std::unique_ptr cMapB(new sal_uInt8[ 256 ]); double fM, fROff, fGOff, fBOff, fOff; // calculate slope diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index 7a559f12a760..a7821224fdf7 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -31,7 +31,7 @@ #include #include -#include +#include // Inlines void ImplReadRect( SvStream& rIStm, Rectangle& rRect ) @@ -887,7 +887,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) OUString aStr(OStringToOUString(aByteStr, eActualCharSet)); - boost::scoped_array pDXAry; + std::unique_ptr pDXAry; if (nAryLen > 0) { sal_Int32 nStrLen( aStr.getLength() ); @@ -902,7 +902,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) { if( nAryLen+1 == nStrLen ) { - boost::scoped_array pTmpAry(new long[nStrLen]); + std::unique_ptr pTmpAry(new long[nStrLen]); aFontVDev->GetTextArray( aStr, pTmpAry.get(), nIndex, nLen ); diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index 1baa29c69b14..6d282254a97d 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include // - Defines - @@ -288,7 +288,7 @@ bool ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, bool bQuad ) const sal_uLong nPalSize = nColors * ( bQuad ? 4UL : 3UL ); BitmapColor aPalColor; - boost::scoped_array pEntries(new sal_uInt8[ nPalSize ]); + std::unique_ptr pEntries(new sal_uInt8[ nPalSize ]); if (rIStm.Read( pEntries.get(), nPalSize ) != nPalSize) { return false; @@ -511,7 +511,7 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r rHeader.nSizeImage = rIStm.remainingSize(); } - boost::scoped_array pBuffer( + std::unique_ptr pBuffer( new sal_uInt8[rHeader.nSizeImage]); if (rIStm.Read(pBuffer.get(), rHeader.nSizeImage) != rHeader.nSizeImage) @@ -524,7 +524,7 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r { const long nWidth(rHeader.nWidth); const long nHeight(rHeader.nHeight); - boost::scoped_array pBuf(new sal_uInt8[nAlignedWidth]); + std::unique_ptr pBuf(new sal_uInt8[nAlignedWidth]); const long nI(bTopDown ? 1 : -1); long nY(bTopDown ? 0 : nHeight - 1); @@ -918,7 +918,7 @@ bool ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc ) { const sal_uInt16 nColors = rAcc.GetPaletteEntryCount(); const sal_uLong nPalSize = nColors * 4UL; - boost::scoped_array pEntries(new sal_uInt8[ nPalSize ]); + std::unique_ptr pEntries(new sal_uInt8[ nPalSize ]); sal_uInt8* pTmpEntry = pEntries.get(); BitmapColor aPalColor; @@ -945,7 +945,7 @@ bool ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, bool bRLE4 ) sal_uLong nSaveIndex; sal_uLong nCount; sal_uLong nBufCount; - boost::scoped_array pBuf(new sal_uInt8[ ( nWidth << 1 ) + 2 ]); + std::unique_ptr pBuf(new sal_uInt8[ ( nWidth << 1 ) + 2 ]); sal_uInt8* pTmp; sal_uInt8 cPix; sal_uInt8 cLast; @@ -1127,7 +1127,7 @@ bool ImplWriteDIBBits(SvStream& rOStm, BitmapReadAccess& rAcc, BitmapReadAccess* { const long nWidth(rAcc.Width()); const long nHeight(rAcc.Height()); - boost::scoped_array pBuf(new sal_uInt8[ nAlignedWidth ]); + std::unique_ptr pBuf(new sal_uInt8[ nAlignedWidth ]); switch( nBitCount ) { case( 1 ): diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx index bc0bd276c9d1..94bceaedf0e3 100644 --- a/vcl/source/gdi/image.cxx +++ b/vcl/source/gdi/image.cxx @@ -17,8 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include - #include #include #include diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx index 4acbc6236476..536a77ee0c15 100644 --- a/vcl/source/gdi/impimage.cxx +++ b/vcl/source/gdi/impimage.cxx @@ -27,7 +27,7 @@ #include #include -#include +#include #if defined WNT #include @@ -222,9 +222,9 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev, BitmapColor aCol; const long nW = pAcc->Width(); const long nH = pAcc->Height(); - boost::scoped_array pMapR(new sal_uInt8[ 256 ]); - boost::scoped_array pMapG(new sal_uInt8[ 256 ]); - boost::scoped_array pMapB(new sal_uInt8[ 256 ]); + std::unique_ptr pMapR(new sal_uInt8[ 256 ]); + std::unique_ptr pMapG(new sal_uInt8[ 256 ]); + std::unique_ptr pMapB(new sal_uInt8[ 256 ]); long nX, nY; if( nStyle & DrawImageFlags::Highlight ) diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 166f0be37148..4db6d4939e99 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -26,7 +26,6 @@ #include #include #include -#include #include #define VECT_POLY_MAX 8192 @@ -872,8 +871,8 @@ ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor ) const long nNewWidth = ( nOldWidth << 2L ) + 4L; const long nNewHeight = ( nOldHeight << 2L ) + 4L; const BitmapColor aTest( pRAcc->GetBestMatchingColor( rColor ) ); - boost::scoped_array pMapIn(new long[ std::max( nOldWidth, nOldHeight ) ]); - boost::scoped_array pMapOut(new long[ std::max( nOldWidth, nOldHeight ) ]); + std::unique_ptr pMapIn(new long[ std::max( nOldWidth, nOldHeight ) ]); + std::unique_ptr pMapOut(new long[ std::max( nOldWidth, nOldHeight ) ]); long nX, nY, nTmpX, nTmpY; pMap = new ImplVectMap( nNewWidth, nNewHeight ); diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx index 67109134dbe0..be7d8c2e163a 100644 --- a/vcl/source/gdi/jobset.cxx +++ b/vcl/source/gdi/jobset.cxx @@ -24,7 +24,7 @@ #include #include -#include +#include #define JOBSET_FILE364_SYSTEM ((sal_uInt16)0xFFFF) #define JOBSET_FILE605_SYSTEM ((sal_uInt16)0xFFFE) @@ -235,7 +235,7 @@ SvStream& ReadJobSetup( SvStream& rIStream, JobSetup& rJobSetup ) return rIStream; } sal_Size nFirstPos = rIStream.Tell(); - boost::scoped_array pTempBuf(new char[nRead]); + std::unique_ptr pTempBuf(new char[nRead]); rIStream.Read(pTempBuf.get(), nRead); if (nRead >= sizeof(ImplOldJobSetupData)) { diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 34db8a6d7af2..b05be6f3cb98 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -6820,7 +6820,7 @@ bool PDFWriterImpl::finalizeSignature() HASH_Begin(hc.get()); - boost::scoped_array buffer(new char[m_nSignatureContentOffset + 1]); + std::unique_ptr buffer(new char[m_nSignatureContentOffset + 1]); sal_uInt64 bytesRead; //FIXME: Check if SHA1 is calculated from the correct byterange @@ -7234,7 +7234,7 @@ bool PDFWriterImpl::finalizeSignature() // Prepare buffer and calculate PDF file digest CHECK_RETURN( (osl::File::E_None == m_aFile.setPos(osl_Pos_Absolut, 0)) ); - boost::scoped_array buffer1(new char[m_nSignatureContentOffset - 1]); + std::unique_ptr buffer1(new char[m_nSignatureContentOffset - 1]); sal_uInt64 bytesRead1; if (osl::File::E_None != m_aFile.read(buffer1.get(), m_nSignatureContentOffset - 1 , bytesRead1) || @@ -7244,7 +7244,7 @@ bool PDFWriterImpl::finalizeSignature() return false; } - boost::scoped_array buffer2(new char[nLastByteRangeNo]); + std::unique_ptr buffer2(new char[nLastByteRangeNo]); sal_uInt64 bytesRead2; if (osl::File::E_None != m_aFile.setPos(osl_Pos_Absolut, m_nSignatureContentOffset + MAX_SIGNATURE_CONTENT_LENGTH + 1) || @@ -7378,7 +7378,7 @@ bool PDFWriterImpl::finalizeSignature() SAL_INFO("vcl.pdfwriter", "nTsSigLen=" << nTsSigLen); - boost::scoped_array pTsSig(new BYTE[nTsSigLen]); + std::unique_ptr pTsSig(new BYTE[nTsSigLen]); if (!CryptMsgGetParam(hMsg, CMSG_BARE_CONTENT_PARAM, 0, pTsSig.get(), &nTsSigLen)) { @@ -7408,7 +7408,7 @@ bool PDFWriterImpl::finalizeSignature() return false; } - boost::scoped_array pDecodedSignerInfoBuf(new BYTE[nDecodedSignerInfoLen]); + std::unique_ptr pDecodedSignerInfoBuf(new BYTE[nDecodedSignerInfoLen]); if (!CryptMsgGetParam(hDecodedMsg, CMSG_SIGNER_INFO_PARAM, 0, pDecodedSignerInfoBuf.get(), &nDecodedSignerInfoLen)) { @@ -7522,7 +7522,7 @@ bool PDFWriterImpl::finalizeSignature() } SAL_INFO("vcl.pdfwriter", "Signature size is " << nSigLen << " bytes"); - boost::scoped_array pSig(new BYTE[nSigLen]); + std::unique_ptr pSig(new BYTE[nSigLen]); if (!CryptMsgGetParam(hMsg, CMSG_CONTENT_PARAM, 0, pSig.get(), &nSigLen)) { diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx index 01ff6fe5be9b..898a69730ec3 100644 --- a/vcl/source/gdi/pngwrite.cxx +++ b/vcl/source/gdi/pngwrite.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include #define PNG_DEF_COMPRESSION 6 @@ -329,7 +329,7 @@ bool PNGWriterImpl::ImplWriteHeader() void PNGWriterImpl::ImplWritePalette() { const sal_uLong nCount = mpAccess->GetPaletteEntryCount(); - boost::scoped_array pTempBuf(new sal_uInt8[nCount * 3]); + std::unique_ptr pTempBuf(new sal_uInt8[nCount * 3]); sal_uInt8* pTmp = pTempBuf.get(); ImplOpenChunk(PNGCHUNK_PLTE); diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 919db4a42da8..945f7ae9f687 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -42,7 +42,6 @@ #include #include #include -#include #include #include @@ -425,7 +424,7 @@ void SalGraphics::DrawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry, cons { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) { - boost::scoped_array pPtAry2(new SalPoint[nPoints]); + std::unique_ptr pPtAry2(new SalPoint[nPoints]); bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev ); drawPolyLine( nPoints, bCopied ? pPtAry2.get() : pPtAry ); } @@ -437,7 +436,7 @@ void SalGraphics::DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry, const { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) { - boost::scoped_array pPtAry2(new SalPoint[nPoints]); + std::unique_ptr pPtAry2(new SalPoint[nPoints]); bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev ); drawPolygon( nPoints, bCopied ? pPtAry2.get() : pPtAry ); } @@ -487,7 +486,7 @@ bool SalGraphics::DrawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry bool bResult = false; if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) { - boost::scoped_array pPtAry2(new SalPoint[nPoints]); + std::unique_ptr pPtAry2(new SalPoint[nPoints]); bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev ); bResult = drawPolyLineBezier( nPoints, bCopied ? pPtAry2.get() : pPtAry, pFlgAry ); } @@ -501,7 +500,7 @@ bool SalGraphics::DrawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, bool bResult = false; if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) { - boost::scoped_array pPtAry2(new SalPoint[nPoints]); + std::unique_ptr pPtAry2(new SalPoint[nPoints]); bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev ); bResult = drawPolygonBezier( nPoints, bCopied ? pPtAry2.get() : pPtAry, pFlgAry ); } @@ -656,7 +655,7 @@ void SalGraphics::Invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) { - boost::scoped_array pPtAry2(new SalPoint[nPoints]); + std::unique_ptr pPtAry2(new SalPoint[nPoints]); bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev ); invert( nPoints, bCopied ? pPtAry2.get() : pPtAry, nFlags ); } diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 66124beabd67..f8445bdeb9c9 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -50,7 +50,7 @@ #endif #include -#include +#include #ifdef DEBUG //#define MULTI_SL_DEBUG @@ -1573,7 +1573,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs ) { SalLayout::AdjustLayout( rArgs ); ImplLayoutArgs aMultiArgs = rArgs; - boost::scoped_array pJustificationArray; + std::unique_ptr pJustificationArray; if( !rArgs.mpDXArray && rArgs.mnLayoutWidth ) { diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx index 9e5c2aba4258..f6222ca2d9a2 100644 --- a/vcl/source/gdi/salmisc.cxx +++ b/vcl/source/gdi/salmisc.cxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #define IMPL_CASE_GET_FORMAT( Format ) \ case( BMP_FORMAT##Format ): \ @@ -219,7 +219,7 @@ static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe const ColorMask& rSrcMask = rSrcBuffer.maColorMask; const ColorMask& rDstMask = rDstBuffer.maColorMask; BitmapPalette aColMap( rSrcBuffer.maPalette.GetEntryCount() ); - boost::scoped_array pColToPalMap(new sal_uInt8[ TC_TO_PAL_COLORS ]); + std::unique_ptr pColToPalMap(new sal_uInt8[ TC_TO_PAL_COLORS ]); BitmapColor aIndex( 0 ); for( long nR = 0; nR < 16; nR++ ) diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx index 8002fcc11690..25963d5bc948 100644 --- a/vcl/source/gdi/textlayout.cxx +++ b/vcl/source/gdi/textlayout.cxx @@ -32,7 +32,7 @@ #include #endif -#include +#include namespace vcl { @@ -224,7 +224,7 @@ namespace vcl return; } - boost::scoped_array pCharWidths(new long[ _nLength ]); + std::unique_ptr pCharWidths(new long[ _nLength ]); long nTextWidth = GetTextArray( _rText, pCharWidths.get(), _nStartIndex, _nLength ); m_rTargetDevice.DrawTextArray( _rStartPoint, _rText, pCharWidths.get(), _nStartIndex, _nLength ); pCharWidths.reset(); diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index fa8e981a17be..15d6cf7a8c07 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -12,7 +12,6 @@ #include #include -#include #include #include #include diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index ff94e964914a..89b369b7a295 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -72,7 +72,7 @@ OString loadShader(const OUString& rFilename) { sal_uInt64 nSize = 0; aFile.getSize(nSize); - boost::scoped_array content(new char[nSize+1]); + std::unique_ptr content(new char[nSize+1]); sal_uInt64 nBytesRead = 0; aFile.read(content.get(), nSize, nBytesRead); assert(nSize == nBytesRead); @@ -508,7 +508,7 @@ void OpenGLHelper::renderToFile(long nWidth, long nHeight, const OUString& rFile { OpenGLZone aZone; - boost::scoped_array pBuffer(new sal_uInt8[nWidth*nHeight*4]); + std::unique_ptr pBuffer(new sal_uInt8[nWidth*nHeight*4]); glReadPixels(0, 0, nWidth, nHeight, GL_BGRA, GL_UNSIGNED_BYTE, pBuffer.get()); BitmapEx aBitmap = ConvertBGRABufferToBitmapEx(pBuffer.get(), nWidth, nHeight); try { diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 6a213d005737..34f95990ed1a 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -34,7 +34,7 @@ #include #include -#include +#include void OutputDevice::DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap ) { @@ -703,11 +703,11 @@ namespace struct LinearScaleContext { - boost::scoped_array mpMapX; - boost::scoped_array mpMapY; + std::unique_ptr mpMapX; + std::unique_ptr mpMapY; - boost::scoped_array mpMapXOffset; - boost::scoped_array mpMapYOffset; + std::unique_ptr mpMapXOffset; + std::unique_ptr mpMapYOffset; LinearScaleContext(Rectangle& aDstRect, Rectangle& aBitmapRect, Size& aOutSize, long nOffX, long nOffY) @@ -877,8 +877,8 @@ public: struct TradScaleContext { - boost::scoped_array mpMapX; - boost::scoped_array mpMapY; + std::unique_ptr mpMapX; + std::unique_ptr mpMapY; TradScaleContext(Rectangle& aDstRect, Rectangle& aBitmapRect, Size& aOutSize, long nOffX, long nOffY) diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx index 816fc6e92101..4c992b6f476e 100644 --- a/vcl/source/outdev/hatch.cxx +++ b/vcl/source/outdev/hatch.cxx @@ -30,7 +30,7 @@ #include "../gdi/pdfwriter_impl.hxx" -#include +#include #define HATCH_MAXPOINTS 1024 @@ -169,7 +169,7 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& Rectangle aRect( rPolyPoly.GetBoundRect() ); const long nLogPixelWidth = ImplDevicePixelToLogicWidth( 1 ); const long nWidth = ImplDevicePixelToLogicWidth( std::max( ImplLogicWidthToDevicePixel( rHatch.GetDistance() ), 3L ) ); - boost::scoped_array pPtBuffer(new Point[ HATCH_MAXPOINTS ]); + std::unique_ptr pPtBuffer(new Point[ HATCH_MAXPOINTS ]); Point aPt1, aPt2, aEndPt1; Size aInc; diff --git a/vcl/source/outdev/pixel.cxx b/vcl/source/outdev/pixel.cxx index 03449bddae67..b031ef40c1e7 100644 --- a/vcl/source/outdev/pixel.cxx +++ b/vcl/source/outdev/pixel.cxx @@ -21,7 +21,7 @@ #include -#include +#include #include #include #include @@ -171,7 +171,7 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color& rColor ) if( rColor != COL_TRANSPARENT && ! ImplIsRecordLayout() ) { const sal_uInt16 nSize = rPts.GetSize(); - boost::scoped_array pColArray(new Color[ nSize ]); + std::unique_ptr pColArray(new Color[ nSize ]); for( sal_uInt16 i = 0; i < nSize; i++ ) { diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx index f43c1eb78a8a..b5b790fe1c5d 100644 --- a/vcl/source/outdev/polygon.cxx +++ b/vcl/source/outdev/polygon.cxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -459,8 +459,8 @@ void OutputDevice::ImplDrawPolyPolygon( const tools::PolyPolygon& rPolyPoly, con else if( pPolyPoly->Count() ) { sal_uInt16 nCount = pPolyPoly->Count(); - boost::scoped_array pPointAry(new sal_uInt32[nCount]); - boost::scoped_array pPointAryAry(new PCONSTSALPOINT[nCount]); + std::unique_ptr pPointAry(new sal_uInt32[nCount]); + std::unique_ptr pPointAryAry(new PCONSTSALPOINT[nCount]); sal_uInt16 i = 0; do { diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 5d71838acde6..8cd2b6a44527 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -182,8 +182,8 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask // do painting const long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight(); long nX, nY; // , nWorkX, nWorkY, nWorkWidth, nWorkHeight; - boost::scoped_array pMapX(new long[ nSrcWidth + 1 ]); - boost::scoped_array pMapY(new long[ nSrcHeight + 1 ]); + std::unique_ptr pMapX(new long[ nSrcWidth + 1 ]); + std::unique_ptr pMapY(new long[ nSrcHeight + 1 ]); const bool bOldMap = mbMap; mbMap = false; diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 1cdd4d9cd41b..ee6a1b892f6b 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -71,7 +71,7 @@ #include #include -#include +#include #include #include @@ -2672,7 +2672,7 @@ void SalColormap::GetPalette() Pixel i; m_aPalette = std::vector(m_nUsed); - boost::scoped_array aColor(new XColor[m_nUsed]); + std::unique_ptr aColor(new XColor[m_nUsed]); for( i = 0; i < m_nUsed; i++ ) { diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx index 7e25fdc1b3e1..212b58677af8 100644 --- a/vcl/unx/generic/printer/jobdata.cxx +++ b/vcl/unx/generic/printer/jobdata.cxx @@ -24,7 +24,7 @@ #include #include -#include +#include using namespace psp; @@ -193,7 +193,7 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes ) // now append the PPDContext stream buffer aStream.WriteLine( "PPDContexData" ); sal_uLong nBytes; - boost::scoped_array pContextBuffer(m_aContext.getStreamableBuffer( nBytes )); + std::unique_ptr pContextBuffer(m_aContext.getStreamableBuffer( nBytes )); if( nBytes ) aStream.Write( pContextBuffer.get(), nBytes ); pContextBuffer.reset(); -- cgit v1.2.3