diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-09-21 20:54:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-29 09:11:18 +0200 |
commit | 4b95451f859bac8e05956ce12df17f1ee410032d (patch) | |
tree | 2ebe03c8ecbba3c9179d33c346774e037fcfc224 /sot/source | |
parent | a08468c1a5255d3fb04cd8a0dc627acdea40426a (diff) |
split utl::TempFile into fast and named variants
which makes it easier to know what each variant requires
to stay on it's happy path
Change-Id: I3275a2543573367714bc78092e882f6535507285
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sot/source')
-rw-r--r-- | sot/source/sdstor/stg.cxx | 2 | ||||
-rw-r--r-- | sot/source/sdstor/stgstrms.cxx | 2 | ||||
-rw-r--r-- | sot/source/sdstor/ucbstorage.cxx | 12 |
3 files changed, 8 insertions, 8 deletions
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index cebade94f654..682aa08f504f 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -339,7 +339,7 @@ Storage::Storage( OUString aFile, StreamMode m, bool bDirect ) if( aName.isEmpty() ) { // no name = temporary name! - aName = utl::TempFile::CreateTempName(); + aName = utl::CreateTempName(); bTemp = true; } // the root storage creates the I/O system diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 717e4e7d175b..b58c2a7922d9 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1225,7 +1225,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n) { if( n > THRESHOLD ) { - m_aName = utl::TempFile(nullptr, false).GetURL(); + m_aName = utl::CreateTempURL(); std::unique_ptr<SvFileStream> s(new SvFileStream( m_aName, StreamMode::READWRITE )); const sal_uInt64 nCur = Tell(); sal_uInt64 i = nEndOfData; diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index e44a8a32fe7f..5b6ca1b72e11 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -460,7 +460,7 @@ public: OUString m_aContentType; OUString m_aOriginalContentType; std::unique_ptr<::ucbhelper::Content> m_pContent; // the content that provides the storage elements - std::unique_ptr<::utl::TempFile> m_pTempFile; // temporary file, only for storages on stream + std::unique_ptr<::utl::TempFileNamed> m_pTempFile; // temporary file, only for storages on stream SvStream* m_pSource; // original stream, only for storages on a stream ErrCode m_nError; StreamMode m_nMode; // open mode ( read/write/trunc/nocreate/sharing ) @@ -681,7 +681,7 @@ bool UCBStorageStream_Impl::Init() // create one if ( m_aTempURL.isEmpty() ) - m_aTempURL = ::utl::TempFile().GetURL(); + m_aTempURL = ::utl::CreateTempURL(); m_pStream = ::utl::UcbStreamHelper::CreateStream( m_aTempURL, StreamMode::STD_READWRITE, true /* bFileExists */ ); #if OSL_DEBUG_LEVEL > 0 @@ -1451,7 +1451,7 @@ UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const OU { // no name given = use temporary name! DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" ); - m_pTempFile.reset(new ::utl::TempFile); + m_pTempFile.reset(new ::utl::TempFileNamed); m_pTempFile->EnableKillingFile(); m_aName = aName = m_pTempFile->GetURL(); } @@ -1479,7 +1479,7 @@ UCBStorage_Impl::UCBStorage_Impl( const OUString& rName, StreamMode nMode, UCBSt { // no name given = use temporary name! DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" ); - m_pTempFile.reset(new ::utl::TempFile); + m_pTempFile.reset(new ::utl::TempFileNamed); m_pTempFile->EnableKillingFile(); m_aName = aName = m_pTempFile->GetURL(); } @@ -1507,7 +1507,7 @@ UCBStorage_Impl::UCBStorage_Impl( const OUString& rName, StreamMode nMode, UCBSt UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, bool bDirect ) : m_pAntiImpl( pStorage ) - , m_pTempFile( new ::utl::TempFile ) + , m_pTempFile( new ::utl::TempFileNamed ) , m_pSource( &rStream ) , m_nError( ERRCODE_NONE ) , m_bCommited( false ) @@ -2108,7 +2108,7 @@ sal_Int16 UCBStorage_Impl::Commit() { // create a stream to write the manifest file - use a temp file OUString aURL( aNewSubFolder.getURL() ); - std::optional< ::utl::TempFile> pTempFile(&aURL ); + std::optional< ::utl::TempFileNamed > pTempFile(&aURL ); // get the stream from the temp file and create an output stream wrapper SvStream* pStream = pTempFile->GetStream( StreamMode::STD_READWRITE ); |