diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-06-15 17:58:15 +0900 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-02-06 09:39:03 -0500 |
commit | ba4fac9c7543e92001cf8ae81a2a017e4d34aa34 (patch) | |
tree | 0afc3c1c6fb5947fd7aad119e4ed755276dfb197 /svl | |
parent | a9e376dbfeb3109398dcb83e56a7f9c8b7521a73 (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<[]>/'
... 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 <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 09800956191c90035872cbc18cd304fee043c710)
Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd
Diffstat (limited to 'svl')
-rw-r--r-- | svl/inc/pch/precompiled_svl.hxx | 2 | ||||
-rw-r--r-- | svl/source/items/nranges.cxx | 6 | ||||
-rw-r--r-- | svl/source/items/poolio.cxx | 1 | ||||
-rw-r--r-- | svl/source/misc/PasswordHelper.cxx | 6 |
4 files changed, 7 insertions, 8 deletions
diff --git a/svl/inc/pch/precompiled_svl.hxx b/svl/inc/pch/precompiled_svl.hxx index 34b9604332d4..dc1b13df3317 100644 --- a/svl/inc/pch/precompiled_svl.hxx +++ b/svl/inc/pch/precompiled_svl.hxx @@ -20,7 +20,7 @@ #include <boost/numeric/conversion/cast.hpp> #include <boost/ptr_container/ptr_map.hpp> #include <boost/ptr_container/ptr_vector.hpp> -#include <boost/scoped_array.hpp> +#include <memory> #include <boost/scoped_ptr.hpp> #include <cassert> #include <cmath> diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx index 35b2e482a0bb..d454058bc726 100644 --- a/svl/source/items/nranges.cxx +++ b/svl/source/items/nranges.cxx @@ -20,7 +20,7 @@ #include <cassert> #include <vector> // compiled via include from itemset.cxx only! -#include <boost/scoped_array.hpp> +#include <memory> #include <osl/diagnose.h> @@ -400,7 +400,7 @@ SfxUShortRanges& SfxUShortRanges::operator -= // (size is computed for maximal possibly split-count plus terminating 0) sal_uInt16 nThisSize = Count_Impl(_pRanges); sal_uInt16 nTargetSize = 1 + ( nThisSize + Count_Impl(rRanges._pRanges) ); - boost::scoped_array<sal_uInt16> pTarget(new sal_uInt16[ nTargetSize ]); + std::unique_ptr<sal_uInt16[]> pTarget(new sal_uInt16[ nTargetSize ]); memset( pTarget.get(), 0, sizeof(sal_uInt16)*nTargetSize ); memcpy( pTarget.get(), _pRanges, sizeof(sal_uInt16)*nThisSize ); @@ -545,7 +545,7 @@ SfxUShortRanges& SfxUShortRanges::operator /= // (size is computed for maximal possibly split-count plus terminating 0) sal_uInt16 nThisSize = Count_Impl(_pRanges); sal_uInt16 nTargetSize = 1 + ( nThisSize + Count_Impl(rRanges._pRanges) ); - boost::scoped_array<sal_uInt16> pTarget(new sal_uInt16[ nTargetSize ]); + std::unique_ptr<sal_uInt16[]> pTarget(new sal_uInt16[ nTargetSize ]); memset( pTarget.get(), 0, sizeof(sal_uInt16)*nTargetSize ); memcpy( pTarget.get(), _pRanges, sizeof(sal_uInt16)*nThisSize ); diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index 6b0fee8785f1..11b707f82612 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -28,7 +28,6 @@ #include <svl/filerec.hxx> #include "poolio.hxx" #include <boost/scoped_ptr.hpp> -#include <boost/scoped_array.hpp> /** * Returns the <SfxItemPool> that is being saved. diff --git a/svl/source/misc/PasswordHelper.cxx b/svl/source/misc/PasswordHelper.cxx index 43d320dfb8f1..00558f6a1630 100644 --- a/svl/source/misc/PasswordHelper.cxx +++ b/svl/source/misc/PasswordHelper.cxx @@ -20,7 +20,7 @@ #include <svl/PasswordHelper.hxx> #include <rtl/digest.h> -#include <boost/scoped_array.hpp> +#include <memory> using namespace com::sun::star; @@ -38,7 +38,7 @@ void SvPasswordHelper::GetHashPassword(uno::Sequence<sal_Int8>& rPassHash, const void SvPasswordHelper::GetHashPasswordLittleEndian(uno::Sequence<sal_Int8>& rPassHash, const OUString& sPass) { sal_Int32 nSize(sPass.getLength()); - boost::scoped_array<sal_Char> pCharBuffer(new sal_Char[nSize * sizeof(sal_Unicode)]); + std::unique_ptr<sal_Char[]> pCharBuffer(new sal_Char[nSize * sizeof(sal_Unicode)]); for (sal_Int32 i = 0; i < nSize; ++i) { @@ -53,7 +53,7 @@ void SvPasswordHelper::GetHashPasswordLittleEndian(uno::Sequence<sal_Int8>& rPas void SvPasswordHelper::GetHashPasswordBigEndian(uno::Sequence<sal_Int8>& rPassHash, const OUString& sPass) { sal_Int32 nSize(sPass.getLength()); - boost::scoped_array<sal_Char> pCharBuffer(new sal_Char[nSize * sizeof(sal_Unicode)]); + std::unique_ptr<sal_Char[]> pCharBuffer(new sal_Char[nSize * sizeof(sal_Unicode)]); for (sal_Int32 i = 0; i < nSize; ++i) { |