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 /canvas | |
parent | Try make JunitTest_chart2_unoapi sch.ChXChartAxis more robust (diff) | |
download | core-09800956191c90035872cbc18cd304fee043c710.tar.gz core-09800956191c90035872cbc18cd304fee043c710.zip |
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 'canvas')
-rw-r--r-- | canvas/source/cairo/cairo_textlayout.cxx | 4 | ||||
-rw-r--r-- | canvas/source/directx/dx_canvasbitmap.cxx | 4 | ||||
-rw-r--r-- | canvas/source/directx/dx_impltools.cxx | 2 | ||||
-rw-r--r-- | canvas/source/directx/dx_textlayout_drawhelper.cxx | 4 | ||||
-rw-r--r-- | canvas/source/directx/dx_vcltools.cxx | 2 | ||||
-rw-r--r-- | canvas/source/opengl/ogl_canvashelper.cxx | 4 | ||||
-rw-r--r-- | canvas/source/vcl/textlayout.cxx | 8 |
7 files changed, 12 insertions, 16 deletions
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 6f5326409999..f2f552ade9d2 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -31,7 +31,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/numeric/ftools.hxx> -#include <boost/scoped_array.hpp> +#include <memory> #include "cairo_textlayout.hxx" #include "cairo_spritecanvas.hxx" @@ -330,7 +330,7 @@ namespace cairocanvas setupLayoutMode( rOutDev, mnTextDirection ); // TODO(P2): cache that - ::boost::scoped_array< long > aOffsets(new long[maLogicalAdvancements.getLength()]); + ::std::unique_ptr< long []> aOffsets(new long[maLogicalAdvancements.getLength()]); if( maLogicalAdvancements.getLength() ) { diff --git a/canvas/source/directx/dx_canvasbitmap.cxx b/canvas/source/directx/dx_canvasbitmap.cxx index 952661542111..df06327d705e 100644 --- a/canvas/source/directx/dx_canvasbitmap.cxx +++ b/canvas/source/directx/dx_canvasbitmap.cxx @@ -28,7 +28,7 @@ #include <boost/preprocessor/repetition.hpp> #include <boost/preprocessor/iteration/local.hpp> -#include <boost/scoped_array.hpp> +#include <memory> #include "dx_canvasbitmap.hxx" #include "dx_impltools.hxx" @@ -211,7 +211,7 @@ namespace dxcanvas // copy only alpha channel to pAlphaBits const sal_Int32 nScanWidth((aSize.getX() + 3) & ~3); - boost::scoped_array<sal_uInt8> pAlphaBits( new sal_uInt8[nScanWidth*aSize.getY()] ); + std::unique_ptr<sal_uInt8[]> pAlphaBits( new sal_uInt8[nScanWidth*aSize.getY()] ); const sal_uInt8* pInBits=(sal_uInt8*)aBmpData.Scan0; pInBits+=3; for( sal_Int32 y=0; y<aSize.getY(); ++y ) diff --git a/canvas/source/directx/dx_impltools.cxx b/canvas/source/directx/dx_impltools.cxx index 3f38dc3d4d10..7830d00d89f2 100644 --- a/canvas/source/directx/dx_impltools.cxx +++ b/canvas/source/directx/dx_impltools.cxx @@ -48,8 +48,6 @@ #include "dx_canvas.hxx" #include "dx_spritecanvas.hxx" -#include <boost/scoped_array.hpp> - #include <vector> #include <algorithm> diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx index c46a49ffda25..e02c765f2f8f 100644 --- a/canvas/source/directx/dx_textlayout_drawhelper.cxx +++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx @@ -25,7 +25,7 @@ #include <vcl/canvastools.hxx> #include <tools/diagnose_ex.h> -#include <boost/scoped_array.hpp> +#include <memory> #include <boost/bind.hpp> #include <com/sun/star/rendering/FontRequest.hpp> #include <com/sun/star/rendering/PanoseProportion.hpp> @@ -207,7 +207,7 @@ namespace dxcanvas { // create the DXArray const sal_Int32 nLen( rLogicalAdvancements.getLength() ); - ::boost::scoped_array<sal_Int32> pDXArray( new sal_Int32[nLen] ); + ::std::unique_ptr<sal_Int32[]> pDXArray( new sal_Int32[nLen] ); for( sal_Int32 i=0; i<nLen; ++i ) pDXArray[i] = basegfx::fround( rLogicalAdvancements[i] ); diff --git a/canvas/source/directx/dx_vcltools.cxx b/canvas/source/directx/dx_vcltools.cxx index 727008049e68..92b1a2d6e553 100644 --- a/canvas/source/directx/dx_vcltools.cxx +++ b/canvas/source/directx/dx_vcltools.cxx @@ -34,8 +34,6 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/rendering/XIntegerBitmap.hpp> -#include <boost/scoped_array.hpp> - #include "dx_vcltools.hxx" using namespace ::com::sun::star; diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 501e7f83fe6b..15bac809a099 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -36,7 +36,7 @@ #include <GL/glew.h> -#include <boost/scoped_array.hpp> +#include <memory> using namespace ::com::sun::star; @@ -775,7 +775,7 @@ namespace oglcanvas { // create the DXArray const sal_Int32 nLen( aLogicalAdvancements.getLength() ); - ::boost::scoped_array<long> pDXArray( new long[nLen] ); + ::std::unique_ptr<long[]> pDXArray( new long[nLen] ); for( sal_Int32 i=0; i<nLen; ++i ) pDXArray[i] = basegfx::fround( aLogicalAdvancements[i] ); diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx index 9e4c7124f20f..d55054197752 100644 --- a/canvas/source/vcl/textlayout.cxx +++ b/canvas/source/vcl/textlayout.cxx @@ -36,7 +36,7 @@ #include "impltools.hxx" #include "textlayout.hxx" -#include <boost/scoped_array.hpp> +#include <memory> using namespace ::com::sun::star; @@ -119,7 +119,7 @@ namespace vclcanvas uno::Sequence<double>(4), rendering::CompositeOperation::SOURCE); - ::boost::scoped_array< long > aOffsets(new long[maLogicalAdvancements.getLength()]); + ::std::unique_ptr< long []> aOffsets(new long[maLogicalAdvancements.getLength()]); setupTextOffsets(aOffsets.get(), maLogicalAdvancements, aViewState, aRenderState); uno::Sequence< uno::Reference< rendering::XPolyPolygon2D> > aOutlineSequence; @@ -172,7 +172,7 @@ namespace vclcanvas uno::Sequence<double>(4), rendering::CompositeOperation::SOURCE); - ::boost::scoped_array< long > aOffsets(new long[maLogicalAdvancements.getLength()]); + ::std::unique_ptr< long []> aOffsets(new long[maLogicalAdvancements.getLength()]); setupTextOffsets(aOffsets.get(), maLogicalAdvancements, aViewState, aRenderState); MetricVector aMetricVector; @@ -384,7 +384,7 @@ namespace vclcanvas if( maLogicalAdvancements.getLength() ) { // TODO(P2): cache that - ::boost::scoped_array< long > aOffsets(new long[maLogicalAdvancements.getLength()]); + ::std::unique_ptr< long []> aOffsets(new long[maLogicalAdvancements.getLength()]); setupTextOffsets( aOffsets.get(), maLogicalAdvancements, viewState, renderState ); // TODO(F3): ensure correct length and termination for DX |