diff options
-rw-r--r-- | sot/source/sdstor/stgio.cxx | 5 | ||||
-rw-r--r-- | sot/source/sdstor/ucbstorage.cxx | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 7d90c490c634..304be0e35d92 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -27,6 +27,7 @@ #include <sal/log.hxx> #include <memory> +#include <optional> ///////////////////////////// class StgIo @@ -363,7 +364,7 @@ FatError StgIo::ValidateFATs() { if( m_bFile ) { - std::unique_ptr<Validator> pV(new Validator( *this )); + std::optional<Validator> pV( *this ); bool bRet1 = !pV->IsError(), bRet2 = true ; pV.reset(); @@ -376,7 +377,7 @@ FatError StgIo::ValidateFATs() StreamMode::READ | StreamMode::SHARE_DENYNONE) && aIo.Load() ) { - pV.reset(new Validator( aIo )); + pV.emplace( aIo ); bRet2 = !pV->IsError(); pV.reset(); } diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 7b26fa936db2..162748e5b5d2 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/ucb/ContentCreationException.hpp> #include <memory> +#include <optional> #include <osl/diagnose.h> #include <osl/file.hxx> #include <sal/log.hxx> @@ -2120,7 +2121,7 @@ sal_Int16 UCBStorage_Impl::Commit() { // create a stream to write the manifest file - use a temp file OUString aURL( aNewSubFolder.getURL() ); - std::unique_ptr< ::utl::TempFile> pTempFile(new ::utl::TempFile( &aURL )); + std::optional< ::utl::TempFile> pTempFile(&aURL ); // get the stream from the temp file and create an output stream wrapper SvStream* pStream = pTempFile->GetStream( StreamMode::STD_READWRITE ); |