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 /jvmfwk | |
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 'jvmfwk')
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 4 | ||||
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 12 | ||||
-rw-r--r-- | jvmfwk/source/framework.cxx | 4 | ||||
-rw-r--r-- | jvmfwk/source/fwkutil.cxx | 6 |
4 files changed, 13 insertions, 13 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index 4094600bb5f3..518a1a955045 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -30,7 +30,7 @@ #include <string.h> -#include "boost/scoped_array.hpp" +#include <memory> #include "config_options.h" #include "osl/diagnose.h" #include "rtl/ustring.hxx" @@ -787,7 +787,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( #endif } - boost::scoped_array<JavaVMOption> sarOptions(new JavaVMOption[options.size()]); + std::unique_ptr<JavaVMOption[]> sarOptions(new JavaVMOption[options.size()]); for (std::vector<Option>::size_type i = 0; i != options.size(); ++i) { SAL_INFO( "jfw", diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 66bfde5f02e6..a22b7e04a8ce 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -34,7 +34,7 @@ #include "salhelper/linkhelper.hxx" #include "salhelper/thread.hxx" #include "boost/noncopyable.hpp" -#include "boost/scoped_array.hpp" +#include <memory> #include "com/sun/star/uno/Sequence.hxx" #include <utility> #include <algorithm> @@ -325,7 +325,7 @@ FileHandleReader::readLine(OString * pLine) class AsynchReader: public salhelper::Thread { size_t m_nDataSize; - boost::scoped_array<sal_Char> m_arData; + std::unique_ptr<sal_Char[]> m_arData; bool m_bError; bool m_bDone; @@ -385,7 +385,7 @@ void AsynchReader::execute() else if (nRead <= BUFFER_SIZE) { //Save the data we have in m_arData into a temporary array - boost::scoped_array<sal_Char> arTmp( new sal_Char[m_nDataSize]); + std::unique_ptr<sal_Char[]> arTmp( new sal_Char[m_nDataSize]); memcpy(arTmp.get(), m_arData.get(), m_nDataSize); //Enlarge m_arData to hold the newly read data m_arData.reset(new sal_Char[(size_t)(m_nDataSize + nRead)]); @@ -1212,21 +1212,21 @@ void addJavaInfosDirScan( OUString excMessage = "[Java framework] sunjavaplugin: " "Error in function addJavaInfosDirScan in util.cxx."; int cJavaNames= sizeof(g_arJavaNames) / sizeof(char*); - boost::scoped_array<OUString> sarJavaNames(new OUString[cJavaNames]); + std::unique_ptr<OUString[]> sarJavaNames(new OUString[cJavaNames]); OUString *arNames = sarJavaNames.get(); for(int i= 0; i < cJavaNames; i++) arNames[i] = OUString(g_arJavaNames[i], strlen(g_arJavaNames[i]), RTL_TEXTENCODING_UTF8); int cSearchPaths= sizeof(g_arSearchPaths) / sizeof(char*); - boost::scoped_array<OUString> sarPathNames(new OUString[cSearchPaths]); + std::unique_ptr<OUString[]> sarPathNames(new OUString[cSearchPaths]); OUString *arPaths = sarPathNames.get(); for(int c = 0; c < cSearchPaths; c++) arPaths[c] = OUString(g_arSearchPaths[c], strlen(g_arSearchPaths[c]), RTL_TEXTENCODING_UTF8); int cCollectDirs = sizeof(g_arCollectDirs) / sizeof(char*); - boost::scoped_array<OUString> sarCollectDirs(new OUString[cCollectDirs]); + std::unique_ptr<OUString[]> sarCollectDirs(new OUString[cCollectDirs]); OUString *arCollectDirs = sarCollectDirs.get(); for(int d = 0; d < cCollectDirs; d++) arCollectDirs[d] = OUString(g_arCollectDirs[d], strlen(g_arCollectDirs[d]), diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index eff92ecb2713..f15a045f542d 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "boost/scoped_array.hpp" +#include <memory> #include "rtl/ustring.hxx" #include "rtl/bootstrap.hxx" #include "osl/thread.hxx" @@ -305,7 +305,7 @@ javaFrameworkError SAL_CALL jfw_startVM( // create JavaVMOptions array that is passed to the plugin // it contains the classpath and all options set in the //options dialog - boost::scoped_array<JavaVMOption> sarJOptions( + std::unique_ptr<JavaVMOption[]> sarJOptions( new JavaVMOption[cOptions + 2 + vmParams.size()]); JavaVMOption * arOpt = sarJOptions.get(); if (! arOpt) diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx index fcb622f2728a..a48f25faa977 100644 --- a/jvmfwk/source/fwkutil.cxx +++ b/jvmfwk/source/fwkutil.cxx @@ -46,7 +46,7 @@ #include "framework.hxx" #include "fwkutil.hxx" -#include <boost/scoped_array.hpp> +#include <memory> using namespace osl; @@ -115,7 +115,7 @@ rtl::ByteSequence encodeBase16(const rtl::ByteSequence& rawData) static const char EncodingTable[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; sal_Int32 lenRaw = rawData.getLength(); - boost::scoped_array<char> pBuf(new char[lenRaw * 2]); + std::unique_ptr<char[]> pBuf(new char[lenRaw * 2]); const sal_Int8* arRaw = rawData.getConstArray(); char* pCurBuf = pBuf.get(); @@ -144,7 +144,7 @@ rtl::ByteSequence decodeBase16(const rtl::ByteSequence& data) {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; sal_Int32 lenData = data.getLength(); sal_Int32 lenBuf = lenData / 2; //always divisable by two - boost::scoped_array<unsigned char> pBuf(new unsigned char[lenBuf]); + std::unique_ptr<unsigned char[]> pBuf(new unsigned char[lenBuf]); const sal_Int8* pData = data.getConstArray(); for (sal_Int32 i = 0; i < lenBuf; i++) { |