From 09800956191c90035872cbc18cd304fee043c710 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<\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 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- chart2/inc/pch/precompiled_chartcore.hxx | 2 +- chart2/source/tools/OPropertySet.cxx | 6 +++--- chart2/source/view/charttypes/Splines.cxx | 12 ++++++------ chart2/source/view/main/GL3DRenderer.cxx | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'chart2') diff --git a/chart2/inc/pch/precompiled_chartcore.hxx b/chart2/inc/pch/precompiled_chartcore.hxx index 7527cd7750db..4999b67790f4 100644 --- a/chart2/inc/pch/precompiled_chartcore.hxx +++ b/chart2/inc/pch/precompiled_chartcore.hxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx index c54537f5a9ea..939741c4f210 100644 --- a/chart2/source/tools/OPropertySet.cxx +++ b/chart2/source/tools/OPropertySet.cxx @@ -25,7 +25,7 @@ #include #include -#include +#include using namespace ::com::sun::star; @@ -143,7 +143,7 @@ Sequence< beans::PropertyState > SAL_CALL { cppu::IPropertyArrayHelper & rPH = getInfoHelper(); - boost::scoped_array pHandles(new sal_Int32[ aPropertyName.getLength() ]); + std::unique_ptr pHandles(new sal_Int32[ aPropertyName.getLength() ]); rPH.fillHandles( pHandles.get(), aPropertyName ); ::std::vector< sal_Int32 > aHandles( pHandles.get(), pHandles.get() + aPropertyName.getLength()); @@ -194,7 +194,7 @@ void SAL_CALL { cppu::IPropertyArrayHelper & rPH = getInfoHelper(); - boost::scoped_array pHandles(new sal_Int32[ aPropertyNames.getLength() ]); + std::unique_ptr pHandles(new sal_Int32[ aPropertyNames.getLength() ]); rPH.fillHandles( pHandles.get(), aPropertyNames ); ::std::vector< sal_Int32 > aHandles( pHandles.get(), pHandles.get() + aPropertyNames.getLength()); diff --git a/chart2/source/view/charttypes/Splines.cxx b/chart2/source/view/charttypes/Splines.cxx index 660c8ce01f7a..c57acb649601 100644 --- a/chart2/source/view/charttypes/Splines.cxx +++ b/chart2/source/view/charttypes/Splines.cxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #define MAX_BSPLINE_DEGREE 15 @@ -721,14 +721,14 @@ void SplineCalculater::CalculateBSplines( continue; // need at least 2 points, degree p needs at least n+1 points // next piece of series - boost::scoped_array t(new double [n+1]); + std::unique_ptr t(new double [n+1]); if (!createParameterT(aPointsIn, t.get())) { continue; // next piece of series } lcl_tSizeType m = n + p + 1; - boost::scoped_array u(new double [m+1]); + std::unique_ptr u(new double [m+1]); createKnotVector(n, p, t.get(), u.get()); // The matrix N contains the B-spline basis functions applied to parameters. @@ -736,14 +736,14 @@ void SplineCalculater::CalculateBSplines( // column in a higher row is equal or greater than in the lower row. // To store this matrix the non-zero elements are shifted to column 0 // and the amount of shifting is remembered in an array. - boost::scoped_array aMatN(new double*[n+1]); + std::unique_ptr aMatN(new double*[n+1]); for (lcl_tSizeType row = 0; row <=n; ++row) { aMatN[row] = new double[p+1]; for (sal_uInt32 col = 0; col <= p; ++col) aMatN[row][col] = 0.0; } - boost::scoped_array aShift(new lcl_tSizeType[n+1]); + std::unique_ptr aShift(new lcl_tSizeType[n+1]); aMatN[0][0] = 1.0; //all others are zero aShift[0] = 0; aMatN[n][0] = 1.0; @@ -879,7 +879,7 @@ void SplineCalculater::CalculateBSplines( pNewX[nNewSize -1 ] = aPointsIn[n].first; pNewY[nNewSize -1 ] = aPointsIn[n].second; pNewZ[nNewSize -1 ] = fZCoordinate; - boost::scoped_array aP(new double[m+1]); + std::unique_ptr aP(new double[m+1]); lcl_tSizeType nLow = 0; for ( lcl_tSizeType nTIndex = 0; nTIndex <= n-1; ++nTIndex) { diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx index ee3dbb59b93c..4d10e4f8b4d2 100644 --- a/chart2/source/view/main/GL3DRenderer.cxx +++ b/chart2/source/view/main/GL3DRenderer.cxx @@ -20,7 +20,7 @@ #include #include "glm/gtc/matrix_inverse.hpp" #include -#include +#include #define DEBUG_FBO 0 @@ -2257,7 +2257,7 @@ sal_uInt32 OpenGL3DRenderer::GetPixelColorFromPoint(long nX, long nY) static sal_uInt32 nId = 0; OUString aFileName = "/home/moggi/work/picking_" + OUString::number(nId++) + ".png"; OpenGLHelper::renderToFile(m_iWidth, m_iHeight, aFileName); - boost::scoped_array buf(new sal_uInt8[4]); + std::unique_ptr buf(new sal_uInt8[4]); glReadPixels(nX, m_iHeight-nY, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, buf.get()); Color aColor(255-buf[3], buf[2], buf[1], buf[0]); return aColor.GetColor(); -- cgit