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/filter/wmf/winwmf.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/filter/wmf/winwmf.cxx')
-rw-r--r-- | vcl/source/filter/wmf/winwmf.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index 59c622732539..343b74f54a15 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -19,7 +19,7 @@ #include "winmtf.hxx" -#include <boost/scoped_array.hpp> +#include <memory> #include <boost/optional.hpp> #include <vcl/gdimtf.hxx> #include <vcl/wmf.hxx> @@ -383,7 +383,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) } // Number of points of each polygon. Determine total number of points - boost::scoped_array<sal_uInt16> xPolygonPointCounts(new sal_uInt16[nPolyCount]); + std::unique_ptr<sal_uInt16[]> 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<Point> xPolygonPoints(new Point[nPointCount]); + std::unique_ptr<Point[]> 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<char> pChar(new char[ ( nLength + 1 ) &~ 1 ]); + std::unique_ptr<char[]> 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<long> pDXAry; + std::unique_ptr<long[]> 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<char> pChar(new char[ ( nOriginalTextLen + 1 ) &~ 1 ]); + std::unique_ptr<char[]> 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<sal_Int8> pData; + std::unique_ptr<sal_Int8[]> 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<long> pDXAry; + std::unique_ptr<long[]> 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<sal_Int8> pBuf(new sal_Int8[ nCurRecSize ]); + std::unique_ptr<sal_Int8[]> pBuf(new sal_Int8[ nCurRecSize ]); sal_uInt32 nCount = pWMF->Read( pBuf.get(), nCurRecSize ); if( nCount == nCurRecSize ) pEMFStream->Write( pBuf.get(), nCount ); |