diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-09-23 12:08:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-09-23 14:32:43 +0000 |
commit | 09b637e36528165f5e937a418640d95440dac9ef (patch) | |
tree | 4d5a495612da5a3341ef1e19763b116ae547c856 /writerperfect | |
parent | 6e7f5c5fce198bf2f3a228e1faea7f7e9ed09f77 (diff) |
boost::scoped_ptr->std::unique_ptr
Change-Id: I03020e3536ee692a96224a517794c0d0a294f607
Reviewed-on: https://gerrit.libreoffice.org/18793
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 'writerperfect')
-rw-r--r-- | writerperfect/qa/unit/DirectoryStreamTest.cxx | 14 | ||||
-rw-r--r-- | writerperfect/source/common/WPXSvInputStream.cxx | 17 |
2 files changed, 15 insertions, 16 deletions
diff --git a/writerperfect/qa/unit/DirectoryStreamTest.cxx b/writerperfect/qa/unit/DirectoryStreamTest.cxx index 209fe1590f9b..6ab8d384e20c 100644 --- a/writerperfect/qa/unit/DirectoryStreamTest.cxx +++ b/writerperfect/qa/unit/DirectoryStreamTest.cxx @@ -7,7 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <boost/scoped_ptr.hpp> +#include <memory> #include <cppunit/extensions/HelperMacros.h> @@ -22,7 +22,7 @@ namespace ucb = com::sun::star::ucb; namespace uno = com::sun::star::uno; -using boost::scoped_ptr; +using std::unique_ptr; using librevenge::RVNGInputStream; @@ -74,17 +74,17 @@ DirectoryStreamTest::DirectoryStreamTest() void DirectoryStreamTest::testConstruction() { - const scoped_ptr<DirectoryStream> pDir(DirectoryStream::createForParent(m_xFile)); + const unique_ptr<DirectoryStream> pDir(DirectoryStream::createForParent(m_xFile)); CPPUNIT_ASSERT(bool(pDir)); CPPUNIT_ASSERT(pDir->isStructured()); // this should work for dirs too - const scoped_ptr<DirectoryStream> pDir2(DirectoryStream::createForParent(m_xDir)); + const unique_ptr<DirectoryStream> pDir2(DirectoryStream::createForParent(m_xDir)); CPPUNIT_ASSERT(bool(pDir2)); CPPUNIT_ASSERT(pDir2->isStructured()); // for nonexistent dirs nothing is created - const scoped_ptr<DirectoryStream> pNondir(DirectoryStream::createForParent(m_xNonexistent)); + const unique_ptr<DirectoryStream> pNondir(DirectoryStream::createForParent(m_xNonexistent)); CPPUNIT_ASSERT(!pNondir); // even if we try harder, just an empty shell is created @@ -125,7 +125,7 @@ void DirectoryStreamTest::testDataOperations() void lcl_testStructuredOperations(RVNGInputStream &rStream) { CPPUNIT_ASSERT(rStream.isStructured()); - scoped_ptr<RVNGInputStream> pSubstream(rStream.getSubStreamByName("mimetype")); + unique_ptr<RVNGInputStream> pSubstream(rStream.getSubStreamByName("mimetype")); CPPUNIT_ASSERT(bool(pSubstream)); // TODO: test for other operations when they are implemented =) @@ -136,7 +136,7 @@ void DirectoryStreamTest::testStructuredOperations() DirectoryStream aDir(m_xDir); lcl_testStructuredOperations(aDir); - scoped_ptr<DirectoryStream> pDir(DirectoryStream::createForParent(m_xFile)); + unique_ptr<DirectoryStream> pDir(DirectoryStream::createForParent(m_xFile)); CPPUNIT_ASSERT(bool(pDir)); lcl_testStructuredOperations(*pDir.get()); } diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx index 84bcabb3ab90..584627debda7 100644 --- a/writerperfect/source/common/WPXSvInputStream.cxx +++ b/writerperfect/source/common/WPXSvInputStream.cxx @@ -23,12 +23,11 @@ #include <unotools/streamwrap.hxx> #include <unotools/ucbstreamhelper.hxx> -#include <limits> -#include <vector> - #include <boost/noncopyable.hpp> -#include <boost/scoped_ptr.hpp> +#include <limits> +#include <memory> #include <unordered_map> +#include <vector> namespace writerperfect { @@ -431,8 +430,8 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > mxStream; ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable > mxSeekable; ::com::sun::star::uno::Sequence< sal_Int8 > maData; - boost::scoped_ptr< OLEStorageImpl > mpOLEStorage; - boost::scoped_ptr< ZipStorageImpl > mpZipStorage; + std::unique_ptr< OLEStorageImpl > mpOLEStorage; + std::unique_ptr< ZipStorageImpl > mpZipStorage; bool mbCheckedOLE; bool mbCheckedZip; public: @@ -446,8 +445,8 @@ WPXSvInputStreamImpl::WPXSvInputStreamImpl(Reference< XInputStream > xStream) : mxStream(xStream), mxSeekable(xStream, UNO_QUERY), maData(0), - mpOLEStorage(0), - mpZipStorage(0), + mpOLEStorage(nullptr), + mpZipStorage(nullptr), mbCheckedOLE(false), mbCheckedZip(false), mnLength(0), @@ -755,7 +754,7 @@ bool WPXSvInputStreamImpl::isOLE() { assert(0 == mxSeekable->getPosition()); - boost::scoped_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(mxStream)); + std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(mxStream)); if (pStream && SotStorage::IsOLEStorage(pStream.get())) mpOLEStorage.reset(new OLEStorageImpl()); |