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 /chart2/source/view | |
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 'chart2/source/view')
-rw-r--r-- | chart2/source/view/charttypes/Splines.cxx | 12 | ||||
-rw-r--r-- | chart2/source/view/main/GL3DRenderer.cxx | 4 |
2 files changed, 8 insertions, 8 deletions
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 <vector> #include <algorithm> #include <functional> -#include <boost/scoped_array.hpp> +#include <memory> #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<double> t(new double [n+1]); + std::unique_ptr<double[]> t(new double [n+1]); if (!createParameterT(aPointsIn, t.get())) { continue; // next piece of series } lcl_tSizeType m = n + p + 1; - boost::scoped_array<double> u(new double [m+1]); + std::unique_ptr<double[]> 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<double*> aMatN(new double*[n+1]); + std::unique_ptr<double*[]> 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<lcl_tSizeType> aShift(new lcl_tSizeType[n+1]); + std::unique_ptr<lcl_tSizeType[]> 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<double> aP(new double[m+1]); + std::unique_ptr<double[]> 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 <StaticGeometry.h> #include "glm/gtc/matrix_inverse.hpp" #include <boost/checked_delete.hpp> -#include <boost/scoped_array.hpp> +#include <memory> #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<sal_uInt8> buf(new sal_uInt8[4]); + std::unique_ptr<sal_uInt8[]> 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(); |