diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-08-27 10:18:06 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-08-27 12:06:15 +0000 |
commit | 33b38082ca63813f7c478945be198cc504efde4b (patch) | |
tree | 030eb240e231d855e477d985c3edc36304dd2914 /sot | |
parent | 81a7aeb0806298c7a8571a46e09f485f3cf5ea13 (diff) |
put StreamMode masks in scope of enum class
Change-Id: I77682f7e289a59b986bb84edf014029a20266470
Reviewed-on: https://gerrit.libreoffice.org/28420
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stg.cxx | 8 | ||||
-rw-r--r-- | sot/source/sdstor/stgstrms.cxx | 2 | ||||
-rw-r--r-- | sot/source/sdstor/storage.cxx | 2 | ||||
-rw-r--r-- | sot/source/sdstor/ucbstorage.cxx | 20 |
4 files changed, 16 insertions, 16 deletions
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index ab256fd1a628..26703ff5fd15 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -128,7 +128,7 @@ bool OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) if( m == INTERNAL_MODE ) return true; StreamMode nCurMode = ( p && p->m_nRefCnt ) ? p->m_nMode : StreamMode::SHARE_DENYALL; - if( ( m & STREAM_READWRITE ) == StreamMode::READ ) + if( ( m & StreamMode::READWRITE ) == StreamMode::READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed if( ( ( m & StreamMode::SHARE_DENYWRITE ) @@ -166,7 +166,7 @@ StorageStream::StorageStream( StgIo* p, StgDirEntry* q, StreamMode m ) } } else - m &= ~StreamMode(STREAM_READWRITE); + m &= ~StreamMode(StreamMode::READWRITE); m_nMode = m; } @@ -304,7 +304,7 @@ SvStorageInfo::SvStorageInfo( const StgDirEntry& rE ) bool Storage::IsStorageFile( const OUString & rFileName ) { StgIo aIo; - if( aIo.Open( rFileName, STREAM_STD_READ ) ) + if( aIo.Open( rFileName, StreamMode::STD_READ ) ) return aIo.Load(); return false; } @@ -478,7 +478,7 @@ Storage::Storage( StgIo* p, StgDirEntry* q, StreamMode m ) if( q ) q->m_aEntry.GetName( aName ); else - m &= ~StreamMode(STREAM_READWRITE); + m &= ~StreamMode(StreamMode::READWRITE); m_nMode = m; if( q && q->m_nRefCnt == 1 ) q->m_nMode = m; diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 521c6cf5adde..92473d0bca47 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1197,7 +1197,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n) if( n > THRESHOLD ) { m_aName = utl::TempFile(nullptr, false).GetURL(); - SvFileStream* s = new SvFileStream( m_aName, STREAM_READWRITE ); + SvFileStream* s = new SvFileStream( m_aName, StreamMode::READWRITE ); const sal_uInt64 nCur = Tell(); sal_uInt64 i = nEndOfData; std::unique_ptr<sal_uInt8[]> p(new sal_uInt8[ 4096 ]); diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 6ff2bf862c6d..3d26f5c12116 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -491,7 +491,7 @@ bool SotStorage::IsStorageFile( const OUString & rFileName ) aName = aObj.GetMainURL( INetURLObject::NO_DECODE ); } - std::unique_ptr<SvStream> pStm(::utl::UcbStreamHelper::CreateStream( aName, STREAM_STD_READ )); + std::unique_ptr<SvStream> pStm(::utl::UcbStreamHelper::CreateStream( aName, StreamMode::STD_READ )); bool bRet = SotStorage::IsStorageFile( pStm.get() ); return bRet; } diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index b61053976f73..7ea86ab09978 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -287,7 +287,7 @@ void FileStreamWrapper_Impl::checkConnected() throw NotConnectedException(OUString(), const_cast<XWeak*>(static_cast<const XWeak*>(this))); if ( !m_pSvStream ) { - m_pSvStream = ::utl::UcbStreamHelper::CreateStream( m_aURL, STREAM_STD_READ ); + m_pSvStream = ::utl::UcbStreamHelper::CreateStream( m_aURL, StreamMode::STD_READ ); #if OSL_DEBUG_LEVEL > 0 ++nOpenFiles; #endif @@ -726,7 +726,7 @@ bool UCBStorageStream_Impl::Init() if ( m_aTempURL.isEmpty() ) m_aTempURL = ::utl::TempFile().GetURL(); - m_pStream = ::utl::UcbStreamHelper::CreateStream( m_aTempURL, STREAM_STD_READWRITE, true /* bFileExists */ ); + m_pStream = ::utl::UcbStreamHelper::CreateStream( m_aTempURL, StreamMode::STD_READWRITE, true /* bFileExists */ ); #if OSL_DEBUG_LEVEL > 0 ++nOpenFiles; #endif @@ -1314,7 +1314,7 @@ bool UCBStorageStream::ValidateMode( StreamMode m ) const // ??? if( m == ( StreamMode::READ | StreamMode::TRUNC ) ) // from stg.cxx return true; - if( ( m & STREAM_READWRITE) == StreamMode::READ ) + if( ( m & StreamMode::READWRITE) == StreamMode::READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed if( ( m & StreamMode::SHARE_DENYWRITE ) @@ -1561,7 +1561,7 @@ UCBStorage_Impl::UCBStorage_Impl( const OUString& rName, StreamMode nMode, UCBSt if ( m_nMode & StreamMode::WRITE ) { // the root storage opens the package, so make sure that there is any - SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aName, STREAM_STD_READWRITE, m_pTempFile != nullptr /* bFileExists */ ); + SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aName, StreamMode::STD_READWRITE, m_pTempFile != nullptr /* bFileExists */ ); delete pStream; } } @@ -1603,7 +1603,7 @@ UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, bool m_aURL = aTemp; // copy data into the temporary file - std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), STREAM_STD_READWRITE, true /* bFileExists */ )); + std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), StreamMode::STD_READWRITE, true /* bFileExists */ )); if ( pStream ) { rStream.Seek(0); @@ -1646,7 +1646,7 @@ void UCBStorage_Impl::Init() aObj.Append( "manifest.xml" ); // create input stream - std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ )); + std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::STD_READ )); // no stream means no manifest.xml if ( pStream ) { @@ -1815,7 +1815,7 @@ void UCBStorage_Impl::ReadContent() else if ( aMediaType.isEmpty() ) { // older files didn't have that special content type, so they must be detected - OpenStream( pElement, STREAM_STD_READ, m_bDirect, nullptr ); + OpenStream( pElement, StreamMode::STD_READ, m_bDirect, nullptr ); if ( Storage::IsStorageFile( pElement->m_xStream ) ) pElement->m_bIsStorage = true; else @@ -2218,7 +2218,7 @@ sal_Int16 UCBStorage_Impl::Commit() std::unique_ptr< ::utl::TempFile> pTempFile(new ::utl::TempFile( &aURL )); // get the stream from the temp file and create an output stream wrapper - SvStream* pStream = pTempFile->GetStream( STREAM_STD_READWRITE ); + SvStream* pStream = pTempFile->GetStream( StreamMode::STD_READWRITE ); ::utl::OOutputStreamWrapper* pHelper = new ::utl::OOutputStreamWrapper( *pStream ); css::uno::Reference < css::io::XOutputStream > xOutputStream( pHelper ); @@ -2251,7 +2251,7 @@ sal_Int16 UCBStorage_Impl::Commit() m_pContent->executeCommand( "flush", aAny ); if ( m_pSource != nullptr ) { - std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), STREAM_STD_READ )); + std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), StreamMode::STD_READ )); m_pSource->SetStreamSize(0); // m_pSource->Seek(0); pStream->ReadStream( *m_pSource ); @@ -2473,7 +2473,7 @@ bool UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base pStream = rElement.m_xStream->m_pAntiImpl; if ( !pStream ) { - pStream = ( const_cast < UCBStorage* > (this) )->OpenStream( rElement.m_aName, STREAM_STD_READ, pImp->m_bDirect ); + pStream = ( const_cast < UCBStorage* > (this) )->OpenStream( rElement.m_aName, StreamMode::STD_READ, pImp->m_bDirect ); bDeleteStream = true; } |