diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-07 09:28:42 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-07 11:20:44 +0200 |
commit | 7f8f277b94704a289fbbd1b836e4e5d66311580d (patch) | |
tree | 2400b7306a0a2a3ea63aee2e5bfc336b52102635 | |
parent | 8db77209e0755d21d9efc34f70a2978d1df5d2c6 (diff) |
fdo#84938: convert STREAM_ #defines to 'enum class'
Change-Id: Ibbf14c7e9a5c1883c1311d4c86f948f74f8e473e
256 files changed, 751 insertions, 772 deletions
diff --git a/avmedia/source/macavf/framegrabber.mm b/avmedia/source/macavf/framegrabber.mm index 6c2609dd2962..4662720ff44b 100644 --- a/avmedia/source/macavf/framegrabber.mm +++ b/avmedia/source/macavf/framegrabber.mm @@ -99,7 +99,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe void* pBitmapBytes = (void*)CFDataGetBytePtr( pCFData ); // convert the image into the return-value type which is a graphic::XGraphic - SvMemoryStream aMemStm( pBitmapBytes, nBitmapLen, STREAM_READ | STREAM_WRITE ); + SvMemoryStream aMemStm( pBitmapBytes, nBitmapLen, StreamMode::READ | StreamMode::WRITE ); Graphic aGraphic; if( GraphicConverter::Import( aMemStm, aGraphic, CVT_TIF ) == ERRCODE_NONE ) xRet = aGraphic.GetXGraphic(); diff --git a/avmedia/source/opengl/oglplayer.cxx b/avmedia/source/opengl/oglplayer.cxx index 910974e5adea..8bc513bb9592 100644 --- a/avmedia/source/opengl/oglplayer.cxx +++ b/avmedia/source/opengl/oglplayer.cxx @@ -46,7 +46,7 @@ OGLPlayer::~OGLPlayer() static bool lcl_LoadFile( glTFFile* io_pFile, const OUString& rURL) { - SvFileStream aStream( rURL, STREAM_READ ); + SvFileStream aStream( rURL, StreamMode::READ ); if( !aStream.IsOpen() ) return false; diff --git a/avmedia/source/quicktime/framegrabber.mm b/avmedia/source/quicktime/framegrabber.mm index 7f7ee5986df5..5a92e79bcc88 100644 --- a/avmedia/source/quicktime/framegrabber.mm +++ b/avmedia/source/quicktime/framegrabber.mm @@ -97,7 +97,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe NSData *pBitmap = [pImage TIFFRepresentation]; long nSize = [pBitmap length]; const void* pBitmapData = [pBitmap bytes]; - SvMemoryStream aMemStm( (char *)pBitmapData, nSize, STREAM_READ | STREAM_WRITE ); + SvMemoryStream aMemStm( (char *)pBitmapData, nSize, StreamMode::READ | StreamMode::WRITE ); Graphic aGraphic; if ( GraphicConverter::Import( aMemStm, aGraphic, CVT_TIF ) == ERRCODE_NONE ) { diff --git a/avmedia/source/win/framegrabber.cxx b/avmedia/source/win/framegrabber.cxx index 1418276c1626..63303827d76b 100644 --- a/avmedia/source/win/framegrabber.cxx +++ b/avmedia/source/win/framegrabber.cxx @@ -173,7 +173,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe { if( SUCCEEDED( pDet->GetBitmapBits( fMediaTime, NULL, pBuffer, nWidth, nHeight ) ) ) { - SvMemoryStream aMemStm( pBuffer, nSize, STREAM_READ | STREAM_WRITE ); + SvMemoryStream aMemStm( pBuffer, nSize, StreamMode::READ | StreamMode::WRITE ); Bitmap aBmp; if( ReadDIB(aBmp, aMemStm, false ) && !aBmp.IsEmpty() ) diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index d8bf5b41afcd..1d2daa63eaac 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -426,7 +426,7 @@ bool ModulWindow::LoadBasic() { Sequence< OUString > aPaths = xFP->getFiles(); aCurPath = aPaths[0]; - SfxMedium aMedium( aCurPath, STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE ); + SfxMedium aMedium( aCurPath, StreamMode::READ | StreamMode::SHARE_DENYWRITE | StreamMode::NOCREATE ); SvStream* pStream = aMedium.GetInStream(); if ( pStream ) { @@ -477,7 +477,7 @@ bool ModulWindow::SaveBasicSource() { Sequence< OUString > aPaths = xFP->getFiles(); aCurPath = aPaths[0]; - SfxMedium aMedium( aCurPath, STREAM_WRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC ); + SfxMedium aMedium( aCurPath, StreamMode::WRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC ); SvStream* pStream = aMedium.GetOutStream(); if ( pStream ) { diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 1bd399e4a807..cdd734d02452 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -110,7 +110,7 @@ void setTextEngineText (ExtTextEngine& rEngine, OUString const& aStr) rEngine.SetText(OUString()); OString aUTF8Str = OUStringToOString( aStr, RTL_TEXTENCODING_UTF8 ); SvMemoryStream aMemStream( (void*)aUTF8Str.getStr(), aUTF8Str.getLength(), - STREAM_READ | STREAM_SEEK_TO_BEGIN ); + StreamMode::READ ); aMemStream.SetStreamCharSet( RTL_TEXTENCODING_UTF8 ); aMemStream.SetLineDelimiter( LINEEND_LF ); rEngine.Read(aMemStream); diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index a9ef314baf9c..224d1af368da 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -100,8 +100,8 @@ static const char szCryptingKey[] = "CryptedBasic"; TYPEINIT1( BasicManager, SfxBroadcaster ); -StreamMode eStreamReadMode = STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL; -StreamMode eStorageReadMode = STREAM_READ | STREAM_SHARE_DENYWRITE; +const StreamMode eStreamReadMode = StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL; +const StreamMode eStorageReadMode = StreamMode::READ | StreamMode::SHARE_DENYWRITE; // BasicManager impl data @@ -1536,7 +1536,7 @@ StarBASIC* BasicManager::CreateLib( const OUString& rLibName, const OUString& Pa { try { - SotStorageRef xStorage = new SotStorage(false, LinkTargetURL, STREAM_READ | STREAM_SHARE_DENYWRITE); + SotStorageRef xStorage = new SotStorage(false, LinkTargetURL, StreamMode::READ | StreamMode::SHARE_DENYWRITE); if (!xStorage->GetError()) { pLib = AddLib(*xStorage, rLibName, true); @@ -2049,7 +2049,7 @@ uno::Sequence< sal_Int8 > implGetDialogData( SbxObject* pDialog ) SbxObject* implCreateDialog( const uno::Sequence< sal_Int8 >& aData ) { sal_Int8* pData = const_cast< uno::Sequence< sal_Int8 >& >(aData).getArray(); - SvMemoryStream aMemStream( pData, aData.getLength(), STREAM_READ ); + SvMemoryStream aMemStream( pData, aData.getLength(), StreamMode::READ ); SbxBase* pBase = SbxBase::Load( aMemStream ); return dynamic_cast<SbxObject*>(pBase); } diff --git a/basic/source/comp/io.cxx b/basic/source/comp/io.cxx index 0ac30a693ded..2265ed530649 100644 --- a/basic/source/comp/io.cxx +++ b/basic/source/comp/io.cxx @@ -173,20 +173,20 @@ void SbiParser::Open() SbiExpression aFileName( this ); SbiToken eTok; TestToken( FOR ); - short nMode = 0; + StreamMode nMode = StreamMode::NONE; short nFlags = 0; switch( Next() ) { case INPUT: - nMode = STREAM_READ; nFlags |= SBSTRM_INPUT; break; + nMode = StreamMode::READ; nFlags |= SBSTRM_INPUT; break; case OUTPUT: - nMode = STREAM_WRITE | STREAM_TRUNC; nFlags |= SBSTRM_OUTPUT; break; + nMode = StreamMode::WRITE | StreamMode::TRUNC; nFlags |= SBSTRM_OUTPUT; break; case APPEND: - nMode = STREAM_WRITE; nFlags |= SBSTRM_APPEND; break; + nMode = StreamMode::WRITE; nFlags |= SBSTRM_APPEND; break; case RANDOM: - nMode = STREAM_READ | STREAM_WRITE; nFlags |= SBSTRM_RANDOM; break; + nMode = StreamMode::READ | StreamMode::WRITE; nFlags |= SBSTRM_RANDOM; break; case BINARY: - nMode = STREAM_READ | STREAM_WRITE; nFlags |= SBSTRM_BINARY; break; + nMode = StreamMode::READ | StreamMode::WRITE; nFlags |= SBSTRM_BINARY; break; default: Error( SbERR_SYNTAX ); } @@ -194,20 +194,20 @@ void SbiParser::Open() { Next(); eTok = Next(); - // influence only STREAM_READ,STREAM_WRITE-Flags in nMode - nMode &= ~(STREAM_READ | STREAM_WRITE); // delete + // influence only READ,WRITE-Flags in nMode + nMode &= ~StreamMode(StreamMode::READ | StreamMode::WRITE); // delete if( eTok == READ ) { if( Peek() == WRITE ) { Next(); - nMode |= (STREAM_READ | STREAM_WRITE); + nMode |= (StreamMode::READ | StreamMode::WRITE); } else - nMode |= STREAM_READ; + nMode |= StreamMode::READ; } else if( eTok == WRITE ) - nMode |= STREAM_WRITE; + nMode |= StreamMode::WRITE; else Error( SbERR_SYNTAX ); } @@ -218,7 +218,7 @@ void SbiParser::Open() #define tmpSHARED #endif case SHARED: - Next(); nMode |= STREAM_SHARE_DENYNONE; break; + Next(); nMode |= StreamMode::SHARE_DENYNONE; break; #ifdef tmpSHARED #define SHARED #undef tmpSHARED @@ -228,11 +228,11 @@ void SbiParser::Open() eTok = Next(); if( eTok == READ ) { - if( Peek() == WRITE ) Next(), nMode |= STREAM_SHARE_DENYALL; - else nMode |= STREAM_SHARE_DENYREAD; + if( Peek() == WRITE ) Next(), nMode |= StreamMode::SHARE_DENYALL; + else nMode |= StreamMode::SHARE_DENYREAD; } else if( eTok == WRITE ) - nMode |= STREAM_SHARE_DENYWRITE; + nMode |= StreamMode::SHARE_DENYWRITE; else Error( SbERR_SYNTAX ); break; @@ -262,7 +262,7 @@ void SbiParser::Open() if( pChan ) pChan->Gen(); aFileName.Gen(); - aGen.Gen( _OPEN, nMode, nFlags ); + aGen.Gen( _OPEN, static_cast<sal_uInt32>(nMode), nFlags ); bInStatement = false; } diff --git a/basic/source/inc/iosys.hxx b/basic/source/inc/iosys.hxx index 80ba1ee95086..85c29ca60d25 100644 --- a/basic/source/inc/iosys.hxx +++ b/basic/source/inc/iosys.hxx @@ -51,7 +51,7 @@ class SbiStream public: SbiStream(); ~SbiStream(); - SbError Open( short, const OString&, short, short, short ); + SbError Open( short, const OString&, StreamMode, short, short ); SbError Close(); SbError Read(OString&, sal_uInt16 = 0, bool bForceReadingPerByte=false); SbError Read( char& ); @@ -89,7 +89,7 @@ public: void SetChannel( short n ) { nChan = n; } short GetChannel() const { return nChan;} void ResetChannel() { nChan = 0; } - void Open( short, const OString&, short, short, short ); + void Open( short, const OString&, StreamMode, short, short ); void Close(); void Read(OString&, short = 0); char Read(); diff --git a/basic/source/inc/opcodes.hxx b/basic/source/inc/opcodes.hxx index 38948d7ca2f0..669933117ecb 100644 --- a/basic/source/inc/opcodes.hxx +++ b/basic/source/inc/opcodes.hxx @@ -136,7 +136,7 @@ enum SbiOpcode { // management _STMNT, // begin of a statement (+Line+Col) // E/A - _OPEN, // (+SvStreamFlags+Flags) + _OPEN, // (+StreamMode+Flags) // objects _LOCAL, // define locals variables (+StringID+Typ) _PUBLIC, // module global variables (+StringID+Typ) diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index 4627218ce6a6..82da67828eca 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -311,7 +311,7 @@ class OslStream : public SvStream osl::File maFile; public: - OslStream( const OUString& rName, short nStrmMode ); + OslStream( const OUString& rName, StreamMode nStrmMode ); virtual ~OslStream(); virtual sal_Size GetData( void* pData, sal_Size nSize ) SAL_OVERRIDE; virtual sal_Size PutData( const void* pData, sal_Size nSize ) SAL_OVERRIDE; @@ -320,20 +320,20 @@ public: virtual void SetSize( sal_uInt64 nSize) SAL_OVERRIDE; }; -OslStream::OslStream( const OUString& rName, short nStrmMode ) +OslStream::OslStream( const OUString& rName, StreamMode nStrmMode ) : maFile( rName ) { sal_uInt32 nFlags; - if( (nStrmMode & (STREAM_READ | STREAM_WRITE)) == (STREAM_READ | STREAM_WRITE) ) + if( (nStrmMode & (StreamMode::READ | StreamMode::WRITE)) == (StreamMode::READ | StreamMode::WRITE) ) { nFlags = osl_File_OpenFlag_Read | osl_File_OpenFlag_Write; } - else if( nStrmMode & STREAM_WRITE ) + else if( nStrmMode & StreamMode::WRITE ) { nFlags = osl_File_OpenFlag_Write; } - else //if( nStrmMode & STREAM_READ ) + else //if( nStrmMode & StreamMode::READ ) { nFlags = osl_File_OpenFlag_Read; } @@ -562,16 +562,16 @@ void UCBStream::SetSize( sal_uInt64 nSize ) SbError SbiStream::Open -( short nCh, const OString& rName, short nStrmMode, short nFlags, short nL ) +( short nCh, const OString& rName, StreamMode nStrmMode, short nFlags, short nL ) { nMode = nFlags; nLen = nL; nChan = nCh; nLine = 0; nExpandOnWriteTo = 0; - if( ( nStrmMode & ( STREAM_READ|STREAM_WRITE ) ) == STREAM_READ ) + if( ( nStrmMode & ( StreamMode::READ|StreamMode::WRITE ) ) == StreamMode::READ ) { - nStrmMode |= STREAM_NOCREATE; + nStrmMode |= StreamMode::NOCREATE; } OUString aStr(OStringToOUString(rName, osl_getThreadTextEncoding())); OUString aNameStr = getFullPath( aStr ); @@ -583,23 +583,23 @@ SbError SbiStream::Open { // #??? For write access delete file if it already exists (not for appending) - if( (nStrmMode & STREAM_WRITE) != 0 && !IsAppend() && !IsBinary() && + if( (nStrmMode & StreamMode::WRITE) && !IsAppend() && !IsBinary() && xSFI->exists( aNameStr ) && !xSFI->isFolder( aNameStr ) ) { xSFI->kill( aNameStr ); } - if( (nStrmMode & (STREAM_READ | STREAM_WRITE)) == (STREAM_READ | STREAM_WRITE) ) + if( (nStrmMode & (StreamMode::READ | StreamMode::WRITE)) == (StreamMode::READ | StreamMode::WRITE) ) { Reference< XStream > xIS = xSFI->openFileReadWrite( aNameStr ); pStrm = new UCBStream( xIS ); } - else if( nStrmMode & STREAM_WRITE ) + else if( nStrmMode & StreamMode::WRITE ) { Reference< XStream > xIS = xSFI->openFileReadWrite( aNameStr ); pStrm = new UCBStream( xIS ); } - else //if( nStrmMode & STREAM_READ ) + else //if( nStrmMode & StreamMode::READ ) { Reference< XInputStream > xIS = xSFI->openFileRead( aNameStr ); pStrm = new UCBStream( xIS ); @@ -787,7 +787,7 @@ SbError SbiIoSystem::GetError() return n; } -void SbiIoSystem::Open(short nCh, const OString& rName, short nMode, short nFlags, short nLen) +void SbiIoSystem::Open(short nCh, const OString& rName, StreamMode nMode, short nFlags, short nLen) { nError = 0; if( nCh >= CHANNELS || !nCh ) diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 6bf3a936aef0..7ccbab73430d 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -4476,7 +4476,7 @@ RTLFUNC(LoadPicture) } OUString aFileURL = getFullPath( rPar.Get(1)->GetOUString() ); - boost::scoped_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aFileURL, STREAM_READ )); + boost::scoped_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aFileURL, StreamMode::READ )); if( pStream ) { Bitmap aBmp; @@ -4504,7 +4504,7 @@ RTLFUNC(SavePicture) SbxBase* pObj = static_cast<SbxObject*>(rPar.Get(1)->GetObject()); if( pObj->IsA( TYPE( SbStdPicture ) ) ) { - SvFileStream aOStream( rPar.Get(2)->GetOUString(), STREAM_WRITE | STREAM_TRUNC ); + SvFileStream aOStream( rPar.Get(2)->GetOUString(), StreamMode::WRITE | StreamMode::TRUNC ); Graphic aGraphic = static_cast<SbStdPicture*>(pObj)->GetGraphic(); WriteGraphic( aOStream, aGraphic ); } @@ -4716,7 +4716,7 @@ RTLFUNC(DumpAllObjects) p = p->GetParent(); } SvFileStream aStrm( rPar.Get( 1 )->GetOUString(), - STREAM_WRITE | STREAM_TRUNC ); + StreamMode::WRITE | StreamMode::TRUNC ); p->Dump( aStrm, rPar.Get( 2 )->GetBool() ); aStrm.Close(); if( aStrm.GetError() != SVSTREAM_OK ) diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index e05ea92551d6..1595d5cd313e 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -227,7 +227,7 @@ SbiRuntime::pStep2 SbiRuntime::aStep2[] = {// all opcodes with two operands // Verwaltung &SbiRuntime::StepSTMNT, // beginning of a statement (+Line+Col) // E/A - &SbiRuntime::StepOPEN, // (+SvStreamFlags+Flags) + &SbiRuntime::StepOPEN, // (+StreamMode+Flags) // Objects &SbiRuntime::StepLOCAL, // define local variable (+StringId+Typ) &SbiRuntime::StepPUBLIC, // module global variable (+StringID+Typ) @@ -4304,7 +4304,7 @@ void SbiRuntime::StepSTMNT( sal_uInt32 nOp1, sal_uInt32 nOp2 ) } } -// (+SvStreamFlags+Flags) +// (+StreamMode+Flags) // Stack: block length // channel number // file name @@ -4317,7 +4317,7 @@ void SbiRuntime::StepOPEN( sal_uInt32 nOp1, sal_uInt32 nOp2 ) short nBlkLen = pLen->GetInteger(); short nChan = pChan->GetInteger(); OString aName(OUStringToOString(pName->GetOUString(), osl_getThreadTextEncoding())); - pIosys->Open( nChan, aName, static_cast<short>( nOp1 ), + pIosys->Open( nChan, aName, static_cast<StreamMode>( nOp1 ), static_cast<short>( nOp2 ), nBlkLen ); Error( pIosys->GetError() ); } diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx index 15073c3f5137..09256b49a72f 100644 --- a/chart2/source/view/main/OpenGLRender.cxx +++ b/chart2/source/view/main/OpenGLRender.cxx @@ -658,7 +658,7 @@ int OpenGLRender::CreateTextTexture(const BitmapEx& rBitmapEx, const awt::Point& OUString aName = OUString( "file:///home/moggi/Documents/work/text" ) + OUString::number( nIdx++ ) + ".png"; try { vcl::PNGWriter aWriter( rBitmapEx ); - SvFileStream sOutput( aName, STREAM_WRITE ); + SvFileStream sOutput( aName, StreamMode::WRITE ); aWriter.Write( sOutput ); sOutput.Close(); } catch (...) { diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx index c5f876b13267..c904e1743d69 100644 --- a/connectivity/source/drivers/dbase/DIndex.cxx +++ b/connectivity/source/drivers/dbase/DIndex.cxx @@ -150,9 +150,9 @@ bool ODbaseIndex::openIndexFile() OUString sFile = getCompletePath(); if(UCBContentHelper::Exists(sFile)) { - m_pFileStream = OFileTable::createStream_simpleError(sFile, STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE); + m_pFileStream = OFileTable::createStream_simpleError(sFile, STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); if (!m_pFileStream) - m_pFileStream = OFileTable::createStream_simpleError(sFile,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE); + m_pFileStream = OFileTable::createStream_simpleError(sFile, StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYNONE); if(m_pFileStream) { m_pFileStream->SetEndian(SvStreamEndian::LITTLE); @@ -487,7 +487,7 @@ bool ODbaseIndex::CreateImpl() ::dbtools::throwFunctionSequenceException(*this); // create the index file - m_pFileStream = OFileTable::createStream_simpleError(sFile,STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC); + m_pFileStream = OFileTable::createStream_simpleError(sFile,STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC); if (!m_pFileStream) { const OUString sError( m_pTable->getConnection()->getResources().getResourceStringWithSubstitution( diff --git a/connectivity/source/drivers/dbase/DIndexes.cxx b/connectivity/source/drivers/dbase/DIndexes.cxx index d3f2c87dcfeb..38a6d1ebb302 100644 --- a/connectivity/source/drivers/dbase/DIndexes.cxx +++ b/connectivity/source/drivers/dbase/DIndexes.cxx @@ -52,7 +52,7 @@ sdbcx::ObjectType ODbaseIndexes::createObject(const OUString& _rName) } sdbcx::ObjectType xRet; - SvStream* pFileStream = ::connectivity::file::OFileTable::createStream_simpleError(sFile,STREAM_READ | STREAM_NOCREATE| STREAM_SHARE_DENYWRITE); + SvStream* pFileStream = ::connectivity::file::OFileTable::createStream_simpleError(sFile, StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); if(pFileStream) { pFileStream->SetEndian(SvStreamEndian::LITTLE); diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index f8746b920857..d96b2071206a 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -494,13 +494,13 @@ void ODbaseTable::construct() "ODbaseTable::ODbaseTable: invalid extension!"); // getEntry is expected to ensure the correct file name - m_pFileStream = createStream_simpleError( sFileName, STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE); + m_pFileStream = createStream_simpleError( sFileName, STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); m_bWriteable = ( m_pFileStream != NULL ); if ( !m_pFileStream ) { m_bWriteable = false; - m_pFileStream = createStream_simpleError( sFileName, STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE); + m_pFileStream = createStream_simpleError( sFileName, StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYNONE); } if(m_pFileStream) @@ -519,11 +519,11 @@ void ODbaseTable::construct() // If the memo file isn't found, the data will be displayed anyhow. // However, updates can't be done // but the operation is executed - m_pMemoStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE); + m_pMemoStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); if ( !m_pMemoStream ) { m_bWriteableMemo = false; - m_pMemoStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE); + m_pMemoStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE), StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYNONE); } if (m_pMemoStream) ReadMemoHeader(); @@ -1060,7 +1060,7 @@ bool ODbaseTable::CreateImpl() if (aContent.isDocument()) { // Only if the file exists with length > 0 raise an error - SvStream* pFileStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE),STREAM_READ); + SvStream* pFileStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE), StreamMode::READ); if (pFileStream && pFileStream->Seek(STREAM_SEEK_TO_END)) { @@ -1174,7 +1174,7 @@ bool ODbaseTable::CreateFile(const INetURLObject& aFile, bool& bCreateMemo) bCreateMemo = false; Date aDate( Date::SYSTEM ); // current date - m_pFileStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC ); + m_pFileStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC ); if (!m_pFileStream) return false; @@ -1420,7 +1420,7 @@ bool ODbaseTable::CreateFile(const INetURLObject& aFile, bool& bCreateMemo) bool ODbaseTable::CreateMemoFile(const INetURLObject& aFile) { // filehandling macro for table creation - m_pMemoStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | STREAM_SHARE_DENYWRITE); + m_pMemoStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | StreamMode::SHARE_DENYWRITE); if (!m_pMemoStream) return false; diff --git a/connectivity/source/drivers/file/FTable.cxx b/connectivity/source/drivers/file/FTable.cxx index 88296deed672..540a5f05ffa0 100644 --- a/connectivity/source/drivers/file/FTable.cxx +++ b/connectivity/source/drivers/file/FTable.cxx @@ -204,7 +204,7 @@ void OFileTable::dropColumn(sal_Int32 /*_nPos*/) SvStream* OFileTable::createStream_simpleError( const OUString& _rFileName, StreamMode _eOpenMode) { - SvStream* pReturn = ::utl::UcbStreamHelper::CreateStream( _rFileName, _eOpenMode, (_eOpenMode & STREAM_NOCREATE) == STREAM_NOCREATE); + SvStream* pReturn = ::utl::UcbStreamHelper::CreateStream( _rFileName, _eOpenMode, bool(_eOpenMode & StreamMode::NOCREATE)); if (pReturn && (ERRCODE_NONE != pReturn->GetErrorCode())) { delete pReturn; diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 3688e9122890..df816fbc5fb3 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -432,10 +432,10 @@ void OFlatTable::construct() OUString aFileName = aURL.GetMainURL(INetURLObject::NO_DECODE); - m_pFileStream = createStream_simpleError( aFileName,STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE); + m_pFileStream = createStream_simpleError( aFileName, STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); if(!m_pFileStream) - m_pFileStream = createStream_simpleError( aFileName,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE); + m_pFileStream = createStream_simpleError( aFileName, StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYNONE); if(m_pFileStream) { diff --git a/cppcanvas/qa/extras/emfplus/emfplus.cxx b/cppcanvas/qa/extras/emfplus/emfplus.cxx index 96bde5643e58..c704b4aef005 100644 --- a/cppcanvas/qa/extras/emfplus/emfplus.cxx +++ b/cppcanvas/qa/extras/emfplus/emfplus.cxx @@ -64,7 +64,7 @@ public: char* pEnv = getenv("CPPCANVAS_DEBUG_EMFPLUS_DUMP_TO"); if (pEnv) { - SvFileStream aStream(OUString::fromUtf8(pEnv), STREAM_WRITE); + SvFileStream aStream(OUString::fromUtf8(pEnv), StreamMode::WRITE); vcl::PNGWriter aWriter(aResultBitmap); CPPUNIT_ASSERT(aWriter.Write(aStream)); } diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index f58ec95dd49a..11843e2732fd 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -1136,7 +1136,7 @@ namespace cppcanvas GraphicFilter filter; // workaround buggy metafiles, which have wrong mfSize set (n#705956 for example) - SvMemoryStream mfStream (((char *)s.GetData()) + s.Tell(), bUseWholeStream ? s.remainingSize() : dataSize - 16, STREAM_READ); + SvMemoryStream mfStream (((char *)s.GetData()) + s.Tell(), bUseWholeStream ? s.remainingSize() : dataSize - 16, StreamMode::READ); filter.ImportGraphic (graphic, OUString(), mfStream); @@ -1147,7 +1147,7 @@ namespace cppcanvas OUString emfp_debug_filename = "/tmp/emf-embedded-stream" + OUString::number(emfp_debug_stream_number++) + ".emf"; - SvFileStream file( emfp_debug_filename, STREAM_WRITE | STREAM_TRUNC ); + SvFileStream file( emfp_debug_filename, StreamMode::WRITE | StreamMode::TRUNC ); mfStream.WriteStream(file); file.Flush(); @@ -1809,7 +1809,7 @@ namespace cppcanvas OutDevState& rState, const CanvasSharedPtr& rCanvas ) { sal_uInt32 length = pAct->GetDataSize (); - SvMemoryStream rMF ((void*) pAct->GetData (), length, STREAM_READ); + SvMemoryStream rMF ((void*) pAct->GetData (), length, StreamMode::READ); length -= 4; diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 2bd095605487..edc3a6ef887d 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -1661,7 +1661,7 @@ namespace cppcanvas const sal_uInt8* pData = pAct->GetData(); if ( pData ) { - SvMemoryStream aMemStm( (void*)pData, pAct->GetDataSize(), STREAM_READ ); + SvMemoryStream aMemStm( (void*)pData, pAct->GetDataSize(), StreamMode::READ ); SvtGraphicFill aFill; ReadSvtGraphicFill( aMemStm, aFill ); @@ -1788,7 +1788,7 @@ namespace cppcanvas } else if( pAct->GetComment() == "EMF_PLUS_HEADER_INFO" ) { SAL_INFO ("cppcanvas.emf", "EMF+ passed to canvas mtf renderer - header info, size: " << pAct->GetDataSize ()); - SvMemoryStream rMF ((void*) pAct->GetData (), pAct->GetDataSize (), STREAM_READ); + SvMemoryStream rMF ((void*) pAct->GetData (), pAct->GetDataSize (), StreamMode::READ); rMF.ReadInt32( nFrameLeft ).ReadInt32( nFrameTop ).ReadInt32( nFrameRight ).ReadInt32( nFrameBottom ); SAL_INFO ("cppcanvas.emf", "EMF+ picture frame: " << nFrameLeft << "," << nFrameTop << " - " << nFrameRight << "," << nFrameBottom); diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index 89d58e27e1e2..a51f603a885f 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -301,7 +301,7 @@ void SvxHyperlinkNewDocTp::DoApply () // check if file exists, warn before we overwrite it { com::sun::star::uno::Reference < com::sun::star::task::XInteractionHandler > xHandler; - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ, xHandler ); + SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ, xHandler ); bool bOk = pIStm && ( pIStm->GetError() == 0); diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 76f1e2a34343..bf7ccd8261ce 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -371,7 +371,7 @@ void SvxPersonalizationTabPage::LoadDefaultImages() gallery += "/gallery/personas/"; rtl::Bootstrap::expandMacros( gallery ); OUString aPersonasList = gallery + "personas_list.txt"; - SvFileStream aStream( aPersonasList, STREAM_READ ); + SvFileStream aStream( aPersonasList, StreamMode::READ ); GraphicFilter aFilter; Graphic aGraphic; sal_Int32 nIndex = 0; diff --git a/dbaccess/qa/unit/embeddeddb_performancetest.cxx b/dbaccess/qa/unit/embeddeddb_performancetest.cxx index 5c0a6b6a7bc1..1eebc2206f22 100644 --- a/dbaccess/qa/unit/embeddeddb_performancetest.cxx +++ b/dbaccess/qa/unit/embeddeddb_performancetest.cxx @@ -130,7 +130,7 @@ SvFileStream* EmbeddedDBPerformanceTest::getWordListStream() OUString wlPath; createFileURL("wordlist", wlPath); - SvFileStream *pFile(new SvFileStream(wlPath, STREAM_READ)); + SvFileStream *pFile(new SvFileStream(wlPath, StreamMode::READ)); if (!pFile) { diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index a47b6c8fef5d..03e94bab400c 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -444,7 +444,7 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) uno::Reference<XComponent> xCom(GetModel(),UNO_QUERY); SfxMediumRef pMedium = new SfxMedium( - sFileName, ( STREAM_READ | STREAM_NOCREATE ) ); + sFileName, ( StreamMode::READ | StreamMode::NOCREATE ) ); uno::Reference< embed::XStorage > xStorage; try { diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 559f9be2753f..5c26d3a65250 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -1070,7 +1070,7 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent) { SvMemoryStream aData( aBmpSequence.getArray(), aBmpSequence.getLength(), - STREAM_READ ); + StreamMode::READ ); GraphicConverter::Import(aData,aGraphic); } diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx index 94a155dd5ed9..215f54b678fc 100644 --- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx +++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx @@ -305,7 +305,7 @@ namespace drawinglayer if(bDoSaveForVisualControl) { - SvFileStream aNew( "c:\\content.bmp", STREAM_WRITE|STREAM_TRUNC); + SvFileStream aNew( "c:\\content.bmp", StreamMode::WRITE|StreamMode::TRUNC); WriteDIB(aContent, aNew, false, true); } @@ -316,7 +316,7 @@ namespace drawinglayer if(bDoSaveForVisualControl) { - SvFileStream aNew( "c:\\transparence.bmp", STREAM_WRITE|STREAM_TRUNC); + SvFileStream aNew( "c:\\transparence.bmp", StreamMode::WRITE|StreamMode::TRUNC); WriteDIB(aAlphaMask.GetBitmap(), aNew, false, true); } @@ -329,7 +329,7 @@ namespace drawinglayer if(bDoSaveForVisualControl) { - SvFileStream aNew( "c:\\mask.bmp", STREAM_WRITE|STREAM_TRUNC); + SvFileStream aNew( "c:\\mask.bmp", StreamMode::WRITE|StreamMode::TRUNC); WriteDIB(aMask, aNew, false, true); } diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx index 0fbb6f9d8b1d..188bfa9f5327 100644 --- a/drawinglayer/source/tools/converters.cxx +++ b/drawinglayer/source/tools/converters.cxx @@ -102,7 +102,7 @@ namespace drawinglayer #ifdef DBG_UTIL if(bDoSaveForVisualControl) { - SvFileStream aNew(OUString("c:\\test_content.png"), STREAM_WRITE|STREAM_TRUNC); + SvFileStream aNew(OUString("c:\\test_content.png"), StreamMode::WRITE|StreamMode::TRUNC); ::vcl::PNGWriter aPNGWriter(aContent); aPNGWriter.Write(aNew); } @@ -132,7 +132,7 @@ namespace drawinglayer #ifdef DBG_UTIL if(bDoSaveForVisualControl) { - SvFileStream aNew(OUString("c:\\test_alpha.png"), STREAM_WRITE|STREAM_TRUNC); + SvFileStream aNew(OUString("c:\\test_alpha.png"), StreamMode::WRITE|StreamMode::TRUNC); ::vcl::PNGWriter aPNGWriter(aAlpha); aPNGWriter.Write(aNew); } @@ -143,7 +143,7 @@ namespace drawinglayer #ifdef DBG_UTIL if(bDoSaveForVisualControl) { - SvFileStream aNew(OUString("c:\\test_combined.png"), STREAM_WRITE|STREAM_TRUNC); + SvFileStream aNew(OUString("c:\\test_combined.png"), StreamMode::WRITE|StreamMode::TRUNC); ::vcl::PNGWriter aPNGWriter(aRetval); aPNGWriter.Write(aNew); } diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 1e2c2fcabf21..1b8993fae745 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -3480,7 +3480,7 @@ EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransfer uno::Sequence< sal_Int8 > aSeq; aData >>= aSeq; { - SvMemoryStream aBinStream( aSeq.getArray(), aSeq.getLength(), STREAM_READ ); + SvMemoryStream aBinStream( aSeq.getArray(), aSeq.getLength(), StreamMode::READ ); aNewSelection = Read( aBinStream, rBaseURL, EE_FORMAT_BIN, rPaM ); } bDone = true; @@ -3502,7 +3502,7 @@ EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransfer uno::Sequence< sal_Int8 > aSeq; aData >>= aSeq; { - SvMemoryStream aRTFStream( aSeq.getArray(), aSeq.getLength(), STREAM_READ ); + SvMemoryStream aRTFStream( aSeq.getArray(), aSeq.getLength(), StreamMode::READ ); aNewSelection = Read( aRTFStream, rBaseURL, EE_FORMAT_RTF, rPaM ); } bDone = true; diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 0f2467cec268..943e518e04e8 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1997,7 +1997,7 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp( if( rStg.Is() && rStg->IsStream( sStrmName ) ) { SvStorageStreamRef xStrm = rStg->OpenSotStream( sTmp, - ( STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE ) ); + ( StreamMode::READ | StreamMode::SHARE_DENYWRITE | StreamMode::NOCREATE ) ); if( SVSTREAM_OK != xStrm->GetError()) { xStrm.Clear(); @@ -2071,7 +2071,7 @@ void SvxAutoCorrectLanguageLists::SaveExceptList_Imp( else { SotStorageStreamRef xStrm = rStg->OpenSotStream( sStrmName, - ( STREAM_READ | STREAM_WRITE | STREAM_SHARE_DENYWRITE ) ); + ( StreamMode::READ | StreamMode::WRITE | StreamMode::SHARE_DENYWRITE ) ); if( xStrm.Is() ) { xStrm->SetSize( 0 ); @@ -2229,7 +2229,7 @@ SvStringsISortDtor* SvxAutoCorrectLanguageLists::LoadCplSttExceptList() { try { - SotStorageRef xStg = new SotStorage( sShareAutoCorrFile, STREAM_READ | STREAM_SHARE_DENYNONE, sal_True ); + SotStorageRef xStg = new SotStorage( sShareAutoCorrFile, StreamMode::READ | StreamMode::SHARE_DENYNONE, sal_True ); OUString sTemp ( pXMLImplCplStt_ExcptLstStr ); if( xStg.Is() && xStg->IsContained( sTemp ) ) LoadXMLExceptList_Imp( pCplStt_ExcptLst, pXMLImplCplStt_ExcptLstStr, xStg ); @@ -2273,7 +2273,7 @@ SvStringsISortDtor* SvxAutoCorrectLanguageLists::LoadWrdSttExceptList() { try { - SotStorageRef xStg = new SotStorage( sShareAutoCorrFile, STREAM_READ | STREAM_SHARE_DENYNONE, sal_True ); + SotStorageRef xStg = new SotStorage( sShareAutoCorrFile, StreamMode::READ | StreamMode::SHARE_DENYNONE, sal_True ); OUString sTemp ( pXMLImplWrdStt_ExcptLstStr ); if( xStg.Is() && xStg->IsContained( sTemp ) ) LoadXMLExceptList_Imp( pWrdStt_ExcptLst, pXMLImplWrdStt_ExcptLstStr, xStg ); @@ -2388,8 +2388,8 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl() } if (bConvert && !bError) { - SotStorageRef xSrcStg = new SotStorage( aDest.GetMainURL( INetURLObject::DECODE_TO_IURI ), STREAM_READ, sal_True ); - SotStorageRef xDstStg = new SotStorage( sUserAutoCorrFile, STREAM_WRITE, sal_True ); + SotStorageRef xSrcStg = new SotStorage( aDest.GetMainURL( INetURLObject::DECODE_TO_IURI ), StreamMode::READ, sal_True ); + SotStorageRef xDstStg = new SotStorage( sUserAutoCorrFile, StreamMode::WRITE, sal_True ); if( xSrcStg.Is() && xDstStg.Is() ) { @@ -2442,7 +2442,7 @@ bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SvStorage& rStg ) if( !bRemove ) { SvStorageStreamRef refList = rStg.OpenSotStream( sStrmName, - ( STREAM_READ | STREAM_WRITE | STREAM_SHARE_DENYWRITE ) ); + ( StreamMode::READ | StreamMode::WRITE | StreamMode::SHARE_DENYWRITE ) ); if( refList.Is() ) { refList->SetSize( 0 ); diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx index 85f1f76cc2a7..5d720349880f 100644 --- a/editeng/source/xml/xmltxtexp.cxx +++ b/editeng/source/xml/xmltxtexp.cxx @@ -417,7 +417,7 @@ void SvxWriteXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& /* testcode const OUString aURL( "file:///e:/test.xml" ); - SfxMedium aMedium( aURL, STREAM_WRITE | STREAM_TRUNC, sal_True ); + SfxMedium aMedium( aURL, StreamMode::WRITE | STREAM_TRUNC, sal_True ); uno::Reference<io::XOutputStream> xOut( new utl::OOutputStreamWrapper( *aMedium.GetOutStream() ) ); */ diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx index ff6e9674198f..1461c1139b57 100644 --- a/editeng/source/xml/xmltxtimp.cxx +++ b/editeng/source/xml/xmltxtimp.cxx @@ -167,7 +167,7 @@ void SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& r /* testcode const OUString aURL( "file:///e:/test.xml" ); - SfxMedium aMedium( aURL, STREAM_READ | STREAM_NOCREATE, sal_True ); + SfxMedium aMedium( aURL, StreamMode::READ | STREAM_NOCREATE, sal_True ); uno::Reference<io::XOutputStream> xOut( new utl::OOutputStreamWrapper( *aMedium.GetOutStream() ) ); aMedium.GetInStream()->Seek( 0 ); diff --git a/embeddedobj/source/msole/graphconvert.cxx b/embeddedobj/source/msole/graphconvert.cxx index 37aeb6914798..d6c93eb45e28 100644 --- a/embeddedobj/source/msole/graphconvert.cxx +++ b/embeddedobj/source/msole/graphconvert.cxx @@ -50,7 +50,7 @@ sal_Bool ConvertBufferToFormat( void* pBuf, if ( pBuf ) { // First, in case the buffer is already in the requested format, then avoid a conversion. - SvMemoryStream aMemoryStream(pBuf, nBufSize, STREAM_READ); + SvMemoryStream aMemoryStream(pBuf, nBufSize, StreamMode::READ); GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); sal_uInt16 nRetFormat = 0; if (rFilter.CanImportGraphic(OUString(), aMemoryStream, GRFILTER_FORMAT_DONTKNOW, &nRetFormat) == GRFILTER_OK && diff --git a/embeddedobj/test/mtexecutor/bitmapcreator.cxx b/embeddedobj/test/mtexecutor/bitmapcreator.cxx index 1c75fd9655f7..fc54728de7b1 100644 --- a/embeddedobj/test/mtexecutor/bitmapcreator.cxx +++ b/embeddedobj/test/mtexecutor/bitmapcreator.cxx @@ -74,7 +74,7 @@ uno::Reference< uno::XInterface > SAL_CALL VCLBitmapCreator::createInstanceWithA throw uno::Exception(); // TODO BitmapEx aBitmap; - SvMemoryStream aStream( aOrigBitmap.getArray(), aOrigBitmap.getLength(), STREAM_READ ); + SvMemoryStream aStream( aOrigBitmap.getArray(), aOrigBitmap.getLength(), StreamMode::READ ); aStream >> aBitmap; if ( aStream.GetError() ) throw uno::Exception(); // TODO diff --git a/extensions/source/plugin/base/context.cxx b/extensions/source/plugin/base/context.cxx index eaf5eab46e61..d62d1fa91d49 100644 --- a/extensions/source/plugin/base/context.cxx +++ b/extensions/source/plugin/base/context.cxx @@ -203,7 +203,7 @@ void XPluginContext_Impl::postURL(const Reference< ::com::sun::star::plugin::XPl OUString aFileName( (char*)buf.getConstArray(), strlen((char*)buf.getConstArray()), m_aEncoding ); INetURLObject aFilePath( aFileName ); aFileName = aFilePath.PathToFileName(); - SvFileStream aStream( aFileName, STREAM_READ ); + SvFileStream aStream( aFileName, StreamMode::READ ); if( aStream.IsOpen() ) { sal_Int64 const nBytes = aStream.remainingSize(); diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index 1675d7ed3ff5..74106a2da564 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -980,12 +980,12 @@ PluginInputStream::PluginInputStream( XPlugin_Impl* pPlugin, { aTmpFile += aExtension; } - m_aFileStream.Open( aTmpFile, STREAM_READ | STREAM_WRITE ); + m_aFileStream.Open( aTmpFile, StreamMode::READ | StreamMode::WRITE ); if( ! m_aFileStream.IsOpen() ) { // might be that the extension scrambled the whole filename osl::FileBase::createTempFile( 0, 0, &aTmpFile ); - m_aFileStream.Open( aTmpFile, STREAM_READ | STREAM_WRITE ); + m_aFileStream.Open( aTmpFile, StreamMode::READ | StreamMode::WRITE ); } } diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx index ca03b5574a20..7eb6713bec6b 100644 --- a/extensions/source/scanner/scanwin.cxx +++ b/extensions/source/scanner/scanwin.cxx @@ -844,7 +844,7 @@ uno::Sequence< sal_Int8 > ScannerManager::getDIB() throw() aRet = uno::Sequence< sal_Int8 >( sizeof( BITMAPFILEHEADER ) + nDIBSize ); sal_Int8* pBuf = aRet.getArray(); - SvMemoryStream* pMemStm = new SvMemoryStream( (char*) pBuf, sizeof( BITMAPFILEHEADER ), STREAM_WRITE ); + SvMemoryStream* pMemStm = new SvMemoryStream( (char*) pBuf, sizeof( BITMAPFILEHEADER ), StreamMode::WRITE ); pMemStm->WriteChar( 'B' ).WriteChar( 'M' ).WriteUInt32( 0 ).WriteUInt32( 0 ); pMemStm->WriteUInt32( sizeof( BITMAPFILEHEADER ) + pBIH->biSize + ( nColEntries * sizeof( RGBQUAD ) ) ); diff --git a/filter/qa/cppunit/filters-dxf-test.cxx b/filter/qa/cppunit/filters-dxf-test.cxx index 336b6cd35899..1d78a6188954 100644 --- a/filter/qa/cppunit/filters-dxf-test.cxx +++ b/filter/qa/cppunit/filters-dxf-test.cxx @@ -52,7 +52,7 @@ bool DxfFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return GraphicImport(aFileStream, aGraphic, NULL); } diff --git a/filter/qa/cppunit/filters-eps-test.cxx b/filter/qa/cppunit/filters-eps-test.cxx index f291d113c315..2167281352b6 100644 --- a/filter/qa/cppunit/filters-eps-test.cxx +++ b/filter/qa/cppunit/filters-eps-test.cxx @@ -52,7 +52,7 @@ bool EpsFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return GraphicImport(aFileStream, aGraphic, NULL); } diff --git a/filter/qa/cppunit/filters-met-test.cxx b/filter/qa/cppunit/filters-met-test.cxx index b8fc340dffab..4e551d24e06a 100644 --- a/filter/qa/cppunit/filters-met-test.cxx +++ b/filter/qa/cppunit/filters-met-test.cxx @@ -52,7 +52,7 @@ bool MetFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return GraphicImport(aFileStream, aGraphic, NULL); } diff --git a/filter/qa/cppunit/filters-pcd-test.cxx b/filter/qa/cppunit/filters-pcd-test.cxx index 681dc7de641c..1658f4cf0c05 100644 --- a/filter/qa/cppunit/filters-pcd-test.cxx +++ b/filter/qa/cppunit/filters-pcd-test.cxx @@ -52,7 +52,7 @@ bool PcdFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return GraphicImport(aFileStream, aGraphic, NULL); } diff --git a/filter/qa/cppunit/filters-pcx-test.cxx b/filter/qa/cppunit/filters-pcx-test.cxx index 013d96de8208..92139b1ad664 100644 --- a/filter/qa/cppunit/filters-pcx-test.cxx +++ b/filter/qa/cppunit/filters-pcx-test.cxx @@ -52,7 +52,7 @@ bool PcxFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return GraphicImport(aFileStream, aGraphic, NULL); } diff --git a/filter/qa/cppunit/filters-pict-test.cxx b/filter/qa/cppunit/filters-pict-test.cxx index 0512b9b22287..35fed6162eec 100644 --- a/filter/qa/cppunit/filters-pict-test.cxx +++ b/filter/qa/cppunit/filters-pict-test.cxx @@ -66,7 +66,7 @@ bool PictFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return GraphicImport(aFileStream, aGraphic, NULL); } @@ -80,7 +80,7 @@ void PictFilterTest::testCVEs() void PictFilterTest::testDontClipTooMuch() { - SvFileStream aFileStream(pictURL() + "clipping-problem.pct", STREAM_READ); + SvFileStream aFileStream(pictURL() + "clipping-problem.pct", StreamMode::READ); GDIMetaFile aGDIMetaFile; pict::ReadPictFile(aFileStream, aGDIMetaFile); diff --git a/filter/qa/cppunit/filters-ppm-test.cxx b/filter/qa/cppunit/filters-ppm-test.cxx index 9b281abff231..9cdafcd9dbf1 100644 --- a/filter/qa/cppunit/filters-ppm-test.cxx +++ b/filter/qa/cppunit/filters-ppm-test.cxx @@ -52,7 +52,7 @@ bool PpmFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return GraphicImport(aFileStream, aGraphic, NULL); } diff --git a/filter/qa/cppunit/filters-psd-test.cxx b/filter/qa/cppunit/filters-psd-test.cxx index 95ab882d82e5..0da3a9fa4dc5 100644 --- a/filter/qa/cppunit/filters-psd-test.cxx +++ b/filter/qa/cppunit/filters-psd-test.cxx @@ -52,7 +52,7 @@ bool PsdFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return GraphicImport(aFileStream, aGraphic, NULL); } diff --git a/filter/qa/cppunit/filters-ras-test.cxx b/filter/qa/cppunit/filters-ras-test.cxx index a4862e6127dd..cbc7bdf1b288 100644 --- a/filter/qa/cppunit/filters-ras-test.cxx +++ b/filter/qa/cppunit/filters-ras-test.cxx @@ -52,7 +52,7 @@ bool RasFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return GraphicImport(aFileStream, aGraphic, NULL); } diff --git a/filter/qa/cppunit/filters-tga-test.cxx b/filter/qa/cppunit/filters-tga-test.cxx index 615afbbbba9d..207e9ce2fef8 100644 --- a/filter/qa/cppunit/filters-tga-test.cxx +++ b/filter/qa/cppunit/filters-tga-test.cxx @@ -52,7 +52,7 @@ bool TgaFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return GraphicImport(aFileStream, aGraphic, NULL); } diff --git a/filter/qa/cppunit/filters-tiff-test.cxx b/filter/qa/cppunit/filters-tiff-test.cxx index a37ed17225f0..2de6c8f7874d 100644 --- a/filter/qa/cppunit/filters-tiff-test.cxx +++ b/filter/qa/cppunit/filters-tiff-test.cxx @@ -52,7 +52,7 @@ bool TiffFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return GraphicImport(aFileStream, aGraphic, NULL); } diff --git a/filter/source/flash/swfexporter.cxx b/filter/source/flash/swfexporter.cxx index b2bc39b6ae1c..2d0feeb583d8 100644 --- a/filter/source/flash/swfexporter.cxx +++ b/filter/source/flash/swfexporter.cxx @@ -705,7 +705,7 @@ bool FlashExporter::getMetaFile( Reference< XComponent >&xComponent, GDIMetaFile Graphic aGraphic; GraphicFilter aFilter(false); - aFilter.ImportGraphic( aGraphic, aFile.GetURL(), *aFile.GetStream( STREAM_READ ) ); + aFilter.ImportGraphic( aGraphic, aFile.GetURL(), *aFile.GetStream( StreamMode::READ ) ); BitmapEx rBitmapEx( aGraphic.GetBitmap(), Color(255,255,255) ); Rectangle clipRect; @@ -733,7 +733,7 @@ bool FlashExporter::getMetaFile( Reference< XComponent >&xComponent, GDIMetaFile } else { - rMtf.Read( *aFile.GetStream( STREAM_READ ) ); + rMtf.Read( *aFile.GetStream( StreamMode::READ ) ); if(usesClipActions(rMtf)) { diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx index ded932b424ac..4e2021264605 100644 --- a/filter/source/flash/swfwriter.cxx +++ b/filter/source/flash/swfwriter.cxx @@ -55,8 +55,8 @@ Writer::Writer( sal_Int32 nTWIPWidthOutput, sal_Int32 nTWIPHeightOutput, sal_Int maMovieTempFile.EnableKillingFile(); maFontsTempFile.EnableKillingFile(); - mpMovieStream = maMovieTempFile.GetStream( STREAM_WRITE|STREAM_TRUNC ); - mpFontsStream = maFontsTempFile.GetStream( STREAM_WRITE|STREAM_TRUNC ); + mpMovieStream = maMovieTempFile.GetStream( StreamMode::WRITE|StreamMode::TRUNC ); + mpFontsStream = maFontsTempFile.GetStream( StreamMode::WRITE|StreamMode::TRUNC ); mnFrames = 0; diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index e2c34c10f8ef..ba7c610a2c9e 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -1649,7 +1649,7 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf ) // the meta actions between the "XPATHFILL_SEQ_BEGIN" and "XPATHFILL_SEQ_END" comment. SvtGraphicFill aFilling; - SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ ); + SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), StreamMode::READ ); // read the fill info ReadSvtGraphicFill( aMemStm, aFilling ); @@ -1679,7 +1679,7 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf ) // the meta actions between the "XPATHFILL_SEQ_BEGIN" and "XPATHFILL_SEQ_END" comment. SvtGraphicStroke aStroke; - SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ ); + SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), StreamMode::READ ); // read the fill info ReadSvtGraphicStroke( aMemStm, aStroke ); diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index ff423e97a97e..da5edcce41ec 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -1291,7 +1291,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) const sal_uInt8* pData = pA->GetData(); if ( pData ) { - SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ ); + SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), StreamMode::READ ); bool bSkipSequence = false; OString sSeqEnd; diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index d00c40a6a5ce..45ae54e859cc 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -724,7 +724,7 @@ ImportCGM( OUString const & rFileName, uno::Reference< frame::XModel > const & r { if ( nMode & CGM_IMPORT_CGM ) { - boost::scoped_ptr<SvStream> pIn(::utl::UcbStreamHelper::CreateStream( rFileName, STREAM_READ )); + boost::scoped_ptr<SvStream> pIn(::utl::UcbStreamHelper::CreateStream( rFileName, StreamMode::READ )); if ( pIn ) { pIn->SetEndian( SvStreamEndian::BIG ); diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index db0b1654d033..abd8e1cdf60d 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -205,7 +205,7 @@ static bool RenderAsEMF(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r OUString input; osl::FileBase::getSystemPathFromFileURL(aTempInput.GetURL(), input); - SvStream* pInputStream = aTempInput.GetStream(STREAM_WRITE); + SvStream* pInputStream = aTempInput.GetStream(StreamMode::WRITE); sal_uInt64 nCount = pInputStream->Write(pBuf, nBytesRead); aTempInput.CloseStream(); @@ -258,7 +258,7 @@ static bool RenderAsEMF(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r if (pErr) osl_closeFile(pErr); if (nCount == nBytesRead && bEMFSupported) { - SvFileStream aFile(output, STREAM_READ); + SvFileStream aFile(output, StreamMode::READ); if (GraphicConverter::Import(aFile, rGraphic, CVT_EMF) == ERRCODE_NONE) bRet = true; } diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 23fcc48aa218..10b92eccf12e 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1462,7 +1462,7 @@ bool EscherPropertyContainer::CreateGraphicProperties( if ( pAry && nAryLen ) { Graphic aGraphic; - SvMemoryStream aTemp( (void*)pAry, nAryLen, STREAM_READ ); + SvMemoryStream aTemp( (void*)pAry, nAryLen, StreamMode::READ ); sal_uInt32 nErrCode = GraphicConverter::Import( aTemp, aGraphic, CVT_WMF ); if ( nErrCode == ERRCODE_NONE ) { @@ -1599,7 +1599,7 @@ bool EscherPropertyContainer::CreateGraphicProperties( nFormat != GFF_EMF) ) { boost::scoped_ptr<SvStream> pIn(::utl::UcbStreamHelper::CreateStream( - aTmp.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ )); + aTmp.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); if ( pIn ) { Graphic aGraphic; diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index f575f5aa21d6..ba30b8a89878 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -257,7 +257,7 @@ void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( OUString("d:\\ashape.dbg"), aURLStr ) ) { - boost::scoped_ptr<SvStream> pOut(::utl::UcbStreamHelper::CreateStream( aURLStr, STREAM_WRITE )); + boost::scoped_ptr<SvStream> pOut(::utl::UcbStreamHelper::CreateStream( aURLStr, StreamMode::WRITE )); if( pOut ) { @@ -6360,7 +6360,7 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect SAL_INFO("filter.ms", "dumping " << aURLStr); - boost::scoped_ptr<SvStream> pDbgOut(::utl::UcbStreamHelper::CreateStream(aURLStr, STREAM_TRUNC | STREAM_WRITE)); + boost::scoped_ptr<SvStream> pDbgOut(::utl::UcbStreamHelper::CreateStream(aURLStr, StreamMode::TRUNC | STREAM_WRITE)); if( pDbgOut ) { @@ -6653,7 +6653,7 @@ bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen, { bool bMtfRead = false; SotStorageStreamRef xOle10Stm = rDest->OpenSotStream( OUString("\1Ole10Native"), - STREAM_WRITE| STREAM_SHARE_DENYALL ); + StreamMode::WRITE| StreamMode::SHARE_DENYALL ); if( xOle10Stm->GetError() ) return false; @@ -7033,7 +7033,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( { SvStorageRef xObjStg = rSrcStorage->OpenSotStorage( rStorageName, - STREAM_READWRITE| STREAM_SHARE_DENYALL ); + STREAM_READWRITE| StreamMode::SHARE_DENYALL ); if( xObjStg.Is() ) { { @@ -7060,7 +7060,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( // TODO/LATER: should the caller be notified if the aspect changes in future? SvStorageStreamRef xObjInfoSrc = xObjStg->OpenSotStream( - OUString( "\3ObjInfo" ), STREAM_STD_READ | STREAM_NOCREATE ); + OUString( "\3ObjInfo" ), STREAM_STD_READ | StreamMode::NOCREATE ); if ( xObjInfoSrc.Is() && !xObjInfoSrc->GetError() ) { sal_uInt8 nByte = 0; @@ -7095,7 +7095,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( if ( xObjStor.Is() ) { - SotStorageRef xSrcStor = rSrcStorage->OpenSotStorage( rStorageName, STREAM_READ ); + SotStorageRef xSrcStor = rSrcStorage->OpenSotStorage( rStorageName, StreamMode::READ ); xSrcStor->CopyTo( xObjStor ); if( !xObjStor->GetError() ) diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 744a7c3be473..1b09ed4d3765 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1757,7 +1757,7 @@ bool SdrPowerPointOLEDecompress( SvStream& rOutput, SvStream& rInput, sal_uInt32 rInput.Read( pBuf.get(), nInputSize ); ZCodec aZCodec( 0x8000, 0x8000 ); aZCodec.BeginCompression(); - SvMemoryStream aSource( pBuf.get(), nInputSize, STREAM_READ ); + SvMemoryStream aSource( pBuf.get(), nInputSize, StreamMode::READ ); aZCodec.Decompress( aSource, rOutput ); const bool bSuccess(0L != aZCodec.EndCompression()); rInput.Seek( nOldPos ); @@ -1819,13 +1819,13 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId, if ( aTmpFile.IsValid() ) { - boost::scoped_ptr<SvStream> pDest(::utl::UcbStreamHelper::CreateStream( aTmpFile.GetURL(), STREAM_TRUNC | STREAM_WRITE )); + boost::scoped_ptr<SvStream> pDest(::utl::UcbStreamHelper::CreateStream( aTmpFile.GetURL(), StreamMode::TRUNC | StreamMode::WRITE )); if ( pDest ) bSuccess = SdrPowerPointOLEDecompress( *pDest, rStCtrl, nLen ); } if ( bSuccess ) { - boost::scoped_ptr<SvStream> pDest(::utl::UcbStreamHelper::CreateStream( aTmpFile.GetURL(), STREAM_READ )); + boost::scoped_ptr<SvStream> pDest(::utl::UcbStreamHelper::CreateStream( aTmpFile.GetURL(), StreamMode::READ )); Storage* pObjStor = pDest ? new Storage( *pDest, true ) : NULL; if ( pObjStor ) { @@ -1843,7 +1843,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId, bool bGetItAsOle = ( sizeof( aTestA ) == xSrcTst->Read( aTestA, sizeof( aTestA ) ) ); if ( !bGetItAsOle ) { // maybe there is a contentsstream in here - xSrcTst = xObjStor->OpenSotStream( "Contents", STREAM_READWRITE | STREAM_NOCREATE ); + xSrcTst = xObjStor->OpenSotStream( "Contents", STREAM_READWRITE | StreamMode::NOCREATE ); bGetItAsOle = ( xSrcTst.Is() && sizeof( aTestA ) == xSrcTst->Read( aTestA, sizeof( aTestA ) ) ); } if ( bGetItAsOle ) @@ -1999,7 +1999,7 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt { // is this a visual basic storage ? SotStorageRef xSubStorage = xSource->OpenSotStorage( "VBA", - STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL ); + STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL ); if( xSubStorage.Is() && ( SVSTREAM_OK == xSubStorage->GetError() ) ) { SotStorageRef xMacros = xDest->OpenSotStorage( "MACROS" ); diff --git a/filter/source/msfilter/svxmsbas2.cxx b/filter/source/msfilter/svxmsbas2.cxx index ae531a89a557..62be056be3cf 100644 --- a/filter/source/msfilter/svxmsbas2.cxx +++ b/filter/source/msfilter/svxmsbas2.cxx @@ -33,7 +33,7 @@ sal_uLong SvxImportMSVBasic::SaveOrDelMSVBAStorage( bool bSaveInto, uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() ); OUString aDstStgName( GetMSBasicStorageName() ); SotStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, - STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL ) ); + STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL ) ); if( xVBAStg.Is() && !xVBAStg->GetError() ) { xVBAStg = 0; @@ -45,7 +45,7 @@ sal_uLong SvxImportMSVBasic::SaveOrDelMSVBAStorage( bool bSaveInto, nRet = ERRCODE_SVX_MODIFIED_VBASIC_STORAGE; #endif SotStorageRef xSrc = SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, STREAM_STD_READ ); - SotStorageRef xDst = xRoot->OpenSotStorage( rStorageName, STREAM_READWRITE | STREAM_TRUNC ); + SotStorageRef xDst = xRoot->OpenSotStorage( rStorageName, STREAM_READWRITE | StreamMode::TRUNC ); xSrc->CopyTo( xDst ); xDst->Commit(); ErrCode nError = xDst->GetError(); @@ -65,7 +65,7 @@ sal_uLong SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS { uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() ); SvStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, GetMSBasicStorageName(), - STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL )); + StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL )); return ( xVBAStg.Is() && !xVBAStg->GetError() ) ? ERRCODE_SVX_VBASIC_STORAGE_EXIST : ERRCODE_NONE; diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx index cdaa4d521697..3e1349bf54f2 100644 --- a/filter/source/pdf/pdffilter.cxx +++ b/filter/source/pdf/pdffilter.cxx @@ -113,7 +113,7 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) if( bRet ) { - boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aTempFile.GetURL(), STREAM_READ )); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aTempFile.GetURL(), StreamMode::READ )); if( pIStm ) { diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 9018cfcb052c..db8a76c6a853 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -544,7 +544,7 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) OUString aFileName; pValue[ i ].Value >>= aFileName; - pOStm.reset(::utl::UcbStreamHelper::CreateStream( aFileName, STREAM_WRITE | STREAM_TRUNC )); + pOStm.reset(::utl::UcbStreamHelper::CreateStream( aFileName, StreamMode::WRITE | StreamMode::TRUNC )); if( pOStm ) xOStm = Reference< XOutputStream >( new ::utl::OOutputStreamWrapper ( *pOStm ) ); @@ -2070,7 +2070,7 @@ bool SVGFilter::implCreateObjectsFromBackground( const Reference< XDrawPage >& r xExporter->setSourceDocument( Reference< XComponent >( rxDrawPage, UNO_QUERY ) ); xExporter->filter( aDescriptor ); - aMtf.Read( *aFile.GetStream( STREAM_READ ) ); + aMtf.Read( *aFile.GetStream( StreamMode::READ ) ); (*mpObjects)[ rxDrawPage ] = ObjectRepresentation( rxDrawPage, aMtf ); diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 1ca787a20173..0eceaebc3ca1 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2998,7 +2998,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, mapCurShape.reset(); } - SvMemoryStream aMemStm( (void*) pA->GetData(), pA->GetDataSize(), STREAM_READ ); + SvMemoryStream aMemStm( (void*) pA->GetData(), pA->GetDataSize(), StreamMode::READ ); SvtGraphicFill aFill; ReadSvtGraphicFill( aMemStm, aFill ); @@ -3074,7 +3074,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, ( nWriteFlags & SVGWRITER_WRITE_FILL ) && !( nWriteFlags & SVGWRITER_NO_SHAPE_COMMENTS ) && pA->GetDataSize() ) { - SvMemoryStream aMemStm( (void*) pA->GetData(), pA->GetDataSize(), STREAM_READ ); + SvMemoryStream aMemStm( (void*) pA->GetData(), pA->GetDataSize(), StreamMode::READ ); SvtGraphicStroke aStroke; tools::PolyPolygon aStartArrow, aEndArrow; @@ -3636,7 +3636,7 @@ SVGWriter::~SVGWriter() void SAL_CALL SVGWriter::write( const Reference<XDocumentHandler>& rxDocHandler, const Sequence<sal_Int8>& rMtfSeq ) throw( RuntimeException, std::exception ) { - SvMemoryStream aMemStm( (char*) rMtfSeq.getConstArray(), rMtfSeq.getLength(), STREAM_READ ); + SvMemoryStream aMemStm( (char*) rMtfSeq.getConstArray(), rMtfSeq.getLength(), StreamMode::READ ); GDIMetaFile aMtf; ReadGDIMetaFile( aMemStm, aMtf ); diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx index b56392e8b64d..3aa472c6e875 100644 --- a/filter/source/xsltdialog/xmlfilterjar.cxx +++ b/filter/source/xsltdialog/xmlfilterjar.cxx @@ -131,7 +131,7 @@ void XMLFilterJarHelper::addFile( Reference< XInterface > xRootFolder, Reference INetURLObject aURL( aFileURL ); OUString aName( aURL.getName() ); - SvFileStream* pStream = new SvFileStream(aFileURL, STREAM_READ ); + SvFileStream* pStream = new SvFileStream(aFileURL, StreamMode::READ ); Reference< XInputStream > xInput( new utl::OSeekableInputStreamWrapper( pStream, true ) ); _addFile( xRootFolder, xFactory, xInput, aName ); } @@ -213,7 +213,7 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const XMLFilt aExporter.doExport(xOS,rFilters); } - Reference< XInputStream > XIS( new utl::OSeekableInputStreamWrapper( new SvFileStream(aTempFileURL, STREAM_READ ), true ) ); + Reference< XInputStream > XIS( new utl::OSeekableInputStreamWrapper( new SvFileStream(aTempFileURL, StreamMode::READ ), true ) ); OUString szTypeDetection( "TypeDetection.xcu" ); _addFile( xRootFolder, xFactory, XIS, szTypeDetection ); diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index c021300183bb..d02fbed34968 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -485,9 +485,9 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi { aDestURL += aSourceURL.GetName(); - SvFileStream aInputStream(pFilterEntry->maImportTemplate, STREAM_READ ); + SvFileStream aInputStream(pFilterEntry->maImportTemplate, StreamMode::READ ); Reference< XInputStream > xIS( new utl::OInputStreamWrapper( aInputStream ) ); - SvFileStream aOutputStream(aDestURL, STREAM_WRITE ); + SvFileStream aOutputStream(aDestURL, StreamMode::WRITE ); Reference< XOutputStream > xOS( new utl::OOutputStreamWrapper( aOutputStream ) ); if( copyStreams( xIS, xOS ) ) diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index fe0c0d6176f4..8c0894610874 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -1047,7 +1047,7 @@ bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const OUString& rN if( INET_PROT_FILE == aURL.GetProtocol() ) { aFileName = INetURLObject::decode(aURL.PathToFileName(), '%', INetURLObject::DECODE_UNAMBIGUOUS); - pStream = ::utl::UcbStreamHelper::CreateStream(aFileName, STREAM_READ); + pStream = ::utl::UcbStreamHelper::CreateStream(aFileName, StreamMode::READ); if (!pStream || (pStream->GetError() != ERRCODE_NONE)) { delete pStream; diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index a770c5aaff4d..01bc858da06f 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -419,7 +419,7 @@ bool OImageControlModel::impl_updateStreamForURL_lck( const OUString& _rURL, Val } else { - pImageStream.reset( ::utl::UcbStreamHelper::CreateStream( _rURL, STREAM_READ ) ); + pImageStream.reset( ::utl::UcbStreamHelper::CreateStream( _rURL, StreamMode::READ ) ); bool bSetNull = ( pImageStream.get() == NULL ) || ( ERRCODE_NONE != pImageStream->GetErrorCode() ); if ( !bSetNull ) diff --git a/forms/source/richtext/richtextvclcontrol.cxx b/forms/source/richtext/richtextvclcontrol.cxx index fe7ffe6f70c7..722bdefa52d7 100644 --- a/forms/source/richtext/richtextvclcontrol.cxx +++ b/forms/source/richtext/richtextvclcontrol.cxx @@ -242,7 +242,7 @@ namespace frm { OUString sFileName = aFP.GetPath(); SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( - sFileName, ( bLoad ? STREAM_READ : STREAM_WRITE | STREAM_TRUNC ) | STREAM_SHARE_DENYALL + sFileName, ( bLoad ? StreamMode::READ : StreamMode::WRITE | StreamMode::TRUNC ) | StreamMode::SHARE_DENYALL ); if ( pStream ) { diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 5e08e1eedde0..c82b320d3625 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -2659,7 +2659,7 @@ void SvtFileDialog::setImage( sal_Int16 /*aImageFormat*/, const Any& rImage ) Bitmap aBmp; SvMemoryStream aData( aBmpSequence.getArray(), aBmpSequence.getLength(), - STREAM_READ ); + StreamMode::READ ); ReadDIB(aBmp, aData, true); _pPrevBmp->SetBitmap( aBmp ); diff --git a/framework/source/fwe/helper/actiontriggerhelper.cxx b/framework/source/fwe/helper/actiontriggerhelper.cxx index 4e2796a7472f..2c861ed1b2f5 100644 --- a/framework/source/fwe/helper/actiontriggerhelper.cxx +++ b/framework/source/fwe/helper/actiontriggerhelper.cxx @@ -179,7 +179,7 @@ void InsertSubMenuItems( Menu* pSubMenu, sal_uInt16& nItemId, Reference< XIndexC Sequence< sal_Int8 > aDIBSeq; { aDIBSeq = xBitmap->getDIB(); - SvMemoryStream aMem( (void *)aDIBSeq.getConstArray(), aDIBSeq.getLength(), STREAM_READ ); + SvMemoryStream aMem( (void *)aDIBSeq.getConstArray(), aDIBSeq.getLength(), StreamMode::READ ); ReadDIB(aBitmap, aMem, true); } @@ -187,7 +187,7 @@ void InsertSubMenuItems( Menu* pSubMenu, sal_uInt16& nItemId, Reference< XIndexC if ( aDIBSeq.getLength() > 0 ) { Bitmap aMaskBitmap; - SvMemoryStream aMem( (void *)aDIBSeq.getConstArray(), aDIBSeq.getLength(), STREAM_READ ); + SvMemoryStream aMem( (void *)aDIBSeq.getConstArray(), aDIBSeq.getLength(), StreamMode::READ ); ReadDIB(aMaskBitmap, aMem, true); aImage = Image( aBitmap, aMaskBitmap ); } diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx index 4bf23589e4f0..0802436b52e0 100644 --- a/idl/source/cmptools/lex.cxx +++ b/idl/source/cmptools/lex.cxx @@ -96,7 +96,7 @@ void SvTokenStream::InitCtor() } SvTokenStream::SvTokenStream( const OUString & rFileName ) - : pInStream( new SvFileStream( rFileName, STREAM_STD_READ | STREAM_NOCREATE ) ) + : pInStream( new SvFileStream( rFileName, STREAM_STD_READ | StreamMode::NOCREATE ) ) , rInStream( *pInStream ) , aFileName( rFileName ) { diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx index 6e1972799f68..005c0f05946e 100644 --- a/idl/source/prj/command.cxx +++ b/idl/source/prj/command.cxx @@ -133,7 +133,7 @@ bool ReadIdl( SvIdlWorkingBase * pDataBase, const SvCommand & rCommand ) { OUString aFileName ( rCommand.aInFileList[ n ] ); pDataBase->AddDepFile(aFileName); - SvFileStream aStm( aFileName, STREAM_STD_READ | STREAM_NOCREATE ); + SvFileStream aStm( aFileName, STREAM_STD_READ | StreamMode::NOCREATE ); if( aStm.GetError() == SVSTREAM_OK ) { SvTokenStream aTokStm( aStm, aFileName ); @@ -159,7 +159,7 @@ static bool ResponseFile( StringList * pList, int argc, char ** argv ) { if( '@' == **(argv +i) ) { // when @, then response file - SvFileStream aStm( OUString::createFromAscii((*(argv +i)) +1), STREAM_STD_READ | STREAM_NOCREATE ); + SvFileStream aStm( OUString::createFromAscii((*(argv +i)) +1), STREAM_STD_READ | StreamMode::NOCREATE ); if( aStm.GetError() != SVSTREAM_OK ) return false; diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx index c6c37c55a49b..98d02993bb73 100644 --- a/idl/source/prj/database.cxx +++ b/idl/source/prj/database.cxx @@ -562,7 +562,7 @@ bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, bool bImported, const { osl::FileBase::getSystemPathFromFileURL( aFullName, aFullName ); this->AddDepFile(aFullName); - SvFileStream aStm( aFullName, STREAM_STD_READ | STREAM_NOCREATE ); + SvFileStream aStm( aFullName, STREAM_STD_READ | StreamMode::NOCREATE ); SvTokenStream aTokStm( aStm, aFullName ); bOk = ReadSvIdl( aTokStm, true, rPath ); } diff --git a/idl/source/prj/svidl.cxx b/idl/source/prj/svidl.cxx index 852b6bacf524..ee1bb85bb162 100644 --- a/idl/source/prj/svidl.cxx +++ b/idl/source/prj/svidl.cxx @@ -131,7 +131,7 @@ int main ( int argc, char ** argv) if( nExit == 0 && !aCommand.aSlotMapFile.isEmpty() ) { aTmpSlotMapFile = tempFileHelper(aCommand.aSlotMapFile); - SvFileStream aOutStm( aTmpSlotMapFile, STREAM_READWRITE | STREAM_TRUNC ); + SvFileStream aOutStm( aTmpSlotMapFile, STREAM_READWRITE | StreamMode::TRUNC ); if( !pDataBase->WriteSfx( aOutStm ) ) { nExit = -1; @@ -143,7 +143,7 @@ int main ( int argc, char ** argv) if (nExit == 0 && !aCommand.m_DepFile.isEmpty()) { aTmpDepFile = tempFileHelper(aCommand.m_DepFile); - SvFileStream aOutStm( aTmpDepFile, STREAM_READWRITE | STREAM_TRUNC ); + SvFileStream aOutStm( aTmpDepFile, STREAM_READWRITE | StreamMode::TRUNC ); pDataBase->WriteDepFile(aOutStm, aCommand.aTargetFile); if( aOutStm.GetError() != SVSTREAM_OK ) { @@ -196,7 +196,7 @@ int main ( int argc, char ** argv) { // stamp file, because idl passed through correctly SvFileStream aOutStm( aCommand.aTargetFile, - STREAM_READWRITE | STREAM_TRUNC ); + STREAM_READWRITE | StreamMode::TRUNC ); } } } diff --git a/include/svtools/imap.hxx b/include/svtools/imap.hxx index 140aadc6b670..4b2a4074c4d2 100644 --- a/include/svtools/imap.hxx +++ b/include/svtools/imap.hxx @@ -126,9 +126,9 @@ public: class IMapCompat { SvStream* pRWStm; - sal_uLong nCompatPos; - sal_uLong nTotalSize; - sal_uInt16 nStmMode; + sal_uLong nCompatPos; + sal_uLong nTotalSize; + StreamMode nStmMode; IMapCompat() {} IMapCompat( const IMapCompat& ) {} @@ -137,7 +137,7 @@ class IMapCompat public: - IMapCompat( SvStream& rStm, const sal_uInt16 nStreamMode ); + IMapCompat( SvStream& rStm, const StreamMode nStreamMode ); ~IMapCompat(); }; diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index dd830ae37f6e..e80d0978e845 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -27,6 +27,7 @@ #include <tools/ref.hxx> #include <tools/rtti.hxx> #include <rtl/string.hxx> +#include <o3tl/typed_flags_set.hxx> class StreamData; @@ -40,34 +41,38 @@ inline rtl_TextEncoding GetStoreCharSet( rtl_TextEncoding eEncoding ) // StreamTypes -typedef sal_uInt16 StreamMode; - // read, write, create,... options -#define STREAM_READ 0x0001 ///< allow read accesses -#define STREAM_WRITE 0x0002 ///< allow write accesses +enum class StreamMode { + NONE = 0x0000, + READ = 0x0001, ///< allow read accesses + WRITE = 0x0002, ///< allow write accesses // file i/o -#define STREAM_NOCREATE 0x0004 ///< 1 == Dont create file -#define STREAM_TRUNC 0x0008 ///< Truncate _existing_ file to zero length -#define STREAM_COPY_ON_SYMLINK 0x0010 ///< copy-on-write for symlinks (Unix) - -#define STREAM_READWRITEBITS (STREAM_READ | STREAM_WRITE | \ - STREAM_NOCREATE | STREAM_TRUNC) - + NOCREATE = 0x0004, ///< 1 == Dont create file + TRUNC = 0x0008, ///< Truncate _existing_ file to zero length + COPY_ON_SYMLINK = 0x0010, ///< copy-on-write for symlinks (Unix) // sharing options -#define STREAM_SHARE_DENYNONE 0x0100 -#define STREAM_SHARE_DENYREAD 0x0200 // overrides denynone -#define STREAM_SHARE_DENYWRITE 0x0400 // overrides denynone -#define STREAM_SHARE_DENYALL 0x0800 // overrides denyread,write,none + SHARE_DENYNONE = 0x0100, + SHARE_DENYREAD = 0x0200, // overrides denynone + SHARE_DENYWRITE = 0x0400, // overrides denynone + SHARE_DENYALL = 0x0800, // overrides denyread,write,none +}; +namespace o3tl +{ + template<> struct typed_flags<StreamMode> : is_typed_flags<StreamMode, 0x003f> {}; +} + +#define STREAM_READWRITEBITS (StreamMode::READ | StreamMode::WRITE | \ + StreamMode::NOCREATE | StreamMode::TRUNC) -#define STREAM_SHAREBITS (STREAM_SHARE_DENYNONE | STREAM_SHARE_DENYREAD |\ - STREAM_SHARE_DENYWRITE | STREAM_SHARE_DENYALL) +#define STREAM_SHAREBITS (StreamMode::SHARE_DENYNONE | StreamMode::SHARE_DENYREAD |\ + StreamMode::SHARE_DENYWRITE | StreamMode::SHARE_DENYALL) -#define STREAM_READWRITE (STREAM_READ | STREAM_WRITE) -#define STREAM_SHARE_DENYREADWRITE (STREAM_SHARE_DENYREAD | STREAM_SHARE_DENYWRITE) +#define STREAM_READWRITE (StreamMode::READ | StreamMode::WRITE) +#define STREAM_SHARE_DENYREADWRITE (StreamMode::SHARE_DENYREAD | StreamMode::SHARE_DENYWRITE) -#define STREAM_STD_READ (STREAM_READ | STREAM_SHARE_DENYNONE | STREAM_NOCREATE) -#define STREAM_STD_WRITE (STREAM_WRITE | STREAM_SHARE_DENYALL) -#define STREAM_STD_READWRITE (STREAM_READWRITE | STREAM_SHARE_DENYALL) +#define STREAM_STD_READ (StreamMode::READ | StreamMode::SHARE_DENYNONE | StreamMode::NOCREATE) +#define STREAM_STD_WRITE (StreamMode::WRITE | StreamMode::SHARE_DENYALL) +#define STREAM_STD_READWRITE (STREAM_READWRITE | StreamMode::SHARE_DENYALL) #define STREAM_SEEK_TO_BEGIN 0L #define STREAM_SEEK_TO_END SAL_MAX_UINT64 @@ -236,7 +241,7 @@ private: protected: sal_uInt64 m_nBufFilePos; ///< File position of pBuf[0] - sal_uInt16 eStreamMode; + StreamMode eStreamMode; bool bIsWritable; virtual sal_Size GetData( void* pData, sal_Size nSize ); diff --git a/include/tools/vcompat.hxx b/include/tools/vcompat.hxx index 2d0412fe6a86..b8dfe7fb8ef3 100644 --- a/include/tools/vcompat.hxx +++ b/include/tools/vcompat.hxx @@ -28,13 +28,14 @@ ((sal_uInt32)(char)(char4))<<24UL)) class SvStream; +enum class StreamMode; class TOOLS_DLLPUBLIC VersionCompat { SvStream* mpRWStm; sal_uInt32 mnCompatPos; sal_uInt32 mnTotalSize; - sal_uInt16 mnStmMode; + StreamMode mnStmMode; sal_uInt16 mnVersion; VersionCompat() {} @@ -44,7 +45,7 @@ class TOOLS_DLLPUBLIC VersionCompat public: - VersionCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion = 1 ); + VersionCompat( SvStream& rStm, StreamMode nStreamMode, sal_uInt16 nVersion = 1 ); ~VersionCompat(); sal_uInt16 GetVersion() const { return mnVersion; } diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx index d6529f545c44..0b9b28898e8c 100644 --- a/libreofficekit/qa/unit/tiledrendering.cxx +++ b/libreofficekit/qa/unit/tiledrendering.cxx @@ -93,7 +93,7 @@ static void dumpRGBABitmap( const OUString& rPath, const unsigned char* pBuffer, BitmapEx aBitmapEx( aBitmap ); vcl::PNGWriter aWriter( aBitmapEx ); - SvFileStream sOutput( rPath, STREAM_WRITE ); + SvFileStream sOutput( rPath, StreamMode::WRITE ); aWriter.Write( sOutput ); sOutput.Close(); } diff --git a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx index d3ee02a45adc..91c9b13b0f11 100644 --- a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx +++ b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx @@ -74,7 +74,7 @@ bool SAL_CALL LotusWordProImportFilter::importImpl( const Sequence< ::com::sun:: pValue[i].Value >>= sURL; } - SvFileStream inputStream( sURL, STREAM_READ ); + SvFileStream inputStream( sURL, StreamMode::READ ); if ( inputStream.IsEof() || ( inputStream.GetError() != SVSTREAM_OK ) ) return false; diff --git a/lotuswordpro/source/filter/bencont.cxx b/lotuswordpro/source/filter/bencont.cxx index 14951bf3f91d..e70923e4b88e 100644 --- a/lotuswordpro/source/filter/bencont.cxx +++ b/lotuswordpro/source/filter/bencont.cxx @@ -358,7 +358,7 @@ BenError LtcBenContainer::CreateGraphicStream(SvStream * &pStream, const char *p delete pS; } - pMemStream = new SvMemoryStream(pBuf, nLen, STREAM_READ); + pMemStream = new SvMemoryStream(pBuf, nLen, StreamMode::READ); assert(pMemStream != NULL); pStream = pMemStream; diff --git a/oox/source/drawingml/customshapepresetdata.cxx b/oox/source/drawingml/customshapepresetdata.cxx index 945825eeff06..1215a6d8d636 100644 --- a/oox/source/drawingml/customshapepresetdata.cxx +++ b/oox/source/drawingml/customshapepresetdata.cxx @@ -717,7 +717,7 @@ void CustomShapeProperties::initializePresetDataMap() { OUString aPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/filter/oox-drawingml-cs-presets"); rtl::Bootstrap::expandMacros(aPath); - SvFileStream aStream(aPath, STREAM_READ); + SvFileStream aStream(aPath, StreamMode::READ); if (aStream.GetError() != ERRCODE_NONE) SAL_WARN("oox", "failed to open oox-drawingml-cs-presets"); OString aLine; diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index e2ba6dfc788a..b66b78a03900 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2011,7 +2011,7 @@ std::map< OString, std::vector<OString> > lcl_getAdjNames() OUString aPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/filter/oox-drawingml-adj-names"); rtl::Bootstrap::expandMacros(aPath); - SvFileStream aStream(aPath, STREAM_READ); + SvFileStream aStream(aPath, StreamMode::READ); if (aStream.GetError() != ERRCODE_NONE) SAL_WARN("oox", "failed to open oox-drawingml-adj-names"); OString aLine; diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index a0a1ac7677db..067697e66f94 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -945,7 +945,7 @@ std::vector<OString> lcl_getShapeTypes() OUString aPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/filter/vml-shape-types"); rtl::Bootstrap::expandMacros(aPath); - SvFileStream aStream(aPath, STREAM_READ); + SvFileStream aStream(aPath, StreamMode::READ); if (aStream.GetError() != ERRCODE_NONE) SAL_WARN("oox", "failed to open vml-shape-types"); OString aLine; diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 84e53dca4be9..39a38015bbf4 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -459,7 +459,7 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) uno::Reference<XComponent> xCom(GetModel(),UNO_QUERY); SfxMediumRef pMedium = new SfxMedium( - sFileName, ( STREAM_READ | STREAM_NOCREATE ) ); + sFileName, ( StreamMode::READ | StreamMode::NOCREATE ) ); if( pMedium ) { diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index 402fb6711f21..5abce914bc08 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -837,8 +837,8 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile, const OUString& rSrsInPath, const OUString& rSrsOutPath ) { - SvFileStream aIStm( rSrsInPath, STREAM_READ ); - SvFileStream aOStm( rSrsOutPath, STREAM_WRITE | STREAM_TRUNC ); + SvFileStream aIStm( rSrsInPath, StreamMode::READ ); + SvFileStream aOStm( rSrsOutPath, StreamMode::WRITE | StreamMode::TRUNC ); ::std::vector< OString > aMissingImages; FILE* pSysListFile = rContext.aOutputSysList.isEmpty() ? NULL : fopen( rContext.aOutputSysList.getStr(), "ab" ); diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index e9265b95388a..ac81ac5b0d2b 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -1011,7 +1011,7 @@ bool ScAutoFormat::Load() aURL.setFinalSlash(); aURL.Append( OUString( sAutoTblFmtName ) ); - SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READ ); + SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), StreamMode::READ ); SvStream* pStream = aMedium.GetInStream(); bool bRet = (pStream && pStream->GetError() == 0); if (bRet) @@ -1072,7 +1072,7 @@ bool ScAutoFormat::Save() aURL.setFinalSlash(); aURL.Append(sAutoTblFmtName); - SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_WRITE ); + SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), StreamMode::WRITE ); SvStream* pStream = aMedium.GetOutStream(); bool bRet = (pStream && pStream->GetError() == 0); if (bRet) diff --git a/sc/source/core/tool/rechead.cxx b/sc/source/core/tool/rechead.cxx index 32d3d96fe7b3..f7566fe9cd97 100644 --- a/sc/source/core/tool/rechead.cxx +++ b/sc/source/core/tool/rechead.cxx @@ -52,7 +52,7 @@ ScMultipleReadHeader::ScMultipleReadHeader(SvStream& rNewStream) : rStream.ReadUInt32( nSizeTableLen ); pBuf = new sal_uInt8[nSizeTableLen]; rStream.Read( pBuf, nSizeTableLen ); - pMemStream = new SvMemoryStream( (char*)pBuf, nSizeTableLen, STREAM_READ ); + pMemStream = new SvMemoryStream( (char*)pBuf, nSizeTableLen, StreamMode::READ ); } nEndPos = rStream.Tell(); diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index ae83bca1e22b..e9aa7a68f1de 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -390,7 +390,7 @@ void ImportExcel8::ReadBasic( void ) rFilterOpt.IsLoadExcelBasicExecutable() ) { // see if we have the XCB stream - SvStorageStreamRef xXCB = xRootStrg->OpenSotStream( OUString("XCB"), STREAM_STD_READ | STREAM_NOCREATE ); + SvStorageStreamRef xXCB = xRootStrg->OpenSotStream( OUString("XCB"), STREAM_STD_READ | StreamMode::NOCREATE ); if ( xXCB.Is()|| SVSTREAM_OK == xXCB->GetError() ) { ScCTBWrapper wrapper; diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx index 23adece956e1..f23fdd576c15 100644 --- a/sc/source/filter/ftools/ftools.cxx +++ b/sc/source/filter/ftools/ftools.cxx @@ -195,7 +195,7 @@ SotStorageStreamRef ScfTools::OpenStorageStreamWrite( SotStorageRef xStrg, const OSL_ENSURE( !xStrg || !xStrg->IsContained( rStrmName ), "ScfTools::OpenStorageStreamWrite - stream exists already" ); SotStorageStreamRef xStrm; if( xStrg.Is() ) - xStrm = xStrg->OpenSotStream( rStrmName, STREAM_STD_WRITE | STREAM_TRUNC ); + xStrm = xStrg->OpenSotStream( rStrmName, STREAM_STD_WRITE | StreamMode::TRUNC ); return xStrm; } diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index aa4c01061a57..614af46b9a24 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -1257,7 +1257,7 @@ bool ScHTMLExport::CopyLocalFileToINet( OUString& rFileNm, pFileNameMap.reset( new std::map<OUString, OUString>() ); } - SvFileStream aTmp( aFileUrl.PathToFileName(), STREAM_READ ); + SvFileStream aTmp( aFileUrl.PathToFileName(), StreamMode::READ ); OUString aSrc = rFileNm; OUString aDest = aTargetUrl.GetPartBeforeLastName(); @@ -1266,7 +1266,7 @@ bool ScHTMLExport::CopyLocalFileToINet( OUString& rFileNm, if( bFileToFile ) { INetURLObject aCpyURL( aDest ); - SvFileStream aCpy( aCpyURL.PathToFileName(), STREAM_WRITE ); + SvFileStream aCpy( aCpyURL.PathToFileName(), StreamMode::WRITE ); aCpy.WriteStream( aTmp ); aCpy.Close(); @@ -1274,10 +1274,10 @@ bool ScHTMLExport::CopyLocalFileToINet( OUString& rFileNm, } else { - SfxMedium aMedium( aDest, STREAM_WRITE | STREAM_SHARE_DENYNONE ); + SfxMedium aMedium( aDest, StreamMode::WRITE | StreamMode::SHARE_DENYNONE ); { - SvFileStream aCpy( aMedium.GetPhysicalName(), STREAM_WRITE ); + SvFileStream aCpy( aMedium.GetPhysicalName(), StreamMode::WRITE ); aCpy.WriteStream( aTmp ); } diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 9a306b44541b..9ed9f94c344e 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -892,7 +892,7 @@ void XclObjOle::WriteSubRecs( XclExpStream& rStrm ) sprintf( aBuf, "%08X", static_cast< unsigned int >( nPictureId ) ); aStorageName += OUString::createFromAscii(aBuf); SotStorageRef xOleStg = pRootStorage->OpenSotStorage( aStorageName, - STREAM_READWRITE| STREAM_SHARE_DENYALL ); + STREAM_READWRITE| StreamMode::SHARE_DENYALL ); if( xOleStg.Is() ) { uno::Reference < embed::XEmbeddedObject > xObj( static_cast<const SdrOle2Obj&>(rOleObj).GetObjRef() ); diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index afbc7ae5418c..745e23863025 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -567,7 +567,7 @@ bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObj if ( xTransact.is() ) xTransact->commit(); - SvStream* pSrcStm = ::utl::UcbStreamHelper::CreateStream( aTempFile.GetURL(), STREAM_READ ); + SvStream* pSrcStm = ::utl::UcbStreamHelper::CreateStream( aTempFile.GetURL(), StreamMode::READ ); if( pSrcStm ) { rxOStm->SetBufferSize( 0xff00 ); diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index cb822e238134..1d7f57c03f49 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -455,7 +455,7 @@ bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, if ( xTransact.is() ) xTransact->commit(); - SvStream* pSrcStm = ::utl::UcbStreamHelper::CreateStream( aTempFile.GetURL(), STREAM_READ ); + SvStream* pSrcStm = ::utl::UcbStreamHelper::CreateStream( aTempFile.GetURL(), StreamMode::READ ); if( pSrcStm ) { rxOStm->SetBufferSize( 0xff00 ); diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx index 92f9519d93bc..b859d0be9b05 100644 --- a/sc/source/ui/docshell/datastream.cxx +++ b/sc/source/ui/docshell/datastream.cxx @@ -428,7 +428,7 @@ void DataStream::StartImport() if (mnSettings & SCRIPT_STREAM) pStream = new SvScriptStream(msURL); else - pStream = new SvFileStream(msURL, STREAM_READ); + pStream = new SvFileStream(msURL, StreamMode::READ); mxReaderThread = new datastreams::ReaderThread(pStream, maStartRange.aEnd.Col() - maStartRange.aStart.Col() + 1); mxReaderThread->launch(); } diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index e6d7e8b5cc5f..4d8817480935 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -293,7 +293,7 @@ bool ScImportExport::ImportString( const OUString& rText, sal_uLong nFmt ) { rtl_TextEncoding eEnc = osl_getThreadTextEncoding(); OString aTmp( rText.getStr(), rText.getLength(), eEnc ); - SvMemoryStream aStrm( (void*)aTmp.getStr(), aTmp.getLength() * sizeof(sal_Char), STREAM_READ ); + SvMemoryStream aStrm( (void*)aTmp.getStr(), aTmp.getLength() * sizeof(sal_Char), StreamMode::READ ); aStrm.SetStreamCharSet( eEnc ); SetNoEndianSwap( aStrm ); //! no swapping in memory return ImportStream( aStrm, OUString(), nFmt ); diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx index 1d070c142568..f5b7b8c1bc11 100644 --- a/sc/source/ui/inc/impex.hxx +++ b/sc/source/ui/inc/impex.hxx @@ -187,7 +187,7 @@ class ScImportStringStream : public SvMemoryStream public: ScImportStringStream( const OUString& rStr ) : SvMemoryStream( (void*)rStr.getStr(), - rStr.getLength() * sizeof(sal_Unicode), STREAM_READ) + rStr.getLength() * sizeof(sal_Unicode), StreamMode::READ) { SetStreamCharSet( RTL_TEXTENCODING_UNICODE ); #ifdef OSL_BIGENDIAN diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index ceafa0738f1a..ed59eebd832d 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -201,7 +201,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( // #i75610# if the sequence is empty, do nothing (don't create any printer) if ( nSize != 0 ) { - SvMemoryStream aStream (aSequence.getArray(), nSize, STREAM_READ ); + SvMemoryStream aStream (aSequence.getArray(), nSize, StreamMode::READ ); aStream.Seek ( STREAM_SEEK_TO_BEGIN ); SfxItemSet* pSet = new SfxItemSet( *rDoc.GetPool(), SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 452bfa9b85b9..8f0ed950c2e0 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -589,7 +589,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink // nur nach eigenen Filtern suchen, ohne Auswahlbox (wie in ScDocumentLoader) SfxFilterMatcher aMatcher( ScDocShell::Factory().GetFilterContainer()->GetName() ); - SfxMedium aSfxMedium( aStrURL, (STREAM_READ | STREAM_SHARE_DENYNONE) ); + SfxMedium aSfxMedium( aStrURL, (StreamMode::READ | StreamMode::SHARE_DENYNONE) ); // #i73992# GuessFilter no longer calls UseInteractionHandler. // This is UI, so it can be called here. aSfxMedium.UseInteractionHandler(true); diff --git a/sd/inc/sdiocmpt.hxx b/sd/inc/sdiocmpt.hxx index 7775d1757b24..cc18b4a0265f 100644 --- a/sd/inc/sdiocmpt.hxx +++ b/sd/inc/sdiocmpt.hxx @@ -22,15 +22,13 @@ #include <tools/stream.hxx> -class SvStream; - class old_SdrDownCompat { protected: SvStream& rStream; - sal_uInt32 nSubRecSiz; - sal_uInt32 nSubRecPos; - sal_uInt16 nMode; + sal_uInt32 nSubRecSiz; + sal_uInt32 nSubRecPos; + StreamMode nMode; bool bOpen; protected: @@ -38,7 +36,7 @@ protected: void Write(); public: - old_SdrDownCompat(SvStream& rNewStream, sal_uInt16 nNewMode); + old_SdrDownCompat(SvStream& rNewStream, StreamMode nNewMode); ~old_SdrDownCompat(); void OpenSubRecord(); void CloseSubRecord(); @@ -54,9 +52,9 @@ private: sal_uInt16 nVersion; public: - // nNewMode: STREAM_READ or STREAM_WRITE + // nNewMode: StreamMode::READ or StreamMode::WRITE // nVer: specify only when writing - SdIOCompat(SvStream& rNewStream, sal_uInt16 nNewMode, + SdIOCompat(SvStream& rNewStream, StreamMode nNewMode, sal_uInt16 nVer = SDIOCOMPAT_VERSIONDONTKNOW); ~SdIOCompat(); sal_uInt16 GetVersion() const { return nVersion; } diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index f86940f7ca31..cf9f9b181055 100644 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -245,7 +245,7 @@ Reference< XAnimationNode > implImportEffects( const Reference< XMultiServiceFac try { // create stream - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( rPath, STREAM_READ ); + SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( rPath, StreamMode::READ ); Reference<XInputStream> xInputStream( new utl::OInputStreamWrapper( pIStm, true ) ); // prepare ParserInputSrouce diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index d00c8aa168fd..8052e7ee7d91 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -263,7 +263,7 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(const OUString& rBookmarkFile) if (!rBookmarkFile.isEmpty() && maBookmarkFile != rBookmarkFile) { - SfxMedium* pMedium = new SfxMedium( rBookmarkFile, STREAM_READ ); + SfxMedium* pMedium = new SfxMedium( rBookmarkFile, StreamMode::READ ); pBookmarkDoc = OpenBookmarkDoc(*pMedium); } else if (mxBookmarkDocShRef.Is()) diff --git a/sd/source/core/sdiocmpt.cxx b/sd/source/core/sdiocmpt.cxx index 09d116e0457e..3795a4adef82 100644 --- a/sd/source/core/sdiocmpt.cxx +++ b/sd/source/core/sdiocmpt.cxx @@ -21,7 +21,7 @@ #include "sdiocmpt.hxx" -old_SdrDownCompat::old_SdrDownCompat(SvStream& rNewStream, sal_uInt16 nNewMode) +old_SdrDownCompat::old_SdrDownCompat(SvStream& rNewStream, StreamMode nNewMode) : rStream(rNewStream), nSubRecSiz(0), nSubRecPos(0), @@ -54,11 +54,11 @@ void old_SdrDownCompat::OpenSubRecord() nSubRecPos = rStream.Tell(); - if(nMode == STREAM_READ) + if(nMode == StreamMode::READ) { Read(); } - else if(nMode == STREAM_WRITE) + else if(nMode == StreamMode::WRITE) { Write(); } @@ -73,7 +73,7 @@ void old_SdrDownCompat::CloseSubRecord() sal_uInt32 nAktPos(rStream.Tell()); - if(nMode == STREAM_READ) + if(nMode == StreamMode::READ) { sal_uInt32 nReadAnz(nAktPos - nSubRecPos); if(nReadAnz != nSubRecSiz) @@ -81,7 +81,7 @@ void old_SdrDownCompat::CloseSubRecord() rStream.Seek(nSubRecPos + nSubRecSiz); } } - else if(nMode == STREAM_WRITE) + else if(nMode == StreamMode::WRITE) { nSubRecSiz = nAktPos - nSubRecPos; rStream.Seek(nSubRecPos); @@ -98,16 +98,16 @@ void old_SdrDownCompat::CloseSubRecord() |* \************************************************************************/ -SdIOCompat::SdIOCompat(SvStream& rNewStream, sal_uInt16 nNewMode, sal_uInt16 nVer) +SdIOCompat::SdIOCompat(SvStream& rNewStream, StreamMode nNewMode, sal_uInt16 nVer) : old_SdrDownCompat(rNewStream, nNewMode), nVersion(nVer) { - if (nNewMode == STREAM_WRITE) + if (nNewMode == StreamMode::WRITE) { DBG_ASSERT(nVer != SDIOCOMPAT_VERSIONDONTKNOW, "can´t write unknown version"); rNewStream.WriteUInt16( nVersion ); } - else if (nNewMode == STREAM_READ) + else if (nNewMode == StreamMode::READ) { DBG_ASSERT(nVer == SDIOCOMPAT_VERSIONDONTKNOW, "referring to the version while reading is silly!"); diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 4bf6e91542ab..ee806335b054 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -1487,7 +1487,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL SaveVBA( SfxObjectShell& rDocShell { xTemp->Seek( STREAM_SEEK_TO_BEGIN ); xTemp->Read( pTemp, nLen ); - pBas = new SvMemoryStream( pTemp, nLen, STREAM_READ ); + pBas = new SvMemoryStream( pTemp, nLen, StreamMode::READ ); pBas->ObjectOwnsMemory( true ); return true; } diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index ce9cb4d0ef0b..83ccbfaf1e19 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -2514,7 +2514,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a { SvStorageStreamRef xCompObj = xTemp->OpenSotStream( OUString( "\1CompObj" ), - STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL ); + StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL ); sal_uInt32 const nStreamLen = xCompObj->remainingSize(); sal_Int16 nVersion, nByteOrder; sal_Int32 nWinVersion, nVal, nStringLen; diff --git a/sd/source/filter/eppt/pptexsoundcollection.cxx b/sd/source/filter/eppt/pptexsoundcollection.cxx index 74a81f3cff11..4b732d747bfd 100644 --- a/sd/source/filter/eppt/pptexsoundcollection.cxx +++ b/sd/source/filter/eppt/pptexsoundcollection.cxx @@ -126,7 +126,7 @@ void ExSoundEntry::Write( SvStream& rSt, sal_uInt32 nId ) const rSt.WriteUInt32( ( EPP_SoundData << 16 ) ).WriteUInt32( ( nFileSize ) ); sal_uInt32 nBytesLeft = nFileSize; - SvStream* pSourceFile = ::utl::UcbStreamHelper::CreateStream( aSoundURL, STREAM_READ ); + SvStream* pSourceFile = ::utl::UcbStreamHelper::CreateStream( aSoundURL, StreamMode::READ ); if ( pSourceFile ) { sal_uInt8* pBuf = new sal_uInt8[ 0x10000 ]; // 64 kB Buffer diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 23a3ce37c5fa..83e8ddb196d3 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -2873,7 +2873,7 @@ bool HtmlExport::CopyScript( const OUString& rPath, const OUString& rSource, con meEC.SetContext( STR_HTMLEXP_ERROR_OPEN_FILE, rSource ); sal_uLong nErr = 0; - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); + SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ); if( pIStm ) { @@ -3167,7 +3167,7 @@ sal_uLong EasyFile::createStream( const OUString& rUrl, SvStream* &rpStr ) if( nErr == 0 ) { - pOStm = ::utl::UcbStreamHelper::CreateStream( aFileName, STREAM_WRITE | STREAM_TRUNC ); + pOStm = ::utl::UcbStreamHelper::CreateStream( aFileName, StreamMode::WRITE | StreamMode::TRUNC ); if( pOStm ) { bOpen = true; diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 40aa4a2b1e9c..c65adae60e68 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -240,7 +240,7 @@ bool SdPublishingDesign::operator ==(const SdPublishingDesign & rDesign) const // Load the design from the stream SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) { - SdIOCompat aIO(rIn, STREAM_READ); + SdIOCompat aIO(rIn, StreamMode::READ); sal_uInt16 nTemp16; @@ -295,7 +295,7 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDesign) { // The last parameter is the versionnumber of the code - SdIOCompat aIO(rOut, STREAM_WRITE, 0); + SdIOCompat aIO(rOut, StreamMode::WRITE, 0); // Name write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aDesignName, @@ -1455,7 +1455,7 @@ bool SdPublishingDlg::Load() // check if file exists, SfxMedium shows an errorbox else { com::sun::star::uno::Reference < com::sun::star::task::XInteractionHandler > xHandler; - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ, xHandler ); + SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ, xHandler ); bool bOk = pIStm && ( pIStm->GetError() == 0); @@ -1466,7 +1466,7 @@ bool SdPublishingDlg::Load() return false; } - SfxMedium aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ | STREAM_NOCREATE ); + SfxMedium aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ | StreamMode::NOCREATE ); SvStream* pStream = aMedium.GetInStream(); @@ -1479,7 +1479,7 @@ bool SdPublishingDlg::Load() if(aCheck != nMagic) return false; - SdIOCompat aIO(*pStream, STREAM_READ); + SdIOCompat aIO(*pStream, StreamMode::READ); sal_uInt16 nDesigns; pStream->ReadUInt16( nDesigns ); @@ -1502,7 +1502,7 @@ bool SdPublishingDlg::Save() { INetURLObject aURL( SvtPathOptions().GetUserConfigPath() ); aURL.Append( OUString( "designs.sod" ) ); - SfxMedium aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC ); + SfxMedium aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE | StreamMode::TRUNC ); SvStream* pStream = aMedium.GetOutStream(); @@ -1514,7 +1514,7 @@ bool SdPublishingDlg::Save() // Destroys the SdIOCompat before the Stream is being destributed { - SdIOCompat aIO(*pStream, STREAM_WRITE, 0); + SdIOCompat aIO(*pStream, StreamMode::WRITE, 0); sal_uInt16 nDesigns = (sal_uInt16) m_aDesignList.size(); pStream->WriteUInt16( nDesigns ); diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index b01e1b61aa0c..31d9cdcd4044 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -1906,7 +1906,7 @@ OUString ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const sal_uInt8* pBuf = new sal_uInt8[ nSoundDataLen ]; rStCtrl.Read( pBuf, nSoundDataLen ); - SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aGalleryUserSound.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC ); + SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aGalleryUserSound.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE | StreamMode::TRUNC ); if( pOStm ) { diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx index ec95e409b8e6..2318c4b8be1a 100644 --- a/sd/source/filter/ppt/propread.cxx +++ b/sd/source/filter/ppt/propread.cxx @@ -263,7 +263,7 @@ bool Section::GetDictionary( Dictionary& rDict ) if ( iter != maEntries.end() ) { sal_uInt32 nDictCount, nId, nSize, nPos; - SvMemoryStream aStream( (sal_Int8*)iter->mpBuf, iter->mnSize, STREAM_READ ); + SvMemoryStream aStream( (sal_Int8*)iter->mpBuf, iter->mnSize, StreamMode::READ ); aStream.Seek( STREAM_SEEK_TO_BEGIN ); aStream.ReadUInt32( nDictCount ); for ( sal_uInt32 i = 0; i < nDictCount; i++ ) diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index dda4f74a5fe0..d6a2a59c286e 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -631,7 +631,7 @@ bool SdTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pObject, sa if ( xTransact.is() ) xTransact->commit(); - SvStream* pSrcStm = ::utl::UcbStreamHelper::CreateStream( aTempFile.GetURL(), STREAM_READ ); + SvStream* pSrcStm = ::utl::UcbStreamHelper::CreateStream( aTempFile.GetURL(), StreamMode::READ ); if( pSrcStm ) { rxOStm->SetBufferSize( 0xff00 ); diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index 92421a3f3a11..4f3a0a874fb4 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -580,7 +580,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, SelectHdl) // remote? if ( INET_PROT_FILE != aURLObj.GetProtocol() ) { - SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( sImgUrl, STREAM_READ ); + SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( sImgUrl, StreamMode::READ ); if( pStream ) mpGraphicFilter->ImportGraphic( aGraphic, sImgUrl, *pStream, nFilter, NULL, nFilterImportFlags ); diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx index 78fbcf47c3fd..d21de6f97c27 100644 --- a/sd/source/ui/dlg/morphdlg.cxx +++ b/sd/source/ui/dlg/morphdlg.cxx @@ -77,7 +77,7 @@ void MorphDlg::LoadSettings() if( xIStm.Is() ) { - SdIOCompat aCompat( *xIStm, STREAM_READ ); + SdIOCompat aCompat( *xIStm, StreamMode::READ ); xIStm->ReadUInt16( nSteps ).ReadCharAsBool( bOrient ).ReadCharAsBool( bAttrib ); } @@ -99,7 +99,7 @@ void MorphDlg::SaveSettings() const if( xOStm.Is() ) { - SdIOCompat aCompat( *xOStm, STREAM_WRITE, 1 ); + SdIOCompat aCompat( *xOStm, StreamMode::WRITE, 1 ); xOStm->WriteUInt16( m_pMtfSteps->GetValue() ) .WriteUChar( m_pCbxOrientation->IsChecked() ) diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 91f5d2f63e4e..ed45f06e8230 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -607,7 +607,7 @@ bool SdNavigatorWin::InsertFile(const OUString& rFileName) if (aFileName != maDropFileName) { - SfxMedium aMed(aFileName, (STREAM_READ | STREAM_SHARE_DENYNONE)); + SfxMedium aMed(aFileName, (StreamMode::READ | StreamMode::SHARE_DENYNONE)); SfxFilterMatcher aMatch( OUString("simpress") ); aMed.UseInteractionHandler( true ); nErr = aMatch.GuessFilter(aMed, &pFilter); @@ -618,7 +618,7 @@ bool SdNavigatorWin::InsertFile(const OUString& rFileName) // The medium may be opened with READ/WRITE. Therefore, we first // check if it contains a Storage. SfxMedium* pMedium = new SfxMedium( aFileName, - STREAM_READ | STREAM_NOCREATE); + StreamMode::READ | StreamMode::NOCREATE); if (pMedium->IsStorage()) { diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index f7c49377762b..a7e414754a1b 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -648,7 +648,7 @@ IMPL_LINK_NOARG(SdTPAction, CheckFileHdl) { // check if it is a valid draw file SfxMedium aMedium( aFile, - STREAM_READ | STREAM_NOCREATE ); + StreamMode::READ | StreamMode::NOCREATE ); if( aMedium.IsStorage() ) { diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index c58665666b4a..2755789683f2 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -306,7 +306,7 @@ void SdVectorizeDlg::LoadSettings() if( xIStm.Is() ) { - SdIOCompat aCompat( *xIStm, STREAM_READ ); + SdIOCompat aCompat( *xIStm, StreamMode::READ ); xIStm->ReadUInt16( nLayers ).ReadUInt16( nReduce ).ReadUInt16( nFillHoles ).ReadCharAsBool( bFillHoles ); } else @@ -333,7 +333,7 @@ void SdVectorizeDlg::SaveSettings() const if( xOStm.Is() ) { - SdIOCompat aCompat( *xOStm, STREAM_WRITE, 1 ); + SdIOCompat aCompat( *xOStm, StreamMode::WRITE, 1 ); xOStm->WriteUInt16( m_pNmLayers->GetValue() ).WriteUInt16( m_pMtReduce->GetValue() ); xOStm->WriteUInt16( m_pMtFillHoles->GetValue() ).WriteUChar( m_pCbFillHoles->IsChecked() ); } diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index ff71ff2034f4..71cf119c3620 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -247,7 +247,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq ) mpDocSh->SetWaitCursor( true ); - SfxMedium* pMedium = new SfxMedium( aFile, STREAM_READ | STREAM_NOCREATE ); + SfxMedium* pMedium = new SfxMedium( aFile, StreamMode::READ | StreamMode::NOCREATE ); const SfxFilter* pFilter = NULL; SfxGetpApp()->GetFilterMatcher().GuessFilter( *pMedium, &pFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE ); diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx index ca59270f227b..94bf10085b44 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx @@ -183,7 +183,7 @@ Bitmap PngCompression::Decompress ( const PngReplacement* pData (dynamic_cast<const PngReplacement*>(&rBitmapData)); if (pData != NULL) { - SvMemoryStream aStream (pData->mpData, pData->mnDataSize, STREAM_READ); + SvMemoryStream aStream (pData->mpData, pData->mnDataSize, StreamMode::READ); ::vcl::PNGReader aReader (aStream); aResult = aReader.Read().GetBitmap(); } diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index 280055a2b72a..b193dd6fa2a8 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -746,7 +746,7 @@ throw (UnknownPropertyException, PropertyVetoException, sal_uInt32 nSize = aSequence.getLength(); if( nSize ) { - SvMemoryStream aStream (aSequence.getArray(), nSize, STREAM_READ ); + SvMemoryStream aStream (aSequence.getArray(), nSize, StreamMode::READ ); aStream.Seek ( STREAM_SEEK_TO_BEGIN ); SfxItemSet* pItemSet; diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 6a30a19f2275..04d64b7af3b8 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -448,7 +448,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl) if( !bOK ) { const SfxFilter* pFoundFilter = NULL; - SfxMedium aSfxMedium( aCurrentDropFile, STREAM_READ | STREAM_SHARE_DENYNONE ); + SfxMedium aSfxMedium( aCurrentDropFile, StreamMode::READ | StreamMode::SHARE_DENYNONE ); ErrCode nErr = SfxGetpApp()->GetFilterMatcher().GuessFilter( aSfxMedium, &pFoundFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE ); if( pFoundFilter && !nErr ) diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 742d84195511..b76bbb45e8da 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -291,7 +291,7 @@ sal_uInt32 CheckPasswd_Impl sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUString &rFileName, bool bCopy, SfxItemSet* pSet ) { const SfxFilter* pFilter = NULL; - SfxMedium aMedium( rFileName, ( STREAM_READ | STREAM_SHARE_DENYNONE ) ); + SfxMedium aMedium( rFileName, ( StreamMode::READ | StreamMode::SHARE_DENYNONE ) ); if ( !aMedium.GetStorage( false ).is() ) aMedium.GetInStream(); diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index c14f0e1b53a6..6b8a19d09176 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -524,7 +524,7 @@ bool LinkManager::GetGraphicFromAny( const OUString& rMimeType, if( rValue.hasValue() && ( rValue >>= aSeq ) ) { SvMemoryStream aMemStm( (void*)aSeq.getConstArray(), aSeq.getLength(), - STREAM_READ ); + StreamMode::READ ); aMemStm.Seek( 0 ); switch( SotExchange::GetFormatIdFromMimeType( rMimeType ) ) diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index e781f53bc089..075899772f7f 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -128,7 +128,7 @@ short SvxOpenGraphicDialog::Execute() // non-local? if ( INET_PROT_FILE != aObj.GetProtocol() ) { - SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); + SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ); aMed.Download(); SvStream* pStream = aMed.GetInStream(); diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx index 0274e5c09cbb..124641dec40c 100644 --- a/sfx2/source/appl/xpackcreator.cxx +++ b/sfx2/source/appl/xpackcreator.cxx @@ -76,7 +76,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde { UCBStorage* pUCBStorage = new UCBStorage( aContent, aFolderUrl, - STREAM_READ, + StreamMode::READ, false, true ); SotStorageRef aStorage = new SotStorage( pUCBStorage ); diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index dc5f254005f6..84bf04a6ed92 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -185,7 +185,7 @@ void RecentDocsView::Reload() Sequence<sal_Int8> aDecoded; sax::Converter::decodeBase64(aDecoded, aBase64); - SvMemoryStream aStream(aDecoded.getArray(), aDecoded.getLength(), STREAM_READ); + SvMemoryStream aStream(aDecoded.getArray(), aDecoded.getLength(), StreamMode::READ); vcl::PNGReader aReader(aStream); aThumbnail = aReader.Read(); } diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 2b46f08eb350..c5803cd7d216 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -768,7 +768,7 @@ ErrCode FileDialogHelper_Impl::getGraphic( const OUString& rURL, // non-local? if ( INET_PROT_FILE != aURLObj.GetProtocol() ) { - SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( rURL, STREAM_READ ); + SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( rURL, StreamMode::READ ); if( pStream ) nRet = mpGraphicFilter->ImportGraphic( rGraphic, rURL, *pStream, nFilter, NULL, nFilterImportFlags ); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 6fcd374c269d..8422c5eca23a 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -488,7 +488,7 @@ SvStream* SfxMedium::GetInStream() pImp->m_eError = pImp->m_pInStream->GetError(); - if (!pImp->m_eError && (pImp->m_nStorOpenMode & STREAM_WRITE) + if (!pImp->m_eError && (pImp->m_nStorOpenMode & StreamMode::WRITE) && ! pImp->m_pInStream->IsWritable() ) { pImp->m_eError = ERRCODE_IO_ACCESSDENIED; @@ -667,7 +667,7 @@ bool SfxMedium::Commit() GetInitFileDate( true ); // remove truncation mode from the flags - pImp->m_nStorOpenMode &= (~STREAM_TRUNC); + pImp->m_nStorOpenMode &= (~StreamMode::TRUNC); return bResult; } @@ -2269,7 +2269,7 @@ void SfxMedium::GetMedium_Impl() if ( !bFromTempFile ) { GetItemSet()->Put( SfxStringItem( SID_FILE_NAME, aFileName ) ); - if( !(pImp->m_nStorOpenMode & STREAM_WRITE) ) + if( !(pImp->m_nStorOpenMode & StreamMode::WRITE) ) GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, true ) ); if (xInteractionHandler.is()) GetItemSet()->Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER, makeAny(xInteractionHandler) ) ); @@ -2696,7 +2696,7 @@ void SfxMedium::SetIsRemote_Impl() // As files that are written to the remote transmission must also be able // to be read. if (pImp->m_bRemote) - pImp->m_nStorOpenMode |= STREAM_READ; + pImp->m_nStorOpenMode |= StreamMode::READ; } @@ -3180,7 +3180,7 @@ bool SfxMedium::IsReadOnly() const // b) if filter allow read/write contents .. check open mode of the storage if (!bReadOnly) - bReadOnly = !( GetOpenMode() & STREAM_WRITE ); + bReadOnly = !( GetOpenMode() & StreamMode::WRITE ); // c) the API can force the readonly state! if (!bReadOnly) @@ -3250,7 +3250,7 @@ void SfxMedium::CreateTempFile( bool bReplace ) return; } - if ( !(pImp->m_nStorOpenMode & STREAM_TRUNC) ) + if ( !(pImp->m_nStorOpenMode & StreamMode::TRUNC) ) { bool bTransferSuccess = false; diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 230d19a461b6..6fe904b6f725 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1271,7 +1271,7 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags ) else { // if a readonly medium has storage then it's stream is already based on temporary file - if( !(pMedium->GetOpenMode() & STREAM_WRITE) && !pMedium->HasStorage_Impl() ) + if( !(pMedium->GetOpenMode() & StreamMode::WRITE) && !pMedium->HasStorage_Impl() ) // don't lock file opened read only pMedium->CloseInStream(); } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 5d841a710a80..3de8c4918ca8 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2011,7 +2011,7 @@ bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed ) } else { - if( pMedium->GetOpenMode() & STREAM_WRITE ) + if( pMedium->GetOpenMode() & StreamMode::WRITE ) pMedium->GetInStream(); xStorage = GetStorage(); } @@ -2040,7 +2040,7 @@ bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed ) { if( pMedium ) { - if( pFilter && !IsPackageStorageFormat_Impl( *pMedium ) && (pMedium->GetOpenMode() & STREAM_WRITE )) + if( pFilter && !IsPackageStorageFormat_Impl( *pMedium ) && (pMedium->GetOpenMode() & StreamMode::WRITE )) { pMedium->ReOpen(); bOk = SaveCompletedChildren( false ); @@ -2590,7 +2590,7 @@ bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet ) pFilter = SfxFilterMatcher( OUString::createFromAscii( GetFactory().GetShortName()) ).GetFilter4FilterName( aFilterName ); SfxMedium *pMed = new SfxMedium( - pSalvageItem->GetValue(), STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, pFilter ); + pSalvageItem->GetValue(), STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC, pFilter ); SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, false ); if ( pPasswordItem ) @@ -2801,7 +2801,7 @@ bool SfxObjectShell::PreDoSaveAs_Impl pParams = pMergedParams; // create a medium for the target URL - SfxMedium *pNewFile = new SfxMedium( rFileName, STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, 0, pParams ); + SfxMedium *pNewFile = new SfxMedium( rFileName, STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC, 0, pParams ); // set filter; if no filter is given, take the default filter of the factory if ( !aFilterName.isEmpty() ) diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 9516e31871cb..8eaa6956aedb 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -1168,7 +1168,7 @@ ErrCode SfxOlePropertySet::SavePropertySet( SotStorage* pStrg, const OUString& r { if( pStrg ) { - SotStorageStreamRef xStrm = pStrg->OpenSotStream( rStrmName, STREAM_TRUNC | STREAM_STD_WRITE ); + SotStorageStreamRef xStrm = pStrg->OpenSotStream( rStrmName, StreamMode::TRUNC | STREAM_STD_WRITE ); if( xStrm.Is() ) Save( *xStrm ); else diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 79fc4e371f3a..96ea1b99fe20 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1989,7 +1989,7 @@ Any SAL_CALL SfxBaseModel::getTransferData( const datatransfer::DataFlavor& aFla utl::TempFile aTmp; aTmp.EnableKillingFile( true ); storeToURL( aTmp.GetURL(), Sequence < beans::PropertyValue >() ); - SvStream* pStream = aTmp.GetStream( STREAM_READ ); + SvStream* pStream = aTmp.GetStream( StreamMode::READ ); const sal_uInt32 nLen = pStream->Seek( STREAM_SEEK_TO_END ); Sequence< sal_Int8 > aSeq( nLen ); pStream->Seek( STREAM_SEEK_TO_BEGIN ); diff --git a/sfx2/source/inc/openflag.hxx b/sfx2/source/inc/openflag.hxx index ecfb51884a54..ddae32cdf40d 100644 --- a/sfx2/source/inc/openflag.hxx +++ b/sfx2/source/inc/openflag.hxx @@ -20,13 +20,13 @@ #define INCLUDED_SFX2_SOURCE_INC_OPENFLAG_HXX // Open file for editing, then only the third option (reading a copy) works -#define SFX_STREAM_READWRITE (STREAM_READWRITE | STREAM_SHARE_DENYWRITE) +#define SFX_STREAM_READWRITE (STREAM_READWRITE | StreamMode::SHARE_DENYWRITE) // I work on the original, not a copy // -> file then can not be opened for editing -#define SFX_STREAM_READONLY (STREAM_READ | STREAM_SHARE_DENYWRITE) // + !bDirect +#define SFX_STREAM_READONLY (StreamMode::READ | StreamMode::SHARE_DENYWRITE) // + !bDirect // Someone else is editing the file, a copy it created // -> the file can then be opened for editing -#define SFX_STREAM_READONLY_MAKECOPY (STREAM_READ | STREAM_SHARE_DENYNONE) +#define SFX_STREAM_READONLY_MAKECOPY (StreamMode::READ | StreamMode::SHARE_DENYNONE) #endif diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index e84c617994f3..3c9a9df554b4 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -366,7 +366,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) return; } - sal_uInt16 nOpenMode; + StreamMode nOpenMode; bool bNeedsReload = false; if ( !pSh->IsReadOnly() ) { @@ -465,15 +465,15 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) } pMed->CloseAndRelease(); - pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) ); + pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & StreamMode::WRITE ) ) ); pMed->SetOpenMode( nOpenMode ); pMed->CompleteReOpen(); - if ( nOpenMode & STREAM_WRITE ) + if ( nOpenMode & StreamMode::WRITE ) pMed->LockOrigFileOnDemand( false, true ); // LockOrigFileOnDemand might set the readonly flag itself, it should be set back - pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) ); + pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & StreamMode::WRITE ) ) ); if ( !pMed->GetErrorCode() ) bOK = true; diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index 50d7b720aa7b..eca253a0b4aa 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -121,7 +121,7 @@ bool importShapeGraphic( boost::scoped_ptr<SvStream> pGraphicStream( utl::UcbStreamHelper::CreateStream( aTmp.GetMainURL( INetURLObject::NO_DECODE ), - STREAM_READ ) ); + StreamMode::READ ) ); if( !pGraphicStream ) { OSL_FAIL( "ShapeImporter::importShape(): " diff --git a/sot/qa/cppunit/test_sot.cxx b/sot/qa/cppunit/test_sot.cxx index 92ade70a11a4..c1ebb1bebc9c 100644 --- a/sot/qa/cppunit/test_sot.cxx +++ b/sot/qa/cppunit/test_sot.cxx @@ -106,7 +106,7 @@ namespace const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aStream(rURL, STREAM_READ); + SvFileStream aStream(rURL, StreamMode::READ); SotStorageRef xObjStor = new SotStorage(aStream); if (!xObjStor.Is() || xObjStor->GetError()) return false; @@ -125,7 +125,7 @@ namespace void SotTest::testSize() { OUString aURL(getURLFromSrc("/sot/qa/cppunit/data/pass/fdo84229-1.compound")); - SvFileStream aStream(aURL, STREAM_READ); + SvFileStream aStream(aURL, StreamMode::READ); SotStorageRef xObjStor = new SotStorage(aStream); CPPUNIT_ASSERT_MESSAGE("sot storage failed to open", xObjStor.Is() && !xObjStor->GetError()); diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx index 75ce447086eb..0640771cf82e 100644 --- a/sot/source/base/formats.cxx +++ b/sot/source/base/formats.cxx @@ -1426,7 +1426,7 @@ static sal_uInt16 GetTransferableAction_Impl( if( aAny.hasValue() ) { Sequence< sal_Int8 > aSeq; aAny >>= aSeq; - SvMemoryStream aMemStm( (void*) aSeq.getConstArray(), aSeq.getLength(), STREAM_READ ); + SvMemoryStream aMemStm( (void*) aSeq.getConstArray(), aSeq.getLength(), StreamMode::READ ); FileList aFileList; ReadFileList( aMemStm, aFileList ); diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index 551b00a3c156..1d6c22255242 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -34,12 +34,12 @@ static long nTmpCount = 0; -// The internal open mode is STREAM_READ | STREAM_TRUNC, which is silly +// The internal open mode is StreamMode::READ | STREAM_TRUNC, which is silly // by itself. It inhibits the checking of sharing modes and is used // during CopyTo() and MoveTo() for opening a stream in read mode // although it may be open in DENYALL mode -#define INTERNAL_MODE ( STREAM_READ | STREAM_TRUNC ) +#define INTERNAL_MODE ( StreamMode::READ | StreamMode::TRUNC ) ///////////////////////// class StorageBase @@ -50,7 +50,7 @@ TYPEINIT1( BaseStorage, StorageBase ); StorageBase::StorageBase() : m_bAutoCommit( false ) { - m_nMode = STREAM_READ; + m_nMode = StreamMode::READ; m_nError = SVSTREAM_OK; } @@ -127,7 +127,7 @@ bool OLEStorageBase::Validate_Impl( bool bWrite ) const && pIo->pTOC && pEntry && !pEntry->bInvalid - && ( !bWrite || !pEntry->bDirect || ( nStreamMode & STREAM_WRITE ) ) ) + && ( !bWrite || !pEntry->bDirect || ( nStreamMode & StreamMode::WRITE ) ) ) return true; return false; } @@ -136,14 +136,14 @@ bool OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const { if( m == INTERNAL_MODE ) return true; - sal_uInt16 nCurMode = ( p && p->nRefCnt ) ? p->nMode : 0xFFFF; - if( ( m & 3 ) == STREAM_READ ) + StreamMode nCurMode = ( p && p->nRefCnt ) ? p->nMode : StreamMode::SHARE_DENYALL; + if( ( m & STREAM_READWRITE ) == StreamMode::READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed - if( ( ( m & STREAM_SHARE_DENYWRITE ) - && ( nCurMode & STREAM_SHARE_DENYWRITE ) ) - || ( ( m & STREAM_SHARE_DENYALL ) - && ( nCurMode & STREAM_SHARE_DENYALL ) ) ) + if( ( ( m & StreamMode::SHARE_DENYWRITE ) + && ( nCurMode & StreamMode::SHARE_DENYWRITE ) ) + || ( ( m & StreamMode::SHARE_DENYALL ) + && ( nCurMode & StreamMode::SHARE_DENYALL ) ) ) return true; } else @@ -151,8 +151,8 @@ bool OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const // only SHARE_DENYALL allowed // storages open in r/o mode are OK, since only // the commit may fail - if( ( m & STREAM_SHARE_DENYALL ) - && ( nCurMode & STREAM_SHARE_DENYALL ) ) + if( ( m & StreamMode::SHARE_DENYALL ) + && ( nCurMode & StreamMode::SHARE_DENYALL ) ) return true; } return false; @@ -176,7 +176,7 @@ StorageStream::StorageStream( StgIo* p, StgDirEntry* q, StreamMode m ) } } else - m &= ~STREAM_READWRITE; + m &= ~StreamMode(STREAM_READWRITE); m_nMode = m; } @@ -185,7 +185,7 @@ StorageStream::~StorageStream() // Do an auto-commit if the entry is open in direct mode if( m_bAutoCommit ) Commit(); - if( pEntry && pEntry->nRefCnt && pEntry->bDirect && (m_nMode & STREAM_WRITE) ) + if( pEntry && pEntry->nRefCnt && pEntry->bDirect && (m_nMode & StreamMode::WRITE) ) pEntry->Commit(); } @@ -260,7 +260,7 @@ bool StorageStream::Commit() { if( !Validate() ) return false; - if( !( m_nMode & STREAM_WRITE ) ) + if( !( m_nMode & StreamMode::WRITE ) ) { SetError( SVSTREAM_ACCESS_DENIED ); return false; @@ -378,7 +378,7 @@ Storage::Storage( const OUString& rFile, StreamMode m, bool bDirect ) m_nMode = m; if( pIo->Open( aName, m ) ) { - Init( ( m & ( STREAM_TRUNC | STREAM_NOCREATE ) ) == STREAM_TRUNC ); + Init( ( m & ( StreamMode::TRUNC | StreamMode::NOCREATE ) ) == StreamMode::TRUNC ); if( pEntry ) { pEntry->bDirect = bDirect; @@ -399,9 +399,9 @@ Storage::Storage( SvStream& r, bool bDirect ) : OLEStorageBase( new StgIo, NULL, m_nMode ) , bIsRoot( false ) { - m_nMode = STREAM_READ; + m_nMode = StreamMode::READ; if( r.IsWritable() ) - m_nMode = STREAM_READ | STREAM_WRITE; + m_nMode = StreamMode::READ | StreamMode::WRITE; if( r.GetError() == SVSTREAM_OK ) { pIo->SetStrm( &r, false ); @@ -427,7 +427,7 @@ Storage::Storage( SvStream& r, bool bDirect ) Storage::Storage( UCBStorageStream& rStrm, bool bDirect ) : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( false ) { - m_nMode = STREAM_READ; + m_nMode = StreamMode::READ; if ( rStrm.GetError() != SVSTREAM_OK ) { @@ -446,7 +446,7 @@ Storage::Storage( UCBStorageStream& rStrm, bool bDirect ) } if( pStream->IsWritable() ) - m_nMode = STREAM_READ | STREAM_WRITE; + m_nMode = StreamMode::READ | StreamMode::WRITE; pIo->SetStrm( &rStrm ); @@ -509,7 +509,7 @@ Storage::Storage( StgIo* p, StgDirEntry* q, StreamMode m ) if( q ) q->aEntry.GetName( aName ); else - m &= ~STREAM_READWRITE; + m &= ~StreamMode(STREAM_READWRITE); m_nMode = m; if( q && q->nRefCnt == 1 ) q->nMode = m; @@ -523,7 +523,7 @@ Storage::~Storage() if( pEntry ) { // Do an auto-commit if the entry is open in direct mode - if( pEntry->nRefCnt && pEntry->bDirect && (m_nMode & STREAM_WRITE) ) + if( pEntry->nRefCnt && pEntry->bDirect && (m_nMode & StreamMode::WRITE) ) Commit(); if( pEntry->nRefCnt == 1 ) pEntry->Invalidate(); @@ -588,7 +588,7 @@ BaseStorage* Storage::OpenStorage( const OUString& rName, StreamMode m, bool bDi StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); if( !p ) { - if( !( m & STREAM_NOCREATE ) ) + if( !( m & StreamMode::NOCREATE ) ) { bool bTemp = false; // create a new storage @@ -603,7 +603,7 @@ BaseStorage* Storage::OpenStorage( const OUString& rName, StreamMode m, bool bDi p->bTemp = bTemp; } if( !p ) - pIo->SetError( ( m & STREAM_WRITE ) + pIo->SetError( ( m & StreamMode::WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); } else if( !ValidateMode( m, p ) ) @@ -619,14 +619,14 @@ BaseStorage* Storage::OpenStorage( const OUString& rName, StreamMode m, bool bDi p->bDirect = bDirect; // Dont check direct conflict if opening readonly - if( p && (m & STREAM_WRITE )) + if( p && (m & StreamMode::WRITE )) { if( p->bDirect != bDirect ) SetError( SVSTREAM_ACCESS_DENIED ); } Storage* pStg = new Storage( pIo, p, m ); pIo->MoveError( *pStg ); - if( m & STREAM_WRITE ) pStg->m_bAutoCommit = true; + if( m & StreamMode::WRITE ) pStg->m_bAutoCommit = true; return pStg; } @@ -647,7 +647,7 @@ BaseStorageStream* Storage::OpenStream( const OUString& rName, StreamMode m, boo bool bTemp = false; if( !p ) { - if( !( m & STREAM_NOCREATE ) ) + if( !( m & StreamMode::NOCREATE ) ) { // create a new stream // make a name if the stream is temporary (has no name) @@ -660,7 +660,7 @@ BaseStorageStream* Storage::OpenStream( const OUString& rName, StreamMode m, boo p = pIo->pTOC->Create( *pEntry, aNewName, STG_STREAM ); } if( !p ) - pIo->SetError( ( m & STREAM_WRITE ) + pIo->SetError( ( m & StreamMode::WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); } else if( !ValidateMode( m, p ) ) @@ -728,7 +728,7 @@ bool Storage::CopyTo( const OUString& rElem, BaseStorage* pDest, const OUString& { // copy the entire storage BaseStorage* p1 = OpenStorage( rElem, INTERNAL_MODE ); - BaseStorage* p2 = pDest->OpenOLEStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect ); + BaseStorage* p2 = pDest->OpenOLEStorage( rNew, StreamMode::WRITE | StreamMode::SHARE_DENYALL, pEntry->bDirect ); if ( p2 ) { @@ -757,7 +757,7 @@ bool Storage::CopyTo( const OUString& rElem, BaseStorage* pDest, const OUString& { // stream copy BaseStorageStream* p1 = OpenStream( rElem, INTERNAL_MODE ); - BaseStorageStream* p2 = pDest->OpenStream( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect ); + BaseStorageStream* p2 = pDest->OpenStream( rNew, StreamMode::WRITE | StreamMode::SHARE_DENYALL, pEntry->bDirect ); if ( p2 ) { @@ -900,7 +900,7 @@ bool Storage::Commit() bool bRes = true; if( !Validate() ) return false; - if( !( m_nMode & STREAM_WRITE ) ) + if( !( m_nMode & StreamMode::WRITE ) ) { SetError( SVSTREAM_ACCESS_DENIED ); return false; diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx index 2e3d33b1e3e0..7b96e4f456ea 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -283,12 +283,12 @@ void StgCache::SetDirty( const rtl::Reference< StgPage > &xPage ) bool StgCache::Open( const OUString& rName, StreamMode nMode ) { // do not open in exclusive mode! - if( nMode & STREAM_SHARE_DENYALL ) - nMode = ( ( nMode & ~STREAM_SHARE_DENYALL ) | STREAM_SHARE_DENYWRITE ); + if( nMode & StreamMode::SHARE_DENYALL ) + nMode = ( ( nMode & ~StreamMode::SHARE_DENYALL ) | StreamMode::SHARE_DENYWRITE ); SvFileStream* pFileStrm = new SvFileStream( rName, nMode ); // SvStream "Feature" Write Open auch erfolgreich, wenns nicht klappt bool bAccessDenied = false; - if( ( nMode & STREAM_WRITE ) && !pFileStrm->IsWritable() ) + if( ( nMode & StreamMode::WRITE ) && !pFileStrm->IsWritable() ) { pFileStrm->Close(); bAccessDenied = true; diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index df59391314c1..84fcf770287c 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -73,7 +73,7 @@ void StgDirEntry::InitMembers() nPos = nEntry = nRefCnt = 0; - nMode = STREAM_READ; + nMode = StreamMode::READ; bDirect = true; bInvalid = bCreated = @@ -307,7 +307,7 @@ sal_Int32 StgDirEntry::GetSize() bool StgDirEntry::SetSize( sal_Int32 nNewSize ) { if ( - !( nMode & STREAM_WRITE ) || + !( nMode & StreamMode::WRITE ) || (!bDirect && !pTmpStrm && !Strm2Tmp()) ) { @@ -418,9 +418,9 @@ sal_Int32 StgDirEntry::Seek( sal_Int32 nNew ) // try to enlarge, the readonly streams should not allow this if( nNew > nSize ) { - if ( !( nMode & STREAM_WRITE ) || !SetSize( nNew ) ) + if ( !( nMode & StreamMode::WRITE ) || !SetSize( nNew ) ) { - SAL_WARN_IF(!(nMode & STREAM_WRITE), "sot", + SAL_WARN_IF(!(nMode & StreamMode::WRITE), "sot", "Trying to resize readonly stream by seeking, could be a wrong offset: " << nNew); return nPos; } @@ -461,7 +461,7 @@ sal_Int32 StgDirEntry::Read( void* p, sal_Int32 nLen ) sal_Int32 StgDirEntry::Write( const void* p, sal_Int32 nLen ) { - if( nLen <= 0 || !( nMode & STREAM_WRITE ) ) + if( nLen <= 0 || !( nMode & StreamMode::WRITE ) ) return 0; // Was this stream committed internally and reopened in direct mode? @@ -524,7 +524,7 @@ void StgDirEntry::Copy( BaseStorageStream& rDest ) bool StgDirEntry::Commit() { - // OSL_ENSURE( nMode & STREAM_WRITE, "Trying to commit readonly stream!" ); + // OSL_ENSURE( nMode & StreamMode::WRITE, "Trying to commit readonly stream!" ); aSave = aEntry; bool bRes = true; diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx index 45ad9679a744..2c6cd6245c87 100644 --- a/sot/source/sdstor/stgelem.cxx +++ b/sot/source/sdstor/stgelem.cxx @@ -367,7 +367,7 @@ bool StgEntry::Load( const void* pFrom, sal_uInt32 nBufSize ) if ( nBufSize < 128 ) return false; - SvMemoryStream r( (sal_Char*) pFrom, nBufSize, STREAM_READ ); + SvMemoryStream r( (sal_Char*) pFrom, nBufSize, StreamMode::READ ); for( short i = 0; i < 32; i++ ) r.ReadUInt16( nName[ i ] ); // 00 name as WCHAR r.ReadUInt16( nNameLen ) // 40 size of name in bytes including 00H @@ -413,7 +413,7 @@ bool StgEntry::Load( const void* pFrom, sal_uInt32 nBufSize ) void StgEntry::Store( void* pTo ) { - SvMemoryStream r( (sal_Char *)pTo, 128, STREAM_WRITE ); + SvMemoryStream r( (sal_Char *)pTo, 128, StreamMode::WRITE ); for( short i = 0; i < 32; i++ ) r.WriteUInt16( nName[ i ] ); // 00 name as WCHAR r.WriteUInt16( nNameLen ) // 40 size of name in bytes including 00H diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index a1c41b7f0be8..953bee3c4cb0 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -363,7 +363,7 @@ sal_uLong StgIo::ValidateFATs() StgIo aIo; if( aIo.Open( pFileStrm->GetFileName(), - STREAM_READ | STREAM_SHARE_DENYNONE) && + StreamMode::READ | StreamMode::SHARE_DENYNONE) && aIo.Load() ) { pV = new Validator( aIo ); diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index ac98f71fbd88..254cfe51277e 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -32,9 +32,9 @@ StgInternalStream::StgInternalStream( BaseStorage& rStg, const OUString& rName, bool bWr ) { bIsWritable = true; - sal_uInt16 nMode = bWr - ? STREAM_WRITE | STREAM_SHARE_DENYALL - : STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE; + StreamMode nMode = bWr + ? StreamMode::WRITE | StreamMode::SHARE_DENYALL + : StreamMode::READ | StreamMode::SHARE_DENYWRITE | StreamMode::NOCREATE; pStrm = rStg.OpenStream( rName, nMode ); // set the error code right here in the stream diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 0294a6ca4ea4..30262d25fc49 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -84,7 +84,7 @@ SotStorageStream::SotStorageStream( const OUString & rName, StreamMode nMode, : SvStream( MakeLockBytes_Impl( rName, nMode ) ) , pOwnStm( NULL ) { - if( nMode & STREAM_WRITE ) + if( nMode & StreamMode::WRITE ) bIsWritable = true; else bIsWritable = false; @@ -96,7 +96,7 @@ SotStorageStream::SotStorageStream( BaseStorageStream * pStm ) { if( pStm ) { - if( STREAM_WRITE & pStm->GetMode() ) + if( StreamMode::WRITE & pStm->GetMode() ) bIsWritable = true; else bIsWritable = false; @@ -345,7 +345,7 @@ SotStorage::SotStorage() // ??? What's this ??? } -#define ERASEMASK ( STREAM_TRUNC | STREAM_WRITE | STREAM_SHARE_DENYALL ) +#define ERASEMASK ( StreamMode::TRUNC | StreamMode::WRITE | StreamMode::SHARE_DENYALL ) #include <com/sun/star/uno/Reference.h> #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <ucbhelper/content.hxx> @@ -420,7 +420,7 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, Storage { // detect special disk spanned storages if ( UCBStorage::IsDiskSpannedFile( m_pStorStm ) ) - nMode |= STORAGE_DISKSPANNED_MODE; + nStorageMode |= STORAGE_DISKSPANNED_MODE; // UCBStorage always works directly on the UCB content, so discard the stream first DELETEZ( m_pStorStm ); @@ -751,7 +751,7 @@ SotStorageStream * SotStorage::OpenSotStream( const OUString & rEleName, { // volle Ole-Patches einschalten // egal was kommt, nur exclusiv gestattet - nMode |= STREAM_SHARE_DENYALL; + nMode |= StreamMode::SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorageStream * p = m_pOwnStg->OpenStream( rEleName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? false : true ); @@ -759,7 +759,7 @@ SotStorageStream * SotStorage::OpenSotStream( const OUString & rEleName, if( !nE ) m_pOwnStg->ResetError(); // kein Fehler setzen - if( nMode & STREAM_TRUNC ) + if( nMode & StreamMode::TRUNC ) pStm->SetSize( 0 ); } else @@ -775,7 +775,7 @@ SotStorage * SotStorage::OpenSotStorage( const OUString & rEleName, DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) { - nMode |= STREAM_SHARE_DENYALL; + nMode |= StreamMode::SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorage * p = m_pOwnStg->OpenStorage(rEleName, nMode, !transacted); if( p ) @@ -914,11 +914,11 @@ SotStorage* SotStorage::OpenOLEStorage( const com::sun::star::uno::Reference < c const OUString& rEleName, StreamMode nMode ) { sal_Int32 nEleMode = embed::ElementModes::SEEKABLEREAD; - if ( nMode & STREAM_WRITE ) + if ( nMode & StreamMode::WRITE ) nEleMode |= embed::ElementModes::WRITE; - if ( nMode & STREAM_TRUNC ) + if ( nMode & StreamMode::TRUNC ) nEleMode |= embed::ElementModes::TRUNCATE; - if ( nMode & STREAM_NOCREATE ) + if ( nMode & StreamMode::NOCREATE ) nEleMode |= embed::ElementModes::NOCREATE; SvStream* pStream = NULL; @@ -927,7 +927,7 @@ SotStorage* SotStorage::OpenOLEStorage( const com::sun::star::uno::Reference < c uno::Reference < io::XStream > xStream = xStorage->openStreamElement( rEleName, nEleMode ); // TODO/LATER: should it be done this way? - if ( nMode & STREAM_WRITE ) + if ( nMode & StreamMode::WRITE ) { uno::Reference < beans::XPropertySet > xStreamProps( xStream, uno::UNO_QUERY_THROW ); xStreamProps->setPropertyValue( diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 441a7b7e8873..6e9243e40b3d 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -523,7 +523,7 @@ public: { long nError = m_nError; ReadContent(); - if ( m_nMode & STREAM_WRITE ) + if ( m_nMode & StreamMode::WRITE ) { m_nError = nError; if ( m_pAntiImpl ) @@ -643,7 +643,7 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const OUString& rName, StreamMode , m_nRepresentMode( nonset ) , m_nError( 0 ) , m_nMode( nMode ) - , m_bSourceRead( !( nMode & STREAM_TRUNC ) ) + , m_bSourceRead( !( nMode & StreamMode::TRUNC ) ) , m_bModified( false ) , m_bCommited( false ) , m_bDirect( bDirect ) @@ -925,7 +925,7 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize ) { - if ( !(m_nMode & STREAM_WRITE) ) + if ( !(m_nMode & StreamMode::WRITE) ) { SetError( ERRCODE_IO_ACCESSDENIED ); return 0; // ?mav? @@ -986,7 +986,7 @@ sal_uInt64 UCBStorageStream_Impl::SeekPos(sal_uInt64 const nPos) DBG_ASSERT( aResult == m_pStream->Tell(), "Error in stream arithmetic!\n" ); } - if( (m_nMode & STREAM_WRITE) && !m_bSourceRead && aResult < nPos ) + if( (m_nMode & StreamMode::WRITE) && !m_bSourceRead && aResult < nPos ) { // it means that all the Source stream was copied already // but the required position still was not reached @@ -1004,7 +1004,7 @@ sal_uInt64 UCBStorageStream_Impl::SeekPos(sal_uInt64 const nPos) void UCBStorageStream_Impl::SetSize(sal_uInt64 const nSize) { - if ( !(m_nMode & STREAM_WRITE) ) + if ( !(m_nMode & StreamMode::WRITE) ) { SetError( ERRCODE_IO_ACCESSDENIED ); return; @@ -1105,8 +1105,8 @@ sal_Int16 UCBStorageStream_Impl::Commit() Free(); // the temporary file does not exist only for truncated streams - DBG_ASSERT( !m_aTempURL.isEmpty() || ( m_nMode & STREAM_TRUNC ), "No temporary file to read from!"); - if ( m_aTempURL.isEmpty() && !( m_nMode & STREAM_TRUNC ) ) + DBG_ASSERT( !m_aTempURL.isEmpty() || ( m_nMode & StreamMode::TRUNC ), "No temporary file to read from!"); + if ( m_aTempURL.isEmpty() && !( m_nMode & StreamMode::TRUNC ) ) throw RuntimeException(); // create wrapper to stream that is only used while reading inside package component @@ -1177,12 +1177,12 @@ bool UCBStorageStream_Impl::Revert() m_rSource = m_pContent->openStream(); if( m_rSource.is() ) { - if ( m_pAntiImpl && ( m_nMode & STREAM_TRUNC ) ) + if ( m_pAntiImpl && ( m_nMode & StreamMode::TRUNC ) ) // stream is in use and should be truncated m_bSourceRead = false; else { - m_nMode &= ~STREAM_TRUNC; + m_nMode &= ~StreamMode::TRUNC; m_bSourceRead = true; } } @@ -1238,17 +1238,17 @@ void UCBStorageStream_Impl::Free() void UCBStorageStream_Impl::PrepareCachedForReopen( StreamMode nMode ) { - bool isWritable = (( m_nMode & STREAM_WRITE ) != 0 ); + bool isWritable = bool( m_nMode & StreamMode::WRITE ); if ( isWritable ) { // once stream was writable, never reset to readonly - nMode |= STREAM_WRITE; + nMode |= StreamMode::WRITE; } m_nMode = nMode; Free(); - if ( nMode & STREAM_TRUNC ) + if ( nMode & StreamMode::TRUNC ) { m_bSourceRead = false; // usually it should be 0 already but just in case... @@ -1280,7 +1280,7 @@ UCBStorageStream::UCBStorageStream( UCBStorageStream_Impl *pImpl ) UCBStorageStream::~UCBStorageStream() { - if ( pImp->m_nMode & STREAM_WRITE ) + if ( pImp->m_nMode & StreamMode::WRITE ) pImp->Flush(); pImp->m_pAntiImpl = NULL; pImp->Free(); @@ -1325,22 +1325,19 @@ bool UCBStorageStream::SetSize( sal_uLong nNewSize ) bool UCBStorageStream::Validate( bool bWrite ) const { - return ( !bWrite || ( pImp->m_nMode & STREAM_WRITE ) ); + return ( !bWrite || ( pImp->m_nMode & StreamMode::WRITE ) ); } bool UCBStorageStream::ValidateMode( StreamMode m ) const { // ??? - if( m == ( STREAM_READ | STREAM_TRUNC ) ) // from stg.cxx + if( m == ( StreamMode::READ | StreamMode::TRUNC ) ) // from stg.cxx return true; - sal_uInt16 nCurMode = 0xFFFF; - if( ( m & 3 ) == STREAM_READ ) + if( ( m & STREAM_READWRITE) == StreamMode::READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed - if( ( ( m & STREAM_SHARE_DENYWRITE ) - && ( nCurMode & STREAM_SHARE_DENYWRITE ) ) - || ( ( m & STREAM_SHARE_DENYALL ) - && ( nCurMode & STREAM_SHARE_DENYALL ) ) ) + if( ( m & StreamMode::SHARE_DENYWRITE ) + || ( m & StreamMode::SHARE_DENYALL ) ) return true; } else @@ -1348,8 +1345,7 @@ bool UCBStorageStream::ValidateMode( StreamMode m ) const // only SHARE_DENYALL allowed // storages open in r/o mode are OK, since only // the commit may fail - if( ( m & STREAM_SHARE_DENYALL ) - && ( nCurMode & STREAM_SHARE_DENYALL ) ) + if( m & StreamMode::SHARE_DENYALL ) return true; } @@ -1461,9 +1457,9 @@ UCBStorage::UCBStorage( SvStream& rStrm, bool bDirect ) OUString aURL = GetLinkedFile( rStrm ); if ( !aURL.isEmpty() ) { - StreamMode nMode = STREAM_READ; + StreamMode nMode = StreamMode::READ; if( rStrm.IsWritable() ) - nMode = STREAM_READ | STREAM_WRITE; + nMode = StreamMode::READ | StreamMode::WRITE; ::ucbhelper::Content aContent( aURL, Reference < XCommandEnvironment >(), comphelper::getProcessComponentContext() ); pImp = new UCBStorage_Impl( aContent, aURL, nMode, this, bDirect, true ); @@ -1599,7 +1595,7 @@ UCBStorage_Impl::UCBStorage_Impl( const OUString& rName, StreamMode nMode, UCBSt aTemp += INetURLObject::encode( aName, INetURLObject::PART_AUTHORITY, '%', INetURLObject::ENCODE_ALL ); m_aURL = aTemp; - if ( m_nMode & STREAM_WRITE ) + 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 != 0 /* bFileExists */ ); @@ -1658,9 +1654,9 @@ UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, bool m_pSource->Seek(0); // check opening mode - m_nMode = STREAM_READ; + m_nMode = StreamMode::READ; if( rStream.IsWritable() ) - m_nMode = STREAM_READ | STREAM_WRITE; + m_nMode = StreamMode::READ | StreamMode::WRITE; } void UCBStorage_Impl::Init() @@ -1671,17 +1667,10 @@ void UCBStorage_Impl::Init() // if the name was not already set to a temp name m_aName = m_aOriginalName = aObj.GetLastName(); - // don't create the content for disk spanned files, avoid too early access to directory and/or manifest - if ( !m_pContent && !( m_nMode & STORAGE_DISKSPANNED_MODE ) ) + if ( !m_pContent ) CreateContent(); - if ( m_nMode & STORAGE_DISKSPANNED_MODE ) - { - // Hack! Avoid access to the manifest file until mediatype is not available in the first segment of a - // disk spanned file - m_aContentType = m_aOriginalContentType = "application/vnd.sun.xml.impress"; - } - else if ( m_pContent ) + if ( m_pContent ) { if ( m_bIsLinked ) { @@ -1882,7 +1871,7 @@ void UCBStorage_Impl::ReadContent() catch (const CommandAbortedException&) { // any command wasn't executed successfully - not specified - if ( !( m_nMode & STREAM_WRITE ) ) + if ( !( m_nMode & StreamMode::WRITE ) ) // if the folder was just inserted and not already committed, this is not an error! SetError( ERRCODE_IO_GENERAL ); } @@ -2130,7 +2119,7 @@ sal_Int16 UCBStorage_Impl::Commit() // there is nothing to do if the storage has been opened readonly or if it was opened in transacted mode and no // commit command has been sent - if ( ( m_nMode & STREAM_WRITE ) && ( m_bCommited || m_bDirect ) ) + if ( ( m_nMode & StreamMode::WRITE ) && ( m_bCommited || m_bDirect ) ) { try { @@ -2533,7 +2522,7 @@ bool UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base { // copy the streams data // the destination stream must not be open - boost::scoped_ptr<BaseStorageStream> pOtherStream(pDest->OpenStream( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect )); + boost::scoped_ptr<BaseStorageStream> pOtherStream(pDest->OpenStream( rNew, StreamMode::WRITE | StreamMode::SHARE_DENYALL, pImp->m_bDirect )); BaseStorageStream* pStream = NULL; bool bDeleteStream = false; @@ -2577,8 +2566,8 @@ bool UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base bool bOpenUCBStorage = pUCBDest && pUCBCopy; boost::scoped_ptr<BaseStorage> pOtherStorage(bOpenUCBStorage ? - pDest->OpenUCBStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect ) : - pDest->OpenOLEStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect )); + pDest->OpenUCBStorage( rNew, StreamMode::WRITE | StreamMode::SHARE_DENYALL, pImp->m_bDirect ) : + pDest->OpenOLEStorage( rNew, StreamMode::WRITE | StreamMode::SHARE_DENYALL, pImp->m_bDirect )); // For UCB storages, the class id and the format id may differ, // do passing the class id is not sufficient. @@ -2695,9 +2684,9 @@ BaseStorageStream* UCBStorage::OpenStream( const OUString& rEleName, StreamMode if ( !pElement ) { // element does not exist, check if creation is allowed - if( ( nMode & STREAM_NOCREATE ) ) + if( ( nMode & StreamMode::NOCREATE ) ) { - SetError( ( nMode & STREAM_WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); + SetError( ( nMode & StreamMode::WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); OUString aName( pImp->m_aURL ); aName += "/"; aName += rEleName; @@ -2794,9 +2783,9 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const OUString& rEleName, StreamMode if ( !pElement ) { // element does not exist, check if creation is allowed - if( ( nMode & STREAM_NOCREATE ) ) + if( ( nMode & StreamMode::NOCREATE ) ) { - SetError( ( nMode & STREAM_WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); + SetError( ( nMode & StreamMode::WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); OUString aName( pImp->m_aURL ); aName += "/"; aName += rEleName; // ??? @@ -2827,7 +2816,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const OUString& rEleName, StreamMode UCBStorageStream* pStream = PTR_CAST( UCBStorageStream, pStr ); if ( !pStream ) { - SetError( ( nMode & STREAM_WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); + SetError( ( nMode & StreamMode::WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); return NULL; } @@ -2839,7 +2828,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const OUString& rEleName, StreamMode bool bInited = pElement->m_xStream->Init(); if (!bInited) { - SetError( ( nMode & STREAM_WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); + SetError( ( nMode & StreamMode::WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); return NULL; } @@ -2856,8 +2845,8 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const OUString& rEleName, StreamMode } else { - bool bIsWritable = (( pElement->m_xStorage->m_nMode & STREAM_WRITE ) != 0); - if ( !bIsWritable && (( nMode & STREAM_WRITE ) != 0 )) + bool bIsWritable = bool( pElement->m_xStorage->m_nMode & StreamMode::WRITE ); + if ( !bIsWritable && ( nMode & StreamMode::WRITE ) ) { OUString aName( pImp->m_aURL ); aName += "/"; @@ -2875,7 +2864,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const OUString& rEleName, StreamMode else if ( !pElement->m_xStream.Is() ) { // storage is opened the first time - bool bIsWritable = (( pImp->m_nMode & STREAM_WRITE ) != 0 ); + bool bIsWritable = bool(pImp->m_nMode & StreamMode::WRITE); if ( pImp->m_bIsLinked && pImp->m_bIsRoot && bIsWritable ) { // make sure that the root storage object has been created before substorages will be created @@ -3050,33 +3039,19 @@ bool UCBStorage::ValidateFAT() bool UCBStorage::Validate( bool bWrite ) const { // ??? - return ( !bWrite || ( pImp->m_nMode & STREAM_WRITE ) ); + return ( !bWrite || ( pImp->m_nMode & StreamMode::WRITE ) ); } bool UCBStorage::ValidateMode( StreamMode m ) const { // ??? - if( m == ( STREAM_READ | STREAM_TRUNC ) ) // from stg.cxx + if( m == ( StreamMode::READ | StreamMode::TRUNC ) ) // from stg.cxx + return true; + // only SHARE_DENYALL allowed + // storages open in r/o mode are OK, since only + // the commit may fail + if( m & StreamMode::SHARE_DENYALL ) return true; - sal_uInt16 nCurMode = 0xFFFF; - if( ( m & 3 ) == STREAM_READ ) - { - // only SHARE_DENYWRITE or SHARE_DENYALL allowed - if( ( ( m & STREAM_SHARE_DENYWRITE ) - && ( nCurMode & STREAM_SHARE_DENYWRITE ) ) - || ( ( m & STREAM_SHARE_DENYALL ) - && ( nCurMode & STREAM_SHARE_DENYALL ) ) ) - return true; - } - else - { - // only SHARE_DENYALL allowed - // storages open in r/o mode are OK, since only - // the commit may fail - if( ( m & STREAM_SHARE_DENYALL ) - && ( nCurMode & STREAM_SHARE_DENYALL ) ) - return true; - } return true; } @@ -3186,7 +3161,7 @@ OUString UCBStorage::CreateLinkFile( const OUString& rName ) boost::scoped_ptr< ::utl::TempFile> pTempFile(new ::utl::TempFile( &aFolderURL )); // get the stream from the temp file - SvStream* pStream = pTempFile->GetStream( STREAM_STD_READWRITE | STREAM_TRUNC ); + SvStream* pStream = pTempFile->GetStream( STREAM_STD_READWRITE | StreamMode::TRUNC ); // write header pStream->WriteUInt32( 0x04034b50 ); diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx index 368da14a3639..fd4b822e9643 100644 --- a/sot/source/unoolestorage/xolesimplestorage.cxx +++ b/sot/source/unoolestorage/xolesimplestorage.cxx @@ -489,7 +489,7 @@ uno::Any SAL_CALL OLESimpleStorage::getByName( const OUString& aName ) } else { - BaseStorageStream* pStream = m_pStorage->OpenStream( aName, STREAM_READ | STREAM_SHARE_DENYALL | STREAM_NOCREATE ); + BaseStorageStream* pStream = m_pStorage->OpenStream( aName, StreamMode::READ | StreamMode::SHARE_DENYALL | StreamMode::NOCREATE ); try { if ( !pStream || pStream->GetError() || m_pStorage->GetError() ) diff --git a/starmath/source/eqnolefilehdr.cxx b/starmath/source/eqnolefilehdr.cxx index d1d7428af8cd..744032b211a2 100644 --- a/starmath/source/eqnolefilehdr.cxx +++ b/starmath/source/eqnolefilehdr.cxx @@ -34,7 +34,7 @@ bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion ) SvStorageStreamRef xSrc = pStor->OpenSotStream( OUString("Equation Native"), - STREAM_STD_READ | STREAM_NOCREATE); + STREAM_STD_READ | StreamMode::NOCREATE); if ( (!xSrc.Is()) || (SVSTREAM_OK != xSrc->GetError())) return bSuccess; SvStorageStream *pS = &xSrc; diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index bdbc36ebc391..368230b16aa1 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -556,7 +556,7 @@ int MathType::Parse(SotStorage *pStor) { SvStorageStreamRef xSrc = pStor->OpenSotStream( OUString("Equation Native"), - STREAM_STD_READ | STREAM_NOCREATE); + STREAM_STD_READ | StreamMode::NOCREATE); if ( (!xSrc.Is()) || (SVSTREAM_OK != xSrc->GetError())) return 0; pS = &xSrc; diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index c3cc19563d11..02d8864555ec 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -637,7 +637,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any* if ( *pValues >>= aSequence ) { sal_uInt32 nSize = aSequence.getLength(); - SvMemoryStream aStream ( aSequence.getArray(), nSize, STREAM_READ ); + SvMemoryStream aStream ( aSequence.getArray(), nSize, StreamMode::READ ); aStream.Seek ( STREAM_SEEK_TO_BEGIN ); static sal_uInt16 const nRange[] = { diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index b2ed826fe06d..00ebf9c005e3 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -56,7 +56,7 @@ Primitive2DSequence Test::parseSvg(const char* aSource) OUString aUrl = getURLFromSrc(aSource); OUString aPath = getPathFromSrc(aSource); - SvFileStream aFileStream(aUrl, STREAM_READ); + SvFileStream aFileStream(aUrl, StreamMode::READ); sal_Size nSize = aFileStream.remainingSize(); boost::scoped_array<sal_Int8> pBuffer(new sal_Int8[nSize + 1]); aFileStream.Read(pBuffer.get(), nSize); diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index c81640f5b2e7..5423e3beafe3 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -217,7 +217,7 @@ namespace svgio if(aPass.hasElements()) { - SvMemoryStream aStream(aPass.getArray(), aPass.getLength(), STREAM_READ); + SvMemoryStream aStream(aPass.getArray(), aPass.getLength(), StreamMode::READ); Graphic aGraphic; if(GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic( diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx index 6a9428893f0d..827c88c35fae 100644 --- a/svl/source/items/cntwall.cxx +++ b/svl/source/items/cntwall.cxx @@ -65,7 +65,7 @@ CntWallpaperItem::CntWallpaperItem( sal_uInt16 which, SvStream& rStream, sal_uIn // the stream after the wallpaper data in its dtor. We must use // this trick here as no VCL must be used here ( No Wallpaper // object allowed ). - VersionCompat aCompat( rStream, STREAM_READ ); + VersionCompat aCompat( rStream, StreamMode::READ ); } // Read SfxWallpaperItem's string member _aURL. diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index c83db0b4a1d5..e1a26e7f5a6d 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -988,7 +988,7 @@ void FontNameBox::SaveMRUEntries( const OUString& aFontMRUEntriesFile, sal_Unico return; SvFileStream aStream; - aStream.Open( aFontMRUEntriesFile, STREAM_WRITE | STREAM_TRUNC ); + aStream.Open( aFontMRUEntriesFile, StreamMode::WRITE | StreamMode::TRUNC ); if( ! (aStream.IsOpen() && aStream.IsWritable()) ) { #if OSL_DEBUG_LEVEL > 1 @@ -1007,7 +1007,7 @@ void FontNameBox::LoadMRUEntries( const OUString& aFontMRUEntriesFile, sal_Unico if( aFontMRUEntriesFile.isEmpty() ) return; - SvFileStream aStream( aFontMRUEntriesFile, STREAM_READ ); + SvFileStream aStream( aFontMRUEntriesFile, StreamMode::READ ); if( ! aStream.IsOpen() ) { #if OSL_DEBUG_LEVEL > 1 diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index 8b5fa7b490f2..75d30cafe0d1 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -75,7 +75,7 @@ void GraphicDescriptor::init( const ::Graphic& rGraphic ) void GraphicDescriptor::init( const OUString& rURL ) { - boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( rURL, STREAM_READ )); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( rURL, StreamMode::READ )); if( pIStm ) implCreate( *pIStm, &rURL ); diff --git a/svtools/source/graphic/grfattr.cxx b/svtools/source/graphic/grfattr.cxx index b44cafd86283..6a11cb266115 100644 --- a/svtools/source/graphic/grfattr.cxx +++ b/svtools/source/graphic/grfattr.cxx @@ -75,7 +75,7 @@ bool GraphicAttr::operator==( const GraphicAttr& rAttr ) const SvStream& ReadGraphicAttr( SvStream& rIStm, GraphicAttr& rAttr ) { - VersionCompat aCompat( rIStm, STREAM_READ ); + VersionCompat aCompat( rIStm, StreamMode::READ ); sal_uInt32 nTmp32; sal_uInt16 nTmp16; @@ -101,7 +101,7 @@ SvStream& ReadGraphicAttr( SvStream& rIStm, GraphicAttr& rAttr ) SvStream& WriteGraphicAttr( SvStream& rOStm, const GraphicAttr& rAttr ) { - VersionCompat aCompat( rOStm, STREAM_WRITE, 2 ); + VersionCompat aCompat( rOStm, StreamMode::WRITE, 2 ); const sal_uInt32 nTmp32 = 0; rOStm.WriteUInt32( nTmp32 ).WriteUInt32( nTmp32 ); diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index f680b1146231..32ec70728463 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -232,7 +232,7 @@ void GraphicObject::ImplAutoSwapIn() if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( GetLink(), aURLStr ) ) { - boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aURLStr, STREAM_READ )); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aURLStr, StreamMode::READ )); if( pIStm ) { @@ -1103,7 +1103,7 @@ IMPL_LINK_NOARG(GraphicObject, ImplAutoSwapOutHdl) SvStream& ReadGraphicObject( SvStream& rIStm, GraphicObject& rGraphicObj ) { - VersionCompat aCompat( rIStm, STREAM_READ ); + VersionCompat aCompat( rIStm, StreamMode::READ ); Graphic aGraphic; GraphicAttr aAttr; bool bLink; @@ -1130,7 +1130,7 @@ SvStream& ReadGraphicObject( SvStream& rIStm, GraphicObject& rGraphicObj ) SvStream& WriteGraphicObject( SvStream& rOStm, const GraphicObject& rGraphicObj ) { - VersionCompat aCompat( rOStm, STREAM_WRITE, 1 ); + VersionCompat aCompat( rOStm, StreamMode::WRITE, 1 ); const bool bLink = rGraphicObj.HasLink(); WriteGraphic( rOStm, rGraphicObj.GetGraphic() ); @@ -1159,7 +1159,7 @@ GraphicObject GraphicObject::CreateGraphicObjectFromURL( const OUString &rURL ) Graphic aGraphic; if ( !aURL.isEmpty() ) { - boost::scoped_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aURL, STREAM_READ )); + boost::scoped_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aURL, StreamMode::READ )); if( pStream ) GraphicConverter::Import( *pStream, aGraphic ); } diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index f5a4292a3afd..5a224189b3ab 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -200,7 +200,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadBitmap( const uno uno::Reference< ::graphic::XGraphic > xRet; uno::Sequence< sal_Int8 > aBmpSeq( xBtm->getDIB() ); uno::Sequence< sal_Int8 > aMaskSeq( xBtm->getMaskDIB() ); - SvMemoryStream aBmpStream( aBmpSeq.getArray(), aBmpSeq.getLength(), STREAM_READ ); + SvMemoryStream aBmpStream( aBmpSeq.getArray(), aBmpSeq.getLength(), StreamMode::READ ); Bitmap aBmp; BitmapEx aBmpEx; @@ -208,7 +208,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadBitmap( const uno if( aMaskSeq.getLength() ) { - SvMemoryStream aMaskStream( aMaskSeq.getArray(), aMaskSeq.getLength(), STREAM_READ ); + SvMemoryStream aMaskStream( aMaskSeq.getArray(), aMaskSeq.getLength(), StreamMode::READ ); Bitmap aMask; ReadDIB(aMask, aMaskStream, true); @@ -462,7 +462,7 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co xRet = implLoadStandardImage( aPath ); if( !xRet.is() ) - pIStm.reset(::utl::UcbStreamHelper::CreateStream( aPath, STREAM_READ )); + pIStm.reset(::utl::UcbStreamHelper::CreateStream( aPath, StreamMode::READ )); } else if( xBtm.is() ) { @@ -741,7 +741,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG OUString aURL; aValue >>= aURL; - pOStm.reset(::utl::UcbStreamHelper::CreateStream( aURL, STREAM_WRITE | STREAM_TRUNC )); + pOStm.reset(::utl::UcbStreamHelper::CreateStream( aURL, StreamMode::WRITE | StreamMode::TRUNC )); aPath = aURL; } else if (aName == "OutputStream") diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index 6ff356b22ade..37f794cc0d3d 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -92,7 +92,7 @@ void IMapObject::Write( SvStream& rOStm, const OUString& rBaseURL ) const rOStm.WriteUChar( bActive ); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aTarget, eEncoding); - boost::scoped_ptr<IMapCompat> pCompat(new IMapCompat( rOStm, STREAM_WRITE )); + boost::scoped_ptr<IMapCompat> pCompat(new IMapCompat( rOStm, StreamMode::WRITE )); WriteIMapObject( rOStm ); aEventList.Write( rOStm ); // V4 @@ -121,7 +121,7 @@ void IMapObject::Read( SvStream& rIStm, const OUString& rBaseURL ) // make URL absolute aURL = URIHelper::SmartRel2Abs( INetURLObject(rBaseURL), aURL, URIHelper::GetMaybeFileHdl(), true, false, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS ); - boost::scoped_ptr<IMapCompat> pCompat(new IMapCompat( rIStm, STREAM_READ )); + boost::scoped_ptr<IMapCompat> pCompat(new IMapCompat( rIStm, StreamMode::READ )); ReadIMapObject( rIStm ); @@ -959,7 +959,7 @@ void ImageMap::Write( SvStream& rOStm, const OUString& rBaseURL ) const rOStm.WriteUInt16( nCount ); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aImageName, eEncoding); - pCompat = new IMapCompat( rOStm, STREAM_WRITE ); + pCompat = new IMapCompat( rOStm, StreamMode::WRITE ); // here one can insert in newer versions @@ -1001,7 +1001,7 @@ void ImageMap::Read( SvStream& rIStm, const OUString& rBaseURL ) rIStm.ReadUInt16( nCount ); read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); // Dummy - pCompat = new IMapCompat( rIStm, STREAM_READ ); + pCompat = new IMapCompat( rIStm, StreamMode::READ ); // here one can read in newer versions diff --git a/svtools/source/misc/imap3.cxx b/svtools/source/misc/imap3.cxx index 90114cd4be05..b0a198a7fa53 100644 --- a/svtools/source/misc/imap3.cxx +++ b/svtools/source/misc/imap3.cxx @@ -28,17 +28,17 @@ |* \******************************************************************************/ -IMapCompat::IMapCompat( SvStream& rStm, const sal_uInt16 nStreamMode ) +IMapCompat::IMapCompat( SvStream& rStm, const StreamMode nStreamMode ) : pRWStm(&rStm) , nCompatPos(0) , nTotalSize(0) , nStmMode(nStreamMode) { - DBG_ASSERT( nStreamMode == STREAM_READ || nStreamMode == STREAM_WRITE, "Wrong Mode!" ); + DBG_ASSERT( nStreamMode == StreamMode::READ || nStreamMode == StreamMode::WRITE, "Wrong Mode!" ); if ( !pRWStm->GetError() ) { - if ( nStmMode == STREAM_WRITE ) + if ( nStmMode == StreamMode::WRITE ) { nCompatPos = pRWStm->Tell(); pRWStm->SeekRel( 4 ); @@ -65,7 +65,7 @@ IMapCompat::~IMapCompat() { if ( !pRWStm->GetError() ) { - if ( nStmMode == STREAM_WRITE ) + if ( nStmMode == StreamMode::WRITE ) { const sal_uLong nEndPos = pRWStm->Tell(); diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx index 8d2c992a5bbf..8c1e2a4eadf3 100644 --- a/svtools/source/misc/templatefoldercache.cxx +++ b/svtools/source/misc/templatefoldercache.cxx @@ -763,7 +763,7 @@ namespace svt // open the stream m_pCacheStream = UcbStreamHelper::CreateStream( aStorageURL.GetMainURL( INetURLObject::DECODE_TO_IURI ), - _bForRead ? STREAM_READ | STREAM_NOCREATE : STREAM_WRITE | STREAM_TRUNC ); + _bForRead ? StreamMode::READ | StreamMode::NOCREATE : StreamMode::WRITE | StreamMode::TRUNC ); DBG_ASSERT( m_pCacheStream, "TemplateFolderCacheImpl::openCacheStream: could not open/create the cache stream!" ); if ( m_pCacheStream && m_pCacheStream->GetErrorCode() ) { diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 7bf8f637dfba..81defcc9f04f 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -350,7 +350,7 @@ Any SAL_CALL TransferableHelper::getTransferData2( const DataFlavor& rFlavor, co if( maAny >>= aSeq ) { - boost::scoped_ptr<SvMemoryStream> pSrcStm(new SvMemoryStream( (char*) aSeq.getConstArray(), aSeq.getLength(), STREAM_WRITE | STREAM_TRUNC )); + boost::scoped_ptr<SvMemoryStream> pSrcStm(new SvMemoryStream( (char*) aSeq.getConstArray(), aSeq.getLength(), StreamMode::WRITE | StreamMode::TRUNC )); GDIMetaFile aMtf; ReadGDIMetaFile( *pSrcStm, aMtf ); @@ -380,7 +380,7 @@ Any SAL_CALL TransferableHelper::getTransferData2( const DataFlavor& rFlavor, co if( maAny >>= aSeq ) { - boost::scoped_ptr<SvMemoryStream> pSrcStm(new SvMemoryStream( (char*) aSeq.getConstArray(), aSeq.getLength(), STREAM_WRITE | STREAM_TRUNC )); + boost::scoped_ptr<SvMemoryStream> pSrcStm(new SvMemoryStream( (char*) aSeq.getConstArray(), aSeq.getLength(), StreamMode::WRITE | StreamMode::TRUNC )); GDIMetaFile aMtf; ReadGDIMetaFile( *pSrcStm, aMtf ); diff --git a/svx/source/core/extedit.cxx b/svx/source/core/extedit.cxx index c06457c38325..83cbbec6fcfb 100644 --- a/svx/source/core/extedit.cxx +++ b/svx/source/core/extedit.cxx @@ -46,7 +46,7 @@ void ExternalToolEdit::HandleCloseEvent(ExternalToolEdit* pData) Graphic newGraphic; //import the temp file image stream into the newGraphic - boost::scoped_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(pData->m_aFileName, STREAM_READ)); + boost::scoped_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(pData->m_aFileName, StreamMode::READ)); if(pStream) { GraphicConverter::Import(*pStream, newGraphic); diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx index d275c3112433..50dadc2dc212 100644 --- a/svx/source/core/graphichelper.cxx +++ b/svx/source/core/graphichelper.cxx @@ -163,10 +163,10 @@ OUString GraphicHelper::ExportGraphic( const Graphic& rGraphic, const OUString& nDefaultFilter == rGraphicFilter.GetExportFormatNumber( xFilterManager->getCurrentFilter())) { // try to save the original graphic - SfxMedium aIn( rGraphicName, STREAM_READ | STREAM_NOCREATE ); + SfxMedium aIn( rGraphicName, StreamMode::READ | StreamMode::NOCREATE ); if( aIn.GetInStream() && !aIn.GetInStream()->GetError() ) { - SfxMedium aOut( sPath, STREAM_WRITE | STREAM_SHARE_DENYNONE); + SfxMedium aOut( sPath, StreamMode::WRITE | StreamMode::SHARE_DENYNONE); if( aOut.GetOutStream() && !aOut.GetOutStream()->GetError()) { aOut.GetOutStream()->WriteStream( *aIn.GetInStream() ); diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 4e241c64901b..6866020c4004 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -450,7 +450,7 @@ void SvxIMapDlg::DoOpen() { INetURLObject aURL( aDlg.GetPath() ); DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ )); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); if( pIStm ) { @@ -525,7 +525,7 @@ bool SvxIMapDlg::DoSave() if( aURL.getExtension().isEmpty() ) aURL.setExtension( aExt ); - boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC )); + boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE | StreamMode::TRUNC )); if( pOStm ) { pIMapWnd->GetImageMap().Write( *pOStm, nFormat, "" ); diff --git a/svx/source/gallery2/galini.cxx b/svx/source/gallery2/galini.cxx index b4c53388cf1c..0fbe1ba8625d 100644 --- a/svx/source/gallery2/galini.cxx +++ b/svx/source/gallery2/galini.cxx @@ -29,7 +29,7 @@ OUString GalleryThemeEntry::ReadStrFromIni(const OUString &aKeyName ) { boost::scoped_ptr<SvStream> pStrm(::utl::UcbStreamHelper::CreateStream( GetStrURL().GetMainURL( INetURLObject::NO_DECODE ), - STREAM_READ )); + StreamMode::READ )); const LanguageTag &rLangTag = Application::GetSettings().GetUILanguageTag(); diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 0c239765724d..f483f3cf608c 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -260,7 +260,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO OUString aTestFile( "cdefghij.klm" ); aTestURL.Append( aTestFile ); - boost::scoped_ptr<SvStream> pTestStm(::utl::UcbStreamHelper::CreateStream( aTestURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE )); + boost::scoped_ptr<SvStream> pTestStm(::utl::UcbStreamHelper::CreateStream( aTestURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE )); if( pTestStm ) { @@ -619,7 +619,7 @@ GalleryTheme* Gallery::ImplGetCachedTheme(const GalleryThemeEntry* pThemeEntry) if( FileExists( aURL ) ) { - boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ )); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); if( pIStm ) { diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index 6822194fd5f4..fd0a90cc33be 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -86,7 +86,7 @@ sal_uInt16 GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic, OUString& rFilterName, bool bShowProgress ) { sal_uInt16 nRet = SGA_IMPORT_NONE; - SfxMedium aMedium( rURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); + SfxMedium aMedium( rURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ); aMedium.Download(); diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index cf644489752f..120e8ac86437 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -95,10 +95,10 @@ void GalleryTheme::ImplCreateSvDrawStorage() { try { - aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? STREAM_READ : STREAM_STD_READWRITE ); + aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? StreamMode::READ : STREAM_STD_READWRITE ); // #i50423# ReadOnly may not been set though the file can't be written (because of security reasons) if ( ( aSvDrawStorageRef->GetError() != ERRCODE_NONE ) && !pThm->IsReadOnly() ) - aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); + aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ); } catch (const css::ucb::ContentCreationException& e) { @@ -110,7 +110,7 @@ void GalleryTheme::ImplCreateSvDrawStorage() bool GalleryTheme::ImplWriteSgaObject( const SgaObject& rObj, size_t nPos, GalleryObject* pExistentEntry ) { - boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( GetSdgURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE )); + boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( GetSdgURL().GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE )); bool bRet = false; if( pOStm ) @@ -154,7 +154,7 @@ SgaObject* GalleryTheme::ImplReadSgaObject( GalleryObject* pEntry ) if( pEntry ) { - boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( GetSdgURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ )); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( GetSdgURL().GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); if( pIStm ) { @@ -206,9 +206,9 @@ void GalleryTheme::ImplWrite() if( FileExists( aPathURL ) || CreateDir( aPathURL ) ) { #ifdef UNX - boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( GetThmURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_COPY_ON_SYMLINK | STREAM_TRUNC )); + boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( GetThmURL().GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE | StreamMode::COPY_ON_SYMLINK | StreamMode::TRUNC )); #else - boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( GetThmURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC )); + boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( GetThmURL().GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE | StreamMode::TRUNC )); #endif if( pOStm ) @@ -257,7 +257,7 @@ INetURLObject GalleryTheme::ImplCreateUniqueURL( SgaObjKind eObjKind, sal_uIntPt // read next possible number if( FileExists( aInfoFileURL ) ) { - boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aInfoFileURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ )); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aInfoFileURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); if( pIStm ) { @@ -322,7 +322,7 @@ INetURLObject GalleryTheme::ImplCreateUniqueURL( SgaObjKind eObjKind, sal_uIntPt while( bExists ); // write updated number - boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( aInfoFileURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE )); + boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( aInfoFileURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE )); if( pOStm ) { @@ -575,7 +575,7 @@ void GalleryTheme::Actualize( const Link& rActualizeLink, GalleryProgress* pProg if ( aSvDrawStorageRef.Is() ) { const OUString aStmName( GetSvDrawStreamNameFromURL( pEntry->aURL ) ); - SvStorageStreamRef pIStm = aSvDrawStorageRef->OpenSotStream( aStmName, STREAM_READ ); + SvStorageStreamRef pIStm = aSvDrawStorageRef->OpenSotStream( aStmName, StreamMode::READ ); if( pIStm && !pIStm->GetError() ) { @@ -616,8 +616,8 @@ void GalleryTheme::Actualize( const Link& rActualizeLink, GalleryProgress* pProg DBG_ASSERT( aInURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); DBG_ASSERT( aTmpURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aInURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ )); - boost::scoped_ptr<SvStream> pTmpStm(::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC )); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aInURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); + boost::scoped_ptr<SvStream> pTmpStm(::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE | StreamMode::TRUNC )); if( pIStm && pTmpStm ) { @@ -696,7 +696,7 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, bo if( FileExists( rURL ) ) { - boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( rURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ )); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( rURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); if( pIStm ) { @@ -735,7 +735,7 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, bo if( nId1 == COMPAT_FORMAT( 'G', 'A', 'L', 'R' ) && nId2 == COMPAT_FORMAT( 'E', 'S', 'R', 'V' ) ) { - boost::scoped_ptr<VersionCompat> pCompat(new VersionCompat( *pIStm, STREAM_READ )); + boost::scoped_ptr<VersionCompat> pCompat(new VersionCompat( *pIStm, StreamMode::READ )); pIStm->ReadUInt32( nThemeId ); @@ -891,7 +891,7 @@ bool GalleryTheme::InsertGraphic( const Graphic& rGraphic, sal_uIntPtr nInsertPo } const INetURLObject aURL( ImplCreateUniqueURL( SGA_OBJ_BMP, nExportFormat ) ); - boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC )); + boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE | StreamMode::TRUNC )); if( pOStm ) { @@ -941,7 +941,7 @@ bool GalleryTheme::GetModel( sal_uIntPtr nPos, SdrModel& rModel, bool ) if( xStor.Is() ) { const OUString aStmName( GetSvDrawStreamNameFromURL( aURL ) ); - SvStorageStreamRef xIStm( xStor->OpenSotStream( aStmName, STREAM_READ ) ); + SvStorageStreamRef xIStm( xStor->OpenSotStream( aStmName, StreamMode::READ ) ); if( xIStm.Is() && !xIStm->GetError() ) { @@ -964,7 +964,7 @@ bool GalleryTheme::InsertModel( const FmFormModel& rModel, sal_uIntPtr nInsertPo if( xStor.Is() ) { const OUString aStmName( GetSvDrawStreamNameFromURL( aURL ) ); - SvStorageStreamRef xOStm( xStor->OpenSotStream( aStmName, STREAM_WRITE | STREAM_TRUNC ) ); + SvStorageStreamRef xOStm( xStor->OpenSotStream( aStmName, StreamMode::WRITE | StreamMode::TRUNC ) ); if( xOStm.Is() && !xOStm->GetError() ) { @@ -1013,7 +1013,7 @@ bool GalleryTheme::GetModelStream( sal_uIntPtr nPos, SotStorageStreamRef& rxMode if( xStor.Is() ) { const OUString aStmName( GetSvDrawStreamNameFromURL( aURL ) ); - SvStorageStreamRef xIStm( xStor->OpenSotStream( aStmName, STREAM_READ ) ); + SvStorageStreamRef xIStm( xStor->OpenSotStream( aStmName, StreamMode::READ ) ); if( xIStm.Is() && !xIStm->GetError() ) { @@ -1060,7 +1060,7 @@ bool GalleryTheme::InsertModelStream( const SotStorageStreamRef& rxModelStream, if( xStor.Is() ) { const OUString aStmName( GetSvDrawStreamNameFromURL( aURL ) ); - SvStorageStreamRef xOStm( xStor->OpenSotStream( aStmName, STREAM_WRITE | STREAM_TRUNC ) ); + SvStorageStreamRef xOStm( xStor->OpenSotStream( aStmName, StreamMode::WRITE | StreamMode::TRUNC ) ); if( xOStm.Is() && !xOStm->GetError() ) { @@ -1355,7 +1355,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const rOStm.WriteUInt32( COMPAT_FORMAT( 'G', 'A', 'L', 'R' ) ).WriteUInt32( COMPAT_FORMAT( 'E', 'S', 'R', 'V' ) ); const long nReservePos = rOStm.Tell(); - boost::scoped_ptr<VersionCompat> pCompat(new VersionCompat( rOStm, STREAM_WRITE, 2 )); + boost::scoped_ptr<VersionCompat> pCompat(new VersionCompat( rOStm, StreamMode::WRITE, 2 )); rOStm.WriteUInt32( GetId() ).WriteUChar( IsThemeNameFromResource() ); // From version 2 and up @@ -1485,7 +1485,7 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) nId1 == COMPAT_FORMAT( 'G', 'A', 'L', 'R' ) && nId2 == COMPAT_FORMAT( 'E', 'S', 'R', 'V' ) ) { - boost::scoped_ptr<VersionCompat> pCompat(new VersionCompat( rIStm, STREAM_READ )); + boost::scoped_ptr<VersionCompat> pCompat(new VersionCompat( rIStm, StreamMode::READ )); sal_uInt32 nTemp32; bool bThemeNameFromResource = false; diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index f77522cadfab..4f244a40ed36 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -159,7 +159,7 @@ void NBOTypeMgrBase::ImplLoad(const OUString& filename) eCoreUnit = SFX_MAPUNIT_100TH_MM; INetURLObject aFile( SvtPathOptions().GetPalettePath() ); aFile.Append( filename); - boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ )); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); if( pIStm ) { sal_uInt32 nVersion = 0; sal_Int32 nNumIndex = 0; @@ -198,7 +198,7 @@ void NBOTypeMgrBase::ImplStore(const OUString& filename) eCoreUnit = SFX_MAPUNIT_100TH_MM; INetURLObject aFile( SvtPathOptions().GetPalettePath() ); aFile.Append( filename); - boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE )); + boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE )); if( pOStm ) { sal_uInt32 nVersion; sal_Int32 nNumIndex; diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 20c1decfc840..dfc3d10eda7c 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -1411,7 +1411,7 @@ Reference< XInputStream > SdrGrafObj::getInputStream() { memcpy( pBuffer, pSourceData, nSize ); - SvMemoryStream* pStream = new SvMemoryStream( (void*)pBuffer, (sal_Size)nSize, STREAM_READ ); + SvMemoryStream* pStream = new SvMemoryStream( (void*)pBuffer, (sal_Size)nSize, StreamMode::READ ); pStream->ObjectOwnsMemory( true ); xStream.set( new utl::OInputStreamWrapper( pStream, true ) ); } @@ -1420,7 +1420,7 @@ Reference< XInputStream > SdrGrafObj::getInputStream() if (!xStream.is() && !aFileName.isEmpty()) { - SvFileStream* pStream = new SvFileStream( aFileName, STREAM_READ ); + SvFileStream* pStream = new SvFileStream( aFileName, StreamMode::READ ); if( pStream ) xStream.set( new utl::OInputStreamWrapper( pStream ) ); } diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx index cec33f02a496..fb062df6d974 100644 --- a/svx/source/svdraw/svdotxln.cxx +++ b/svx/source/svdraw/svdotxln.cxx @@ -222,7 +222,7 @@ bool SdrTextObj::LoadText(const OUString& rFileName, const OUString& /*rFilterNa DBG_ASSERT( aFileURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ )); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); if( pIStm ) { diff --git a/svx/source/tbxctrls/Palette.cxx b/svx/source/tbxctrls/Palette.cxx index d6defe8ffbcb..125dd47741ab 100644 --- a/svx/source/tbxctrls/Palette.cxx +++ b/svx/source/tbxctrls/Palette.cxx @@ -88,7 +88,7 @@ bool PaletteGPL::ReadPaletteHeader(SvFileStream& rFileStream) void PaletteGPL::LoadPaletteHeader() { - SvFileStream aFile(maFPath, STREAM_READ); + SvFileStream aFile(maFPath, StreamMode::READ); mbValidPalette = ReadPaletteHeader( aFile ); } @@ -98,7 +98,7 @@ void PaletteGPL::LoadPalette() mbLoadedPalette = true; // TODO add error handling!!! - SvFileStream aFile(maFPath, STREAM_READ); + SvFileStream aFile(maFPath, StreamMode::READ); mbValidPalette = ReadPaletteHeader( aFile ); if( !mbValidPalette ) return; diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 3f8c7b7447e7..d7429b9727de 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1488,7 +1488,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte // normal link OUString aFilterName; const SfxFilter* pSfxFilter = NULL; - SfxMedium aSfxMedium( aURL, referer_, STREAM_READ | STREAM_SHARE_DENYNONE ); + SfxMedium aSfxMedium( aURL, referer_, StreamMode::READ | StreamMode::SHARE_DENYNONE ); SfxGetpApp()->GetFilterMatcher().GuessFilter( aSfxMedium, &pSfxFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE ); diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 033cc699c801..568d76b0e4f2 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -104,7 +104,7 @@ SvXMLGraphicInputStream::SvXMLGraphicInputStream( const OUString& rGraphicId ) if( aGrfObject.GetType() != GRAPHIC_NONE ) { - SvStream* pStm = ::utl::UcbStreamHelper::CreateStream( maTmp.GetURL(), STREAM_WRITE | STREAM_TRUNC ); + SvStream* pStm = ::utl::UcbStreamHelper::CreateStream( maTmp.GetURL(), StreamMode::WRITE | StreamMode::TRUNC ); if( pStm ) { @@ -231,7 +231,7 @@ SvXMLGraphicOutputStream::SvXMLGraphicOutputStream() : { mpTmp->EnableKillingFile(); - mpOStm = ::utl::UcbStreamHelper::CreateStream( mpTmp->GetURL(), STREAM_WRITE | STREAM_TRUNC ); + mpOStm = ::utl::UcbStreamHelper::CreateStream( mpTmp->GetURL(), StreamMode::WRITE | StreamMode::TRUNC ); if( mpOStm ) mxStmWrapper = new ::utl::OOutputStreamWrapper( *mpOStm ); diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx index 810e1eede204..d8a8c3b11e1f 100644 --- a/svx/source/xml/xmlxtexp.cxx +++ b/svx/source/xml/xmlxtexp.cxx @@ -244,7 +244,7 @@ bool SvxXMLXTableExportComponent::save( xSubStorage = ::comphelper::OStorageHelper::GetStorageFromURL( rURL, eCreate ); else { - pMedium = new SfxMedium( rURL, STREAM_WRITE | STREAM_TRUNC ); + pMedium = new SfxMedium( rURL, StreamMode::WRITE | StreamMode::TRUNC ); SvStream* pStream = pMedium->GetOutStream(); if( !pStream ) diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index 995bc189ffe7..b49c717e5747 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -388,7 +388,7 @@ bool SvxXMLXTableImport::load( const OUString &rPath, const OUString &rReferer, if( !bUseStorage || !xStorage.is() ) { - SfxMedium aMedium( rPath, rReferer, STREAM_READ | STREAM_NOCREATE ); + SfxMedium aMedium( rPath, rReferer, StreamMode::READ | StreamMode::NOCREATE ); aParserInput.sSystemId = aMedium.GetName(); if( aMedium.IsStorage() ) diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index a24689b2478d..99a92f9b4cdb 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -156,7 +156,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam } rFileName = aURL.GetMainURL(INetURLObject::NO_DECODE); - SfxMedium aMedium(aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_WRITE|STREAM_SHARE_DENYNONE|STREAM_TRUNC); + SfxMedium aMedium(aURL.GetMainURL(INetURLObject::NO_DECODE), StreamMode::WRITE|StreamMode::SHARE_DENYNONE|StreamMode::TRUNC); SvStream* pOStm = aMedium.GetOutStream(); if(pOStm) @@ -201,7 +201,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam aURL.setExtension( aExt ); rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE ); - SfxMedium aMedium(aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_WRITE | STREAM_SHARE_DENYNONE | STREAM_TRUNC); + SfxMedium aMedium(aURL.GetMainURL(INetURLObject::NO_DECODE), StreamMode::WRITE | StreamMode::SHARE_DENYNONE | StreamMode::TRUNC); SvStream* pOStm = aMedium.GetOutStream(); if( pOStm && aGfxLink.GetDataSize() && aGfxLink.GetData() ) @@ -366,7 +366,7 @@ sal_uInt16 XOutBitmap::ExportGraphic( const Graphic& rGraphic, const INetURLObje { DBG_ASSERT( rURL.GetProtocol() != INET_PROT_NOT_VALID, "XOutBitmap::ExportGraphic(...): invalid URL" ); - SfxMedium aMedium( rURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_SHARE_DENYNONE | STREAM_TRUNC ); + SfxMedium aMedium( rURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE | StreamMode::SHARE_DENYNONE | StreamMode::TRUNC ); SvStream* pOStm = aMedium.GetOutStream(); sal_uInt16 nRet = GRFILTER_IOERROR; diff --git a/svx/source/xoutdev/xexch.cxx b/svx/source/xoutdev/xexch.cxx index af794ad3028e..f363a7781d9d 100644 --- a/svx/source/xoutdev/xexch.cxx +++ b/svx/source/xoutdev/xexch.cxx @@ -66,7 +66,7 @@ SvStream& WriteXFillExchangeData( SvStream& rOStm, const XFillExchangeData& rDat { if( SfxItemState::SET == rData.pXFillAttrSetItem->GetItemSet().GetItemState( nWhich, false, &pItem ) ) { - VersionCompat aCompat( rOStm, STREAM_WRITE ); + VersionCompat aCompat( rOStm, StreamMode::WRITE ); const sal_uInt16 nItemVersion2 = pItem->GetVersion( (sal_uInt16) rOStm.GetVersion() ); rOStm.WriteUInt16( nWhich ).WriteUInt16( nItemVersion2 ); @@ -103,7 +103,7 @@ SvStream& ReadXFillExchangeData( SvStream& rIStm, XFillExchangeData& rData ) for( sal_uInt32 i = 0; i < nItemCount; i++ ) { - VersionCompat aCompat( rIStm, STREAM_READ ); + VersionCompat aCompat( rIStm, StreamMode::READ ); rIStm.ReadUInt16( nWhich ).ReadUInt16( nItemVersion ); diff --git a/svx/workben/msview/xmlconfig.cxx b/svx/workben/msview/xmlconfig.cxx index 1e06d0433a4c..4bdd057f3b88 100644 --- a/svx/workben/msview/xmlconfig.cxx +++ b/svx/workben/msview/xmlconfig.cxx @@ -304,7 +304,7 @@ void load_config( const OUString& rPath ) try { // create stream - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( rPath, STREAM_READ ); + SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( rPath, StreamMode::READ ); Reference<XInputStream> xInputStream( new utl::OInputStreamWrapper( pIStm, sal_True ) ); // prepare ParserInputSrouce diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 4a07fd04c1b8..014ec0780031 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -98,7 +98,7 @@ protected: xImporter->setTargetDocument(mxComponent); uno::Sequence<beans::PropertyValue> aDescriptor(xTextRange.is() ? 3 : 2); aDescriptor[0].Name = "InputStream"; - SvStream* pStream = utl::UcbStreamHelper::CreateStream(getURLFromSrc("/sw/qa/extras/rtfimport/data/") + aFilename, STREAM_WRITE); + SvStream* pStream = utl::UcbStreamHelper::CreateStream(getURLFromSrc("/sw/qa/extras/rtfimport/data/") + aFilename, StreamMode::WRITE); uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStream)); aDescriptor[0].Value <<= xStream; aDescriptor[1].Name = "InsertMode"; diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 4c7611c86cfb..047d0b05cb99 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -261,7 +261,7 @@ void SwUiWriterTest::testImportRTF() // Insert the RTF at the cursor position. OString aData = "{\\rtf1 Hello world!\\par}"; - SvMemoryStream aStream(const_cast<sal_Char*>(aData.getStr()), aData.getLength(), STREAM_READ); + SvMemoryStream aStream(const_cast<sal_Char*>(aData.getStr()), aData.getLength(), StreamMode::READ); SwReader aReader(aStream, OUString(), OUString(), *pWrtShell->GetCrsr()); Reader* pRTFReader = SwReaderWriter::GetReader(READER_WRITER_RTF); CPPUNIT_ASSERT(pRTFReader != 0); diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 583989166dc2..7e8953ed03e7 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -1400,7 +1400,7 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) } SvMemoryStream aStrm( (void*)aSeq.getConstArray(), aSeq.getLength(), - STREAM_READ ); + StreamMode::READ ); aStrm.Seek( 0 ); // TODO/MBA: it's impossible to set a BaseURL here! diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx index e00bef75d5fd..aae12b31e760 100644 --- a/sw/source/core/layout/dbg_lay.cxx +++ b/sw/source/core/layout/dbg_lay.cxx @@ -232,7 +232,7 @@ void SwProtocol::Init() { nRecord = 0; OUString aName("dbg_lay.go"); - SvFileStream aStream( aName, STREAM_READ ); + SvFileStream aStream( aName, StreamMode::READ ); if( aStream.IsOpen() ) { pImpl = new SwImplProtocol(); @@ -266,7 +266,7 @@ bool SwImplProtocol::NewStream() { OUString aName("dbg_lay.out"); nLineCount = 0; - pStream = new SvFileStream( aName, STREAM_WRITE | STREAM_TRUNC ); + pStream = new SvFileStream( aName, StreamMode::WRITE | StreamMode::TRUNC ); if( pStream->GetError() ) { delete pStream; @@ -391,7 +391,7 @@ void SwImplProtocol::CheckLine( OString& rLine ) void SwImplProtocol::FileInit() { OUString aName("dbg_lay.ini"); - SvFileStream aStream( aName, STREAM_READ ); + SvFileStream aStream( aName, StreamMode::READ ); if( aStream.IsOpen() ) { OString aLine; diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 9e76a2059bdb..0270960bc5fe 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -1010,7 +1010,7 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, const OUString& rURL, else pMed = xReadStorage.is() ? new SfxMedium(xReadStorage, sBaseURL, 0 ) : - new SfxMedium(sFileName, STREAM_READ, 0, 0 ); + new SfxMedium(sFileName, StreamMode::READ, 0, 0 ); if( !sBaseURL.isEmpty() ) pMed->GetItemSet()->Put( SfxStringItem( SID_DOC_BASEURL, sBaseURL ) ); @@ -1039,7 +1039,7 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, const OUString& rURL, pMed->SetFilter( pFilter ); } else - pMed = new SfxMedium(sFileName, STREAM_READ, pFilter, 0); + pMed = new SfxMedium(sFileName, StreamMode::READ, pFilter, 0); } } if(!sFilterOptions.isEmpty()) diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx index 265cfbd3efc1..3ab18d83be1f 100644 --- a/sw/source/filter/basflt/iodetect.cxx +++ b/sw/source/filter/basflt/iodetect.cxx @@ -127,7 +127,7 @@ bool SwIoSystem::IsValidStgFilter(SotStorage& rStg, const SfxFilter& rFilter) { SotStorageStreamRef xRef = rStg.OpenSotStream(OUString("WordDocument"), - STREAM_STD_READ | STREAM_NOCREATE ); + STREAM_STD_READ | StreamMode::NOCREATE ); xRef->Seek(10); sal_uInt8 nByte; xRef->ReadUChar( nByte ); diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index d01c456a288d..5065816cdff3 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -508,7 +508,7 @@ SwDoc* Reader::GetTemplateDoc() pTemplate->RemoveAllFmtLanguageDependencies(); ReadXML->SetOrganizerMode( true ); - SfxMedium aMedium( aFileName, sal_False ); + SfxMedium aMedium( aFileName, StreamMode::NONE ); SwReader aRdr( aMedium, OUString(), pTemplate ); aRdr.Read( *ReadXML ); ReadXML->SetOrganizerMode( false ); diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index d4368d298f4f..11a7d85a4606 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -1711,7 +1711,7 @@ bool SwHTMLParser::FileDownload( const OUString& rURL, SwViewShell *pOldVSh = CallEndAction(); // Ein Medium anlegen - SfxMedium aDLMedium( rURL, STREAM_READ | STREAM_SHARE_DENYWRITE ); + SfxMedium aDLMedium( rURL, StreamMode::READ | StreamMode::SHARE_DENYWRITE ); SvStream* pStream = aDLMedium.GetInStream(); if( pStream ) diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index e79dd9d8f54e..232ebcc8f01b 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -3137,14 +3137,14 @@ bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrObject *pOb //Open the ObjectPool SvStorageRef xObjPool = rWW8Wrt.GetWriter().GetStorage().OpenSotStorage( OUString(SL::aObjectPool), STREAM_READWRITE | - STREAM_SHARE_DENYALL); + StreamMode::SHARE_DENYALL); //Create a destination storage for the microsoft control OUStringBuffer sStorageName; sal_uInt32 nObjId = GenerateObjectID(); sStorageName.append('_').append( static_cast<sal_Int64>( nObjId )); SvStorageRef xOleStg = xObjPool->OpenSotStorage(sStorageName.makeStringAndClear(), - STREAM_READWRITE|STREAM_SHARE_DENYALL); + STREAM_READWRITE|StreamMode::SHARE_DENYALL); if (!xOleStg.Is()) return false; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c45b7e97c924..96dac3ba866e 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2808,7 +2808,7 @@ void WW8Export::WriteFkpPlcUsw() */ // avoid memory leak #i120098#, the unnamed obj will be released in destructor. xEscherStg = GetWriter().GetStorage().OpenSotStorage(OUString(SL::aObjectPool), - STREAM_READWRITE | STREAM_SHARE_DENYALL); + STREAM_READWRITE | StreamMode::SHARE_DENYALL); } // dggInfo - escher stream @@ -3173,11 +3173,11 @@ void WW8Export::ExportDocument_Impl() if ( bEncrypt ) { GetWriter().SetStream( - aTempMain.GetStream( STREAM_READWRITE | STREAM_SHARE_DENYWRITE ) ); + aTempMain.GetStream( STREAM_READWRITE | StreamMode::SHARE_DENYWRITE ) ); - pTableStrm = aTempTable.GetStream( STREAM_READWRITE | STREAM_SHARE_DENYWRITE ); + pTableStrm = aTempTable.GetStream( STREAM_READWRITE | StreamMode::SHARE_DENYWRITE ); - pDataStrm = aTempData.GetStream( STREAM_READWRITE | STREAM_SHARE_DENYWRITE ); + pDataStrm = aTempData.GetStream( STREAM_READWRITE | StreamMode::SHARE_DENYWRITE ); sal_uInt8 aRC4EncryptionHeader[ 52 ] = {0}; pTableStrm->Write( aRC4EncryptionHeader, 52 ); diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index fd2e5b13e7d9..eb1a1c5f151a 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -228,7 +228,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode ) SvStorageRef xObjStg = GetWriter().GetStorage().OpenSotStorage( OUString(SL::aObjectPool), STREAM_READWRITE | - STREAM_SHARE_DENYALL ); + StreamMode::SHARE_DENYALL ); if( xObjStg.Is() ) { @@ -250,7 +250,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode ) OUString sStorageName('_'); sStorageName += OUString::number( nPictureId ); SvStorageRef xOleStg = xObjStg->OpenSotStorage( sStorageName, - STREAM_READWRITE| STREAM_SHARE_DENYALL ); + STREAM_READWRITE| StreamMode::SHARE_DENYALL ); if( xOleStg.Is() ) { /* @@ -342,16 +342,16 @@ void WW8Export::OutputLinkedOLE( const OUString& rOleId ) { uno::Reference< embed::XStorage > xDocStg = pDoc->GetDocStorage(); uno::Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement( "OLELinks", embed::ElementModes::READ ); - SotStorageRef xObjSrc = SotStorage::OpenOLEStorage( xOleStg, rOleId, STREAM_READ ); + SotStorageRef xObjSrc = SotStorage::OpenOLEStorage( xOleStg, rOleId, StreamMode::READ ); SotStorageRef xObjStg = GetWriter().GetStorage().OpenSotStorage( OUString(SL::aObjectPool), STREAM_READWRITE | - STREAM_SHARE_DENYALL ); + StreamMode::SHARE_DENYALL ); if( xObjStg.Is() && xObjSrc.Is() ) { SotStorageRef xOleDst = xObjStg->OpenSotStorage( rOleId, - STREAM_READWRITE | STREAM_SHARE_DENYALL ); + STREAM_READWRITE | StreamMode::SHARE_DENYALL ); if ( xOleDst.Is() ) xObjSrc->CopyTo( xOleDst ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 9faf65520a87..b763ba5e7acf 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -579,7 +579,7 @@ SdrObject* SwMSDffManager::ImportOLE( long nOLEId, if( GetOLEStorageName( nOLEId, sStorageName, xSrcStg, xDstStg )) { SvStorageRef xSrc = xSrcStg->OpenSotStorage( sStorageName, - STREAM_READWRITE| STREAM_SHARE_DENYALL ); + STREAM_READWRITE| StreamMode::SHARE_DENYALL ); OSL_ENSURE(rReader.pFormImpl, "No Form Implementation!"); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape; if ( (!(rReader.bIsHeader || rReader.bIsFooter)) && @@ -5378,7 +5378,7 @@ sal_uLong SwWW8ImplReader::SetSubStreams(SvStorageStreamRef &rTableStream, pTableStream->SetEndian( SvStreamEndian::LITTLE ); rDataStream = pStg->OpenSotStream(OUString(SL::aData), - STREAM_STD_READ | STREAM_NOCREATE ); + STREAM_STD_READ | StreamMode::NOCREATE ); if (rDataStream.Is() && SVSTREAM_OK == rDataStream->GetError()) { @@ -5403,7 +5403,7 @@ namespace { utl::TempFile *pT = new utl::TempFile; pT->EnableKillingFile(); - rSt.Open(pT->GetFileName(), STREAM_READWRITE | STREAM_SHARE_DENYWRITE); + rSt.Open(pT->GetFileName(), STREAM_READWRITE | StreamMode::SHARE_DENYWRITE); return pT; } @@ -6029,7 +6029,7 @@ sal_uLong WW8Reader::OpenMainStream( SvStorageStreamRef& rRef, sal_uInt16& rBuff { sal_uLong nRet = ERR_SWG_READ_ERROR; OSL_ENSURE( pStg, "Where is my Storage?" ); - rRef = pStg->OpenSotStream( OUString("WordDocument"), STREAM_READ | STREAM_SHARE_DENYALL); + rRef = pStg->OpenSotStream( OUString("WordDocument"), StreamMode::READ | StreamMode::SHARE_DENYALL); if( rRef.Is() ) { diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index afa58466ef4d..02bfbb323227 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -83,7 +83,7 @@ static bool SwWw8ReadScaling(long& rX, long& rY, SvStorageRef& rSrc1) // 0x34, 0x38, 0x3c, 0x40 Crop Left, Top, Right, Bot in tw SvStorageStreamRef xSrc3 = rSrc1->OpenSotStream( OUString("\3PIC"), - STREAM_STD_READ | STREAM_NOCREATE); + STREAM_STD_READ | StreamMode::NOCREATE); SvStorageStream* pS = xSrc3; pS->SetEndian( SvStreamEndian::LITTLE ); pS->Seek( STREAM_SEEK_TO_END ); @@ -128,7 +128,7 @@ static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp, SvStorageRef& rSrc1) { SvStorageStreamRef xSrc2 = rSrc1->OpenSotStream( OUString("\3META"), - STREAM_STD_READ | STREAM_NOCREATE); + STREAM_STD_READ | StreamMode::NOCREATE); SvStorageStream* pSt = xSrc2; pSt->SetEndian( SvStreamEndian::LITTLE ); sal_uLong nRead = pSt->Read( pMfp, sizeof(*pMfp ) ); @@ -351,7 +351,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, SvStorageRef xSrc0 = pStg->OpenSotStorage(OUString(SL::aObjectPool)); SvStorageRef xSrc1 = xSrc0->OpenSotStorage( aSrcStgName, - STREAM_READWRITE| STREAM_SHARE_DENYALL ); + STREAM_READWRITE| StreamMode::SHARE_DENYALL ); if (pGrf) { @@ -425,7 +425,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, { SvStorageStreamRef xObjInfoSrc = xSrc1->OpenSotStream(OUString("\3ObjInfo"), - STREAM_STD_READ | STREAM_NOCREATE ); + STREAM_STD_READ | StreamMode::NOCREATE ); if ( xObjInfoSrc.Is() && !xObjInfoSrc->GetError() ) { sal_uInt8 nByte = 0; diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index d837c8ecfae1..44d9d11ff0d7 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -596,7 +596,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() sOleId += OUString::number( maFieldStack.back().mnObjLocFc ); SvStorageRef xSrc0 = pStg->OpenSotStorage(OUString(SL::aObjectPool)); - SvStorageRef xSrc1 = xSrc0->OpenSotStorage( sOleId, STREAM_READ ); + SvStorageRef xSrc1 = xSrc0->OpenSotStorage( sOleId, StreamMode::READ ); // Store it now! uno::Reference< embed::XStorage > xDocStg = GetDoc().GetDocStorage(); diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index b331a8ec210e..347ce0a4a5dc 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -427,7 +427,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog( if(!m_sURL.isEmpty()) { //file exists, has to be loaded here - SfxMedium aMedium( m_sURL, STREAM_READ ); + SfxMedium aMedium( m_sURL, StreamMode::READ ); SvStream* pStream = aMedium.GetInStream(); if(pStream) { @@ -629,7 +629,7 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, OkHdl_Impl) } if(!m_sURL.isEmpty()) { - SfxMedium aMedium( m_sURL, STREAM_READWRITE|STREAM_TRUNC ); + SfxMedium aMedium( m_sURL, STREAM_READWRITE|StreamMode::TRUNC ); SvStream* pStream = aMedium.GetOutStream(); pStream->SetLineDelimiter( LINEEND_LF ); pStream->SetStreamCharSet(RTL_TEXTENCODING_UTF8); diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 697eeaa542f8..4f20503a5105 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -1170,7 +1170,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) { { //read in the temporary file and use it as mail body - SfxMedium aMedium( aName.GetValue(), STREAM_READ); + SfxMedium aMedium( aName.GetValue(), StreamMode::READ); SvStream* pInStream = aMedium.GetInStream(); if(pInStream) pInStream->SetStreamCharSet( eEncoding ); diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 325ed0f2f9e5..6ee410e9f64a 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -4051,8 +4051,8 @@ IMPL_LINK_NOARG(SwAutoMarkDlg_Impl, OkHdl) if(m_pEntriesBB->IsModified() || bCreateMode) { SfxMedium aMed( sAutoMarkURL, - bCreateMode ? STREAM_WRITE - : STREAM_WRITE| STREAM_TRUNC ); + bCreateMode ? StreamMode::WRITE + : StreamMode::WRITE| StreamMode::TRUNC ); SvStream* pStrm = aMed.GetOutStream(); pStrm->SetStreamCharSet( RTL_TEXTENCODING_MS_1253 ); if( !pStrm->GetError() ) diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 9bb10f182e6b..85d77e7b29db 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1359,7 +1359,7 @@ void SwDocShell::ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcVie SubInitNew(); - SfxMedium aMed( rStreamName, STREAM_READ ); + SfxMedium aMed( rStreamName, StreamMode::READ ); // #i48748# - use class <SwReloadFromHtmlReader>, because // the base URL has to be set to the filename of the document <rMedname> // and not to the base URL of the temporary file <aMed> in order to get @@ -1554,7 +1554,7 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh, // 2. Open the file ourselves SfxMedium* pMed = new SfxMedium( aTmpObj.GetMainURL( - INetURLObject::NO_DECODE ), STREAM_READ ); + INetURLObject::NO_DECODE ), StreamMode::READ ); if( INET_PROT_FILE == aTmpObj.GetProtocol() ) pMed->Download(); // Touch the medium (download it) diff --git a/sw/source/uibase/config/uinums.cxx b/sw/source/uibase/config/uinums.cxx index 5cd64bf7578c..2dae0401b546 100644 --- a/sw/source/uibase/config/uinums.cxx +++ b/sw/source/uibase/config/uinums.cxx @@ -58,7 +58,7 @@ void SwChapterNumRules::Save() aURL.setFinalSlash(); aURL.Append(CHAPTER_FILENAME); - SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_WRITE ); + SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), StreamMode::WRITE ); SvStream* pStream = aMedium.GetOutStream(); bool bRet = (pStream && pStream->GetError() == 0); if (bRet) diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index f9204f19d86e..ddcaf6e37314 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -1209,7 +1209,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, { { //read in the temporary file and use it as mail body - SfxMedium aMedium( sFileURL, STREAM_READ); + SfxMedium aMedium( sFileURL, StreamMode::READ); SvStream* pInStream = aMedium.GetInStream(); OSL_ENSURE(pInStream, "no output file created?"); if(pInStream) diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx index cf9ae1509940..a0b53fa95dad 100644 --- a/sw/source/uibase/dochdl/gloshdl.cxx +++ b/sw/source/uibase/dochdl/gloshdl.cxx @@ -726,7 +726,7 @@ bool SwGlossaryHdl::ImportGlossaries( const OUString& rName ) if( !rName.isEmpty() ) { const SfxFilter* pFilter = 0; - boost::scoped_ptr<SfxMedium> pMed(new SfxMedium( rName, STREAM_READ, 0, 0 )); + boost::scoped_ptr<SfxMedium> pMed(new SfxMedium( rName, StreamMode::READ, 0, 0 )); SfxFilterMatcher aMatcher( OUString("swriter") ); pMed->UseInteractionHandler( true ); if (!aMatcher.GuessFilter(*pMed, &pFilter, SFX_FILTER_VERSION_NONE)) diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 3ff1a1e54b44..ea65e3f6a9b8 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -678,7 +678,7 @@ bool SwTransferable::WriteObject( SotStorageStreamRef& xStream, if ( xTransact.is() ) xTransact->commit(); - boost::scoped_ptr<SvStream> pSrcStm(::utl::UcbStreamHelper::CreateStream( aTempFile.GetURL(), STREAM_READ )); + boost::scoped_ptr<SvStream> pSrcStm(::utl::UcbStreamHelper::CreateStream( aTempFile.GetURL(), StreamMode::READ )); if( pSrcStm ) { xStream->SetBufferSize( 0xff00 ); @@ -1643,7 +1643,7 @@ bool SwTransferable::_PasteFileContent( TransferableDataHelper& rData, { pStream = new SvMemoryStream( (void*)sData.getStr(), sData.getLength() * sizeof( sal_Unicode ), - STREAM_READ ); + StreamMode::READ ); #ifdef OSL_BIGENDIAN pStream->SetEndian( SvStreamEndian::BIG ); #else diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index 276094914e42..798b58c03bdb 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -280,7 +280,7 @@ SwDocShell* SwSrcView::GetDocShell() void SwSrcView::SaveContent(const OUString& rTmpFile) { - SfxMedium aMedium( rTmpFile, STREAM_WRITE); + SfxMedium aMedium( rTmpFile, StreamMode::WRITE); SvStream* pOutStream = aMedium.GetOutStream(); pOutStream->SetStreamCharSet( lcl_GetStreamCharSet(eLoadEncoding) ); aEditWin.Write(*pOutStream); @@ -326,7 +326,7 @@ void SwSrcView::Execute(SfxRequest& rReq) if( aDlgHelper.Execute() == ERRCODE_NONE) { SfxMedium aMedium( xFP->getFiles().getConstArray()[0], - STREAM_WRITE | STREAM_SHARE_DENYNONE ); + StreamMode::WRITE | StreamMode::SHARE_DENYNONE ); SvStream* pOutStream = aMedium.GetOutStream(); pOutStream->SetStreamCharSet(lcl_GetStreamCharSet(eLoadEncoding)); aEditWin.Write( *pOutStream ); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index afe8916bb716..6451d6bd2b9a 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -2072,7 +2072,7 @@ long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUS const SfxFilter* pFilter = rFact.GetFilterContainer()->GetFilter4FilterName( rFilterName ); if ( !pFilter ) { - pMed = new SfxMedium(rFileName, STREAM_READ, 0, 0 ); + pMed = new SfxMedium(rFileName, StreamMode::READ, 0, 0 ); SfxFilterMatcher aMatcher( rFact.GetFilterContainer()->GetName() ); pMed->UseInteractionHandler( true ); ErrCode nErr = aMatcher.GuessFilter(*pMed, &pFilter, SFX_FILTER_VERSION_NONE); @@ -2082,7 +2082,7 @@ long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUS pMed->SetFilter( pFilter ); } else - pMed = new SfxMedium(rFileName, STREAM_READ, pFilter, 0); + pMed = new SfxMedium(rFileName, StreamMode::READ, pFilter, 0); } else { diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 799cf3b61490..2f6c57602194 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -414,7 +414,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf if( nSize > 0 ) { SvMemoryStream aStream (aSequence.getArray(), nSize, - STREAM_READ ); + StreamMode::READ ); aStream.Seek ( STREAM_SEEK_TO_BEGIN ); static sal_uInt16 const nRange[] = { diff --git a/test/source/htmltesttools.cxx b/test/source/htmltesttools.cxx index 6907366bb29c..274166bde855 100644 --- a/test/source/htmltesttools.cxx +++ b/test/source/htmltesttools.cxx @@ -13,7 +13,7 @@ htmlDocPtr HtmlTestTools::parseHtml(utl::TempFile& aTempFile) { - SvFileStream aFileStream(aTempFile.GetURL(), STREAM_READ); + SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ); htmlDocPtr doc = parseHtmlStream(&aFileStream); xmlFree(doc->name); doc->name = reinterpret_cast<char *>( diff --git a/test/source/mtfxmldump.cxx b/test/source/mtfxmldump.cxx index ee896581e48f..6e12524862a8 100644 --- a/test/source/mtfxmldump.cxx +++ b/test/source/mtfxmldump.cxx @@ -238,7 +238,7 @@ xmlDocPtr MetafileXmlDump::dumpAndParse(const GDIMetaFile& rMetaFile, const OUSt if (rTempStreamName.isEmpty()) pStream.reset(new SvMemoryStream()); else - pStream.reset(new SvFileStream(rTempStreamName, STREAM_STD_READWRITE | STREAM_TRUNC)); + pStream.reset(new SvFileStream(rTempStreamName, STREAM_STD_READWRITE | StreamMode::TRUNC)); XmlWriter aWriter(pStream.get()); aWriter.startDocument(); diff --git a/test/source/primitive2dxmldump.cxx b/test/source/primitive2dxmldump.cxx index 0fdf89642254..0af7c7c14c23 100644 --- a/test/source/primitive2dxmldump.cxx +++ b/test/source/primitive2dxmldump.cxx @@ -68,7 +68,7 @@ xmlDocPtr Primitive2dXmlDump::dumpAndParse( if (rTempStreamName.isEmpty()) pStream.reset(new SvMemoryStream()); else - pStream.reset(new SvFileStream(rTempStreamName, STREAM_STD_READWRITE | STREAM_TRUNC)); + pStream.reset(new SvFileStream(rTempStreamName, STREAM_STD_READWRITE | StreamMode::TRUNC)); XmlWriter aWriter(pStream.get()); aWriter.startDocument(); diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index 4694570226b6..749e87e89cf2 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -36,7 +36,7 @@ XmlTestTools::~XmlTestTools() xmlDocPtr XmlTestTools::parseXml(utl::TempFile& aTempFile) { - SvFileStream aFileStream(aTempFile.GetURL(), STREAM_READ); + SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ); return parseXmlStream(&aFileStream); } diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx index 32e2c20f6096..f62d53558c01 100644 --- a/toolkit/source/awt/vclxprinter.cxx +++ b/toolkit/source/awt/vclxprinter.cxx @@ -250,7 +250,7 @@ void VCLXPrinterPropertySet::setBinarySetup( const ::com::sun::star::uno::Sequen { ::osl::MutexGuard aGuard( Mutex ); - SvMemoryStream aMem( (char*) data.getConstArray(), data.getLength(), STREAM_READ ); + SvMemoryStream aMem( (char*) data.getConstArray(), data.getLength(), StreamMode::READ ); sal_uInt32 nMarker; aMem.ReadUInt32( nMarker ); DBG_ASSERT( nMarker == BINARYSETUPMARKER, "setBinarySetup - invalid!" ); diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx index f8ab1e11f402..33e78de1c845 100644 --- a/toolkit/source/helper/vclunohelper.cxx +++ b/toolkit/source/helper/vclunohelper.cxx @@ -87,12 +87,12 @@ BitmapEx VCLUnoHelper::GetBitmap( const ::com::sun::star::uno::Reference< ::com: Bitmap aDIB, aMask; { ::com::sun::star::uno::Sequence<sal_Int8> aBytes = rxBitmap->getDIB(); - SvMemoryStream aMem( (char*) aBytes.getArray(), aBytes.getLength(), STREAM_READ ); + SvMemoryStream aMem( (char*) aBytes.getArray(), aBytes.getLength(), StreamMode::READ ); ReadDIB(aDIB, aMem, true); } { ::com::sun::star::uno::Sequence<sal_Int8> aBytes = rxBitmap->getMaskDIB(); - SvMemoryStream aMem( (char*) aBytes.getArray(), aBytes.getLength(), STREAM_READ ); + SvMemoryStream aMem( (char*) aBytes.getArray(), aBytes.getLength(), StreamMode::READ ); ReadDIB(aMask, aMem, true); } aBmp = BitmapEx( aDIB, aMask ); diff --git a/tools/qa/cppunit/test_stream.cxx b/tools/qa/cppunit/test_stream.cxx index 5c9d8fdc6ac8..6704548a92d2 100644 --- a/tools/qa/cppunit/test_stream.cxx +++ b/tools/qa/cppunit/test_stream.cxx @@ -42,7 +42,7 @@ namespace { char foo[] = "foo"; std::istringstream iss(foo, std::istringstream::in); - SvMemoryStream aMemStream(foo, SAL_N_ELEMENTS(foo)-1, STREAM_READ); + SvMemoryStream aMemStream(foo, SAL_N_ELEMENTS(foo)-1, StreamMode::READ); char std_a(78); iss >> std_a; @@ -133,7 +133,7 @@ namespace void Test::test_fastostring() { char foo[] = "foobar"; - SvMemoryStream aMemStream(foo, SAL_N_ELEMENTS(foo)-1, STREAM_READ); + SvMemoryStream aMemStream(foo, SAL_N_ELEMENTS(foo)-1, StreamMode::READ); OString aOne = read_uInt8s_ToOString(aMemStream, 3); CPPUNIT_ASSERT(aOne == "foo"); @@ -153,7 +153,7 @@ namespace void Test::test_read_cstring() { char foo[] = "foobar"; - SvMemoryStream aMemStream(foo, SAL_N_ELEMENTS(foo)-1, STREAM_READ); + SvMemoryStream aMemStream(foo, SAL_N_ELEMENTS(foo)-1, StreamMode::READ); OString aOne = read_zeroTerminated_uInt8s_ToOString(aMemStream); CPPUNIT_ASSERT(aOne == "foobar"); @@ -171,7 +171,7 @@ namespace void Test::test_read_pstring() { char foo[] = "\3foobar"; - SvMemoryStream aMemStream(foo, SAL_N_ELEMENTS(foo)-1, STREAM_READ); + SvMemoryStream aMemStream(foo, SAL_N_ELEMENTS(foo)-1, StreamMode::READ); OString aFoo = read_uInt8_lenPrefixed_uInt8s_ToOString(aMemStream); CPPUNIT_ASSERT(aFoo == "foo"); @@ -213,7 +213,7 @@ namespace void Test::test_readline() { char foo[] = "foo\nbar\n\n"; - SvMemoryStream aMemStream(foo, SAL_N_ELEMENTS(foo)-1, STREAM_READ); + SvMemoryStream aMemStream(foo, SAL_N_ELEMENTS(foo)-1, StreamMode::READ); OString aFoo; bool bRet; @@ -272,7 +272,7 @@ namespace CPPUNIT_ASSERT(iss.eof() && !iss.bad()); char bar[] = "foo"; - SvMemoryStream aMemStreamB(bar, SAL_N_ELEMENTS(bar)-1, STREAM_READ); + SvMemoryStream aMemStreamB(bar, SAL_N_ELEMENTS(bar)-1, StreamMode::READ); bRet = aMemStreamB.ReadLine(aFoo); CPPUNIT_ASSERT(bRet); CPPUNIT_ASSERT(aFoo == "foo"); diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index e9c8e0bb9a1d..1d3797c05df3 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -590,7 +590,7 @@ std::unique_ptr<SvMemoryStream> memoryStream( new char[length]); memcpy(b.get(), data, length); std::unique_ptr<SvMemoryStream> s( - new SvMemoryStream(b.get(), length, STREAM_READ)); + new SvMemoryStream(b.get(), length, StreamMode::READ)); s->ObjectOwnsMemory(true); b.release(); return s; diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index c1eb8b57efcb..eb3859a1bddd 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -1633,7 +1633,7 @@ void Polygon::ImplRead( SvStream& rIStream ) void Polygon::Read( SvStream& rIStream ) { - VersionCompat aCompat( rIStream, STREAM_READ ); + VersionCompat aCompat( rIStream, StreamMode::READ ); ImplRead( rIStream ); } @@ -1650,7 +1650,7 @@ void Polygon::ImplWrite( SvStream& rOStream ) const void Polygon::Write( SvStream& rOStream ) const { - VersionCompat aCompat( rOStream, STREAM_WRITE, 1 ); + VersionCompat aCompat( rOStream, StreamMode::WRITE, 1 ); ImplWrite( rOStream ); } diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx index 693c2eca6f2e..eec33a2624b0 100644 --- a/tools/source/generic/poly2.cxx +++ b/tools/source/generic/poly2.cxx @@ -617,7 +617,7 @@ SvStream& WritePolyPolygon( SvStream& rOStream, const tools::PolyPolygon& rPolyP void PolyPolygon::Read( SvStream& rIStream ) { - VersionCompat aCompat( rIStream, STREAM_READ ); + VersionCompat aCompat( rIStream, StreamMode::READ ); DBG_ASSERTWARNING( rIStream.GetVersion(), "PolyPolygon::>> - Solar-Version not set on rIStream" ); @@ -649,7 +649,7 @@ void PolyPolygon::Read( SvStream& rIStream ) void PolyPolygon::Write( SvStream& rOStream ) const { - VersionCompat aCompat( rOStream, STREAM_WRITE, 1 ); + VersionCompat aCompat( rOStream, StreamMode::WRITE, 1 ); DBG_ASSERTWARNING( rOStream.GetVersion(), "PolyPolygon::<< - Solar-Version not set on rOStream" ); diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx index a5a1d2c96a1c..5cf16607f6c0 100644 --- a/tools/source/rc/resmgr.cxx +++ b/tools/source/rc/resmgr.cxx @@ -448,7 +448,7 @@ InternalResMgr::~InternalResMgr() const sal_Char* pLogFile = getenv( "STAR_RESOURCE_LOGGING" ); if ( pLogFile ) { - SvFileStream aStm( OUString::createFromAscii( pLogFile ), STREAM_WRITE ); + SvFileStream aStm( OUString::createFromAscii( pLogFile ), StreamMode::WRITE ); aStm.Seek( STREAM_SEEK_TO_END ); OStringBuffer aLine("FileName: "); aLine.append(OUStringToOString(aFileName, @@ -477,7 +477,7 @@ bool InternalResMgr::Create() ResMgrContainer::get(); bool bDone = false; - pStm = new SvFileStream( aFileName, (STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE) ); + pStm = new SvFileStream( aFileName, StreamMode::READ | StreamMode::SHARE_DENYWRITE | StreamMode::NOCREATE ); if( pStm->GetError() == 0 ) { sal_Int32 lContLen = 0; diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 7c5deacb4807..4287fb7a88e0 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -404,7 +404,7 @@ void SvStream::ImpInit() bIoWrite = false; nBufFree = 0; - eStreamMode = 0; + eStreamMode = StreamMode::NONE; nVersion = 0; @@ -1678,7 +1678,7 @@ SvStream& endlub( SvStream& rStrm ) SvMemoryStream::SvMemoryStream( void* pBuffer, sal_Size bufSize, StreamMode eMode ) { - if( eMode & STREAM_WRITE ) + if( eMode & StreamMode::WRITE ) bIsWritable = true; else bIsWritable = false; diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index a10ea4523eae..20b8febe19b6 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -118,13 +118,13 @@ bool lockFile( sal_Size nStart, sal_Size nEnd, SvFileStream* pStream ) StreamMode nLockMode = i->m_pStream->GetStreamMode(); StreamMode nNewMode = pStream->GetStreamMode(); - if( nLockMode & STREAM_SHARE_DENYALL ) + if( nLockMode & StreamMode::SHARE_DENYALL ) bDenyByOptions = true; - else if( ( nLockMode & STREAM_SHARE_DENYWRITE ) && - ( nNewMode & STREAM_WRITE ) ) + else if( ( nLockMode & StreamMode::SHARE_DENYWRITE ) && + ( nNewMode & StreamMode::WRITE ) ) bDenyByOptions = true; - else if( ( nLockMode & STREAM_SHARE_DENYREAD ) && - ( nNewMode & STREAM_READ ) ) + else if( ( nLockMode &StreamMode::SHARE_DENYREAD ) && + ( nNewMode & StreamMode::READ ) ) bDenyByOptions = true; if( bDenyByOptions ) @@ -392,7 +392,7 @@ bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes ) if ( ! IsOpen() ) return false; - if ( eStreamMode & STREAM_SHARE_DENYALL ) + if ( eStreamMode & StreamMode::SHARE_DENYALL ) { if (bIsWritable) nLockMode = F_WRLCK; @@ -400,7 +400,7 @@ bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes ) nLockMode = F_RDLCK; } - if ( eStreamMode & STREAM_SHARE_DENYREAD ) + if ( eStreamMode & StreamMode::SHARE_DENYREAD ) { if (bIsWritable) nLockMode = F_WRLCK; @@ -411,7 +411,7 @@ bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes ) } } - if ( eStreamMode & STREAM_SHARE_DENYWRITE ) + if ( eStreamMode & StreamMode::SHARE_DENYWRITE ) { if (bIsWritable) nLockMode = F_WRLCK; @@ -462,7 +462,7 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nOpenMode ) Close(); errno = 0; eStreamMode = nOpenMode; - eStreamMode &= ~STREAM_TRUNC; // don't truncat on reopen + eStreamMode &= ~StreamMode::TRUNC; // don't truncat on reopen aFilename = rFilename; @@ -490,25 +490,25 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nOpenMode ) return; } - if ( !( nOpenMode & STREAM_WRITE ) ) + if ( !( nOpenMode & StreamMode::WRITE ) ) uFlags = osl_File_OpenFlag_Read; - else if ( !( nOpenMode & STREAM_READ ) ) + else if ( !( nOpenMode & StreamMode::READ ) ) uFlags = osl_File_OpenFlag_Write; else uFlags = osl_File_OpenFlag_Read | osl_File_OpenFlag_Write; // Fix (MDA, 18.01.95): Don't open with O_CREAT upon RD_ONLY // Important for Read-Only-Filesystems (e.g, CDROM) - if ( (!( nOpenMode & STREAM_NOCREATE )) && ( uFlags != osl_File_OpenFlag_Read ) ) + if ( (!( nOpenMode & StreamMode::NOCREATE )) && ( uFlags != osl_File_OpenFlag_Read ) ) uFlags |= osl_File_OpenFlag_Create; - if ( nOpenMode & STREAM_TRUNC ) + if ( nOpenMode & StreamMode::TRUNC ) uFlags |= osl_File_OpenFlag_Trunc; uFlags |= osl_File_OpenFlag_NoExcl | osl_File_OpenFlag_NoLock; - if ( nOpenMode & STREAM_WRITE) + if ( nOpenMode & StreamMode::WRITE) { - if ( nOpenMode & STREAM_COPY_ON_SYMLINK ) + if ( nOpenMode & StreamMode::COPY_ON_SYMLINK ) { if ( bStatValid && aStatus.getFileType() == osl::FileStatus::Link && aStatus.getLinkTargetURL().getLength() > 0 ) diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx index 8989921effcf..886724d95483 100644 --- a/tools/source/stream/strmwnt.cxx +++ b/tools/source/stream/strmwnt.cxx @@ -295,7 +295,7 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nMode ) if( nMode & STREAM_SHARE_DENYALL) nShareMode = 0; - if( (nMode & STREAM_READ) ) + if( (nMode & StreamMode::READ) ) nAccessMode |= GENERIC_READ; if( (nMode & STREAM_WRITE) ) nAccessMode |= GENERIC_WRITE; @@ -306,14 +306,14 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nMode ) // Assignment based on true/false table above if( !(nMode & STREAM_NOCREATE) ) { - if( nMode & STREAM_TRUNC ) + if( nMode & StreamMode::TRUNC ) nOpenAction = CREATE_ALWAYS; else nOpenAction = OPEN_ALWAYS; } else { - if( nMode & STREAM_TRUNC ) + if( nMode & StreamMode::TRUNC ) nOpenAction = TRUNCATE_EXISTING; else nOpenAction = OPEN_EXISTING; diff --git a/tools/source/stream/vcompat.cxx b/tools/source/stream/vcompat.cxx index afd3fe545195..490fc6f6c746 100644 --- a/tools/source/stream/vcompat.cxx +++ b/tools/source/stream/vcompat.cxx @@ -20,7 +20,7 @@ #include <tools/stream.hxx> #include <tools/vcompat.hxx> -VersionCompat::VersionCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion ) : +VersionCompat::VersionCompat( SvStream& rStm, StreamMode nStreamMode, sal_uInt16 nVersion ) : mpRWStm ( &rStm ), mnCompatPos ( 0 ), mnTotalSize ( 0 ), @@ -29,7 +29,7 @@ VersionCompat::VersionCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 { if( !mpRWStm->GetError() ) { - if( STREAM_WRITE == mnStmMode ) + if( StreamMode::WRITE == mnStmMode ) { mpRWStm->WriteUInt16( mnVersion ); mnTotalSize = ( mnCompatPos = mpRWStm->Tell() ) + 4UL; @@ -46,7 +46,7 @@ VersionCompat::VersionCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 VersionCompat::~VersionCompat() { - if( STREAM_WRITE == mnStmMode ) + if( StreamMode::WRITE == mnStmMode ) { const sal_uInt32 nEndPos = mpRWStm->Tell(); diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 3ad492e24fba..70b4259d4bc4 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -379,7 +379,7 @@ SvStream* TempFile::GetStream( StreamMode eMode ) if ( !GetURL().isEmpty() ) pStream = UcbStreamHelper::CreateStream( aURL, eMode, true /* bFileExists */ ); else - pStream = new SvMemoryStream( eMode ); + pStream = new SvMemoryStream( NULL, 0, eMode ); } return pStream; diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index b91d53f06175..fa6a7668ba21 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1558,7 +1558,7 @@ UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference < XContent >& xCo UcbLockBytesRef xLockBytes = new UcbLockBytes( pHandler ); xLockBytes->SetSynchronMode( !pHandler ); Reference< XActiveDataControl > xSink; - if ( eOpenMode & STREAM_WRITE ) + if ( eOpenMode & StreamMode::WRITE ) xSink = (XActiveDataControl*) new UcbStreamer_Impl( xLockBytes ); else xSink = (XActiveDataControl*) new UcbDataSink_Impl( xLockBytes ); diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx b/unotools/source/ucbhelper/ucbstreamhelper.cxx index aa8f12dcd58f..fc3d31c9ee7b 100644 --- a/unotools/source/ucbhelper/ucbstreamhelper.cxx +++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx @@ -49,9 +49,9 @@ static SvStream* lcl_CreateStream( const OUString& rFileName, StreamMode eOpenMo UniversalContentBroker::create( comphelper::getProcessComponentContext() ) ); UcbLockBytesRef xLockBytes; - if ( eOpenMode & STREAM_WRITE ) + if ( eOpenMode & StreamMode::WRITE ) { - bool bTruncate = ( eOpenMode & STREAM_TRUNC ) != 0; + bool bTruncate = bool( eOpenMode & StreamMode::TRUNC ); if ( bTruncate ) { try diff --git a/vcl/generic/fontmanager/fontcache.cxx b/vcl/generic/fontmanager/fontcache.cxx index 8a0f809ff5d9..56a15bfdfef0 100644 --- a/vcl/generic/fontmanager/fontcache.cxx +++ b/vcl/generic/fontmanager/fontcache.cxx @@ -94,7 +94,7 @@ void FontCache::flush() return; SvFileStream aStream; - aStream.Open( m_aCacheFile, STREAM_WRITE | STREAM_TRUNC ); + aStream.Open( m_aCacheFile, StreamMode::WRITE | StreamMode::TRUNC ); if( ! (aStream.IsOpen() && aStream.IsWritable()) ) { #if OSL_DEBUG_LEVEL > 1 @@ -236,7 +236,7 @@ void FontCache::read() PrintFontManager& rManager( PrintFontManager::get() ); MultiAtomProvider* pAtoms = rManager.m_pAtoms; - SvFileStream aStream( m_aCacheFile, STREAM_READ ); + SvFileStream aStream( m_aCacheFile, StreamMode::READ ); if( ! aStream.IsOpen() ) { #if OSL_DEBUG_LEVEL > 1 diff --git a/vcl/generic/print/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx index fbf7ba6f000d..cc7c4d992f9c 100644 --- a/vcl/generic/print/common_gfx.cxx +++ b/vcl/generic/print/common_gfx.cxx @@ -1135,7 +1135,7 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize bool bSuccess = false; // first search the BoundingBox of the EPS data - SvMemoryStream aStream( pPtr, nSize, STREAM_READ ); + SvMemoryStream aStream( pPtr, nSize, StreamMode::READ ); aStream.Seek( STREAM_SEEK_TO_BEGIN ); OString aLine; diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx index 0b04dbf0e9ef..128010854289 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx @@ -55,7 +55,7 @@ bool VclFiltersTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { - SvFileStream aFileStream(rURL, STREAM_READ); + SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; return mGraphicFilter.ImportGraphic(aGraphic, rURL, aFileStream) == 0; } diff --git a/vcl/qa/cppunit/wmf/wmfimporttest.cxx b/vcl/qa/cppunit/wmf/wmfimporttest.cxx index 6e2e374fa7cb..f0d192c41a03 100644 --- a/vcl/qa/cppunit/wmf/wmfimporttest.cxx +++ b/vcl/qa/cppunit/wmf/wmfimporttest.cxx @@ -56,7 +56,7 @@ public: void WmfTest::testNonPlaceableWmf() { - SvFileStream aFileStream(getFullUrl("visio_import_source.wmf"), STREAM_READ); + SvFileStream aFileStream(getFullUrl("visio_import_source.wmf"), StreamMode::READ); GDIMetaFile aGDIMetaFile; ReadWindowMetafile(aFileStream, aGDIMetaFile); @@ -85,7 +85,7 @@ void WmfTest::testNonPlaceableWmf() void WmfTest::testSine() { - SvFileStream aFileStream(getFullUrl("sine_wave.emf"), STREAM_READ); + SvFileStream aFileStream(getFullUrl("sine_wave.emf"), StreamMode::READ); GDIMetaFile aGDIMetaFile; ReadWindowMetafile(aFileStream, aGDIMetaFile); @@ -109,7 +109,7 @@ void WmfTest::testSine() void WmfTest::testEmfProblem() { - SvFileStream aFileStream(getFullUrl("computer_mail.emf"), STREAM_READ); + SvFileStream aFileStream(getFullUrl("computer_mail.emf"), StreamMode::READ); GDIMetaFile aGDIMetaFile; ReadWindowMetafile(aFileStream, aGDIMetaFile); @@ -128,7 +128,7 @@ void WmfTest::testEmfProblem() void WmfTest::testWorldTransformFontSize() { - SvFileStream aFileStream(getFullUrl("image1.emf"), STREAM_READ); + SvFileStream aFileStream(getFullUrl("image1.emf"), StreamMode::READ); GDIMetaFile aGDIMetaFile; ReadWindowMetafile(aFileStream, aGDIMetaFile); diff --git a/vcl/source/filter/GraphicNativeMetadata.cxx b/vcl/source/filter/GraphicNativeMetadata.cxx index beb6787255f4..6503774a34b6 100644 --- a/vcl/source/filter/GraphicNativeMetadata.cxx +++ b/vcl/source/filter/GraphicNativeMetadata.cxx @@ -41,7 +41,7 @@ bool GraphicNativeMetadata::read(Graphic& rGraphic) boost::scoped_array<sal_uInt8> aBuffer(new sal_uInt8[aDataSize]); memcpy(aBuffer.get(), aLink.GetData(), aDataSize); - SvMemoryStream aMemoryStream(aBuffer.get(), aDataSize, STREAM_READ); + SvMemoryStream aMemoryStream(aBuffer.get(), aDataSize, StreamMode::READ); Exif aExif; aExif.read(aMemoryStream); diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index cff0fed318ba..0a3c6be29298 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1281,7 +1281,7 @@ sal_uInt16 GraphicFilter::CanImportGraphic( const INetURLObject& rPath, DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::CanImportGraphic() : ProtType == INET_PROT_NOT_VALID" ); OUString aMainUrl( rPath.GetMainURL( INetURLObject::NO_DECODE ) ); - boost::scoped_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( aMainUrl, STREAM_READ | STREAM_SHARE_DENYNONE )); + boost::scoped_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( aMainUrl, StreamMode::READ | StreamMode::SHARE_DENYNONE )); if ( pStream ) { nRetValue = CanImportGraphic( aMainUrl, *pStream, nFormat, pDeterminedFormat ); @@ -1311,7 +1311,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ImportGraphic() : ProtType == INET_PROT_NOT_VALID" ); OUString aMainUrl( rPath.GetMainURL( INetURLObject::NO_DECODE ) ); - boost::scoped_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( aMainUrl, STREAM_READ | STREAM_SHARE_DENYNONE )); + boost::scoped_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( aMainUrl, StreamMode::READ | StreamMode::SHARE_DENYNONE )); if ( pStream ) { nRetValue = ImportGraphic( rGraphic, aMainUrl, *pStream, nFormat, pDeterminedFormat, nImportFlags ); @@ -1463,7 +1463,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat if ( nChunkSize > 11 ) { const std::vector< sal_uInt8 >& rData = aIter->aData; - SvMemoryStream aIStrm( (void*)&rData[ 11 ], nChunkSize - 11, STREAM_READ ); + SvMemoryStream aIStrm( (void*)&rData[ 11 ], nChunkSize - 11, StreamMode::READ ); ImportGIF( aIStrm, rGraphic ); eLinkType = GFX_LINK_TYPE_NATIVE_PNG; break; @@ -1804,7 +1804,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLO bool bAlreadyExists = DirEntryExists( rPath ); OUString aMainUrl( rPath.GetMainURL( INetURLObject::NO_DECODE ) ); - boost::scoped_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( aMainUrl, STREAM_WRITE | STREAM_TRUNC )); + boost::scoped_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( aMainUrl, StreamMode::WRITE | StreamMode::TRUNC )); if ( pStream ) { nRetValue = ExportGraphic( rGraphic, aMainUrl, *pStream, nFormat, pFilterData ); @@ -2257,7 +2257,7 @@ int GraphicFilter::LoadGraphic( const OUString &rPath, const OUString &rFilterNa SvStream* pStream = NULL; if ( INET_PROT_FILE != aURL.GetProtocol() ) { - pStream = ::utl::UcbStreamHelper::CreateStream( rPath, STREAM_READ ); + pStream = ::utl::UcbStreamHelper::CreateStream( rPath, StreamMode::READ ); } int nRes = GRFILTER_OK; diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index 2752eebb1ba3..1d55f8c51956 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -29,7 +29,7 @@ #define DATA_SIZE 640 GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) : - pFileStm( ::utl::UcbStreamHelper::CreateStream( rPath.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ) ), + pFileStm( ::utl::UcbStreamHelper::CreateStream( rPath.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ) ), aPathExt( rPath.GetFileExtension().toAsciiLowerCase() ), bOwnStream( true ) { diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx index 18c51f356ac0..956b8c049f2d 100644 --- a/vcl/source/filter/sgvmain.cxx +++ b/vcl/source/filter/sgvmain.cxx @@ -653,7 +653,7 @@ void BmapType::Draw(OutputDevice& rOut) (sal_Int32)Filename[ 0 ], RTL_TEXTENCODING_UTF8 ); INetURLObject aFNam( aStr ); - SvStream* pInp = ::utl::UcbStreamHelper::CreateStream( aFNam.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); + SvStream* pInp = ::utl::UcbStreamHelper::CreateStream( aFNam.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ); if ( pInp ) { nSgfTyp=CheckSgfTyp( *pInp,nVersion); diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index 290437c8f9f4..eaf080e4678c 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -413,7 +413,7 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, bool& bHaveDC) // debug code - write the stream to debug file /tmp/emf-stream.emf int pos = pWMF->Tell(); pWMF->Seek(0); - SvFileStream file( OUString( "/tmp/emf-stream.emf" ), STREAM_WRITE | STREAM_TRUNC ); + SvFileStream file( OUString( "/tmp/emf-stream.emf" ), StreamMode::WRITE | StreamMode::TRUNC ); pWMF->WriteStream(file); file.Flush(); @@ -1189,7 +1189,7 @@ bool EnhWMFReader::ReadEnhWMF() if ( nSize <= ( nEndPos - nStartPos ) ) { char* pBuf = new char[ nSize ]; - SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE ); + SvMemoryStream aTmp( pBuf, nSize, StreamMode::READ | StreamMode::WRITE ); aTmp.ObjectOwnsMemory( true ); aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) @@ -1253,7 +1253,7 @@ bool EnhWMFReader::ReadEnhWMF() if ( nSize <= ( nEndPos - nStartPos ) ) { char* pBuf = new char[ nSize ]; - SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE ); + SvMemoryStream aTmp( pBuf, nSize, StreamMode::READ | StreamMode::WRITE ); aTmp.ObjectOwnsMemory( true ); aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) @@ -1323,7 +1323,7 @@ bool EnhWMFReader::ReadEnhWMF() if ( nSize <= ( nEndPos - nStartPos ) ) { char* pBuf = new char[ nSize ]; - SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE ); + SvMemoryStream aTmp( pBuf, nSize, StreamMode::READ | StreamMode::WRITE ); aTmp.ObjectOwnsMemory( true ); aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) @@ -1563,7 +1563,7 @@ bool EnhWMFReader::ReadEnhWMF() { char* pBuf = new char[ nSize ]; - SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE ); + SvMemoryStream aTmp( pBuf, nSize, StreamMode::READ | StreamMode::WRITE ); aTmp.ObjectOwnsMemory( true ); aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx index 81270c0adb4f..c9e53e25b703 100644 --- a/vcl/source/gdi/font.cxx +++ b/vcl/source/gdi/font.cxx @@ -657,7 +657,7 @@ void Font::GetFontAttributes( ImplFontAttributes& rAttrs ) const SvStream& ReadImpl_Font( SvStream& rIStm, Impl_Font& rImpl_Font ) { - VersionCompat aCompat( rIStm, STREAM_READ ); + VersionCompat aCompat( rIStm, StreamMode::READ ); sal_uInt16 nTmp16; bool bTmp; sal_uInt8 nTmp8; @@ -702,7 +702,7 @@ SvStream& ReadImpl_Font( SvStream& rIStm, Impl_Font& rImpl_Font ) SvStream& WriteImpl_Font( SvStream& rOStm, const Impl_Font& rImpl_Font ) { - VersionCompat aCompat( rOStm, STREAM_WRITE, 3 ); + VersionCompat aCompat( rOStm, StreamMode::WRITE, 3 ); rOStm.WriteUniOrByteString( rImpl_Font.maFamilyName, rOStm.GetStreamCharSet() ); rOStm.WriteUniOrByteString( rImpl_Font.maStyleName, rOStm.GetStreamCharSet() ); WritePair( rOStm, rImpl_Font.maSize ); diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx index e58fb0c2dadb..3fa559a6abb8 100644 --- a/vcl/source/gdi/gdimetafiletools.cxx +++ b/vcl/source/gdi/gdimetafiletools.cxx @@ -875,7 +875,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) tools::PolyPolygon aPath; { // read SvtGraphicFill - SvMemoryStream aMemStm((void*)pA->GetData(), pA->GetDataSize(),STREAM_READ); + SvMemoryStream aMemStm((void*)pA->GetData(), pA->GetDataSize(),StreamMode::READ); ReadSvtGraphicFill( aMemStm, aFilling ); } @@ -916,7 +916,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) Polygon aPath; { // read SvtGraphicFill - SvMemoryStream aMemStm((void*)pA->GetData(), pA->GetDataSize(),STREAM_READ); + SvMemoryStream aMemStm((void*)pA->GetData(), pA->GetDataSize(),StreamMode::READ); ReadSvtGraphicStroke( aMemStm, aStroke ); } diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 1a49cdcd6892..3a6159ec9313 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -1196,7 +1196,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) { if ( pCommentAct->GetDataSize() ) { - SvMemoryStream aMemStm( (void*)pCommentAct->GetData(), pCommentAct->GetDataSize(), STREAM_READ ); + SvMemoryStream aMemStm( (void*)pCommentAct->GetData(), pCommentAct->GetDataSize(), StreamMode::READ ); SvMemoryStream aDest; if ( bPathStroke ) { @@ -2763,7 +2763,7 @@ SvStream& ReadGDIMetaFile( SvStream& rIStm, GDIMetaFile& rGDIMetaFile ) sal_uInt32 nStmCompressMode = 0; sal_uInt32 nCount = 0; - pCompat = new VersionCompat( rIStm, STREAM_READ ); + pCompat = new VersionCompat( rIStm, StreamMode::READ ); rIStm.ReadUInt32( nStmCompressMode ); ReadMapMode( rIStm, rGDIMetaFile.aPrefMapMode ); @@ -2862,7 +2862,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm ) rOStm.SetEndian( SvStreamEndian::LITTLE ); rOStm.Write( "VCLMTF", 6 ); - pCompat = new VersionCompat( rOStm, STREAM_WRITE, 1 ); + pCompat = new VersionCompat( rOStm, StreamMode::WRITE, 1 ); rOStm.WriteUInt32( nStmCompressMode ); WriteMapMode( rOStm, aPrefMapMode ); diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 575a28488644..1c825bf09cc8 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -251,7 +251,7 @@ bool GfxLink::ExportNative( SvStream& rOStream ) const SvStream& WriteGfxLink( SvStream& rOStream, const GfxLink& rGfxLink ) { - VersionCompat* pCompat = new VersionCompat( rOStream, STREAM_WRITE, 2 ); + VersionCompat* pCompat = new VersionCompat( rOStream, StreamMode::WRITE, 2 ); // Version 1 rOStream.WriteUInt16( rGfxLink.GetType() ).WriteUInt32( rGfxLink.GetDataSize() ).WriteUInt32( rGfxLink.GetUserId() ); @@ -282,7 +282,7 @@ SvStream& ReadGfxLink( SvStream& rIStream, GfxLink& rGfxLink) sal_uInt16 nType; sal_uInt8* pBuf; bool bMapAndSizeValid( false ); - VersionCompat* pCompat = new VersionCompat( rIStream, STREAM_READ ); + VersionCompat* pCompat = new VersionCompat( rIStream, StreamMode::READ ); // Version 1 rIStream.ReadUInt16( nType ).ReadUInt32( nSize ).ReadUInt32( nUserId ); @@ -322,7 +322,7 @@ ImpSwap::ImpSwap( sal_uInt8* pData, sal_uLong nDataSize ) : maURL = aTempFile.GetURL(); if( !maURL.isEmpty() ) { - boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE | STREAM_SHARE_DENYWRITE )); + boost::scoped_ptr<SvStream> pOStm(::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE | StreamMode::SHARE_DENYWRITE )); if( pOStm ) { pOStm->Write( pData, mnDataSize ); diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx index 04fcea7a7c81..b8bca2ea5c6c 100644 --- a/vcl/source/gdi/gradient.cxx +++ b/vcl/source/gdi/gradient.cxx @@ -287,7 +287,7 @@ bool Gradient::operator==( const Gradient& rGradient ) const SvStream& ReadImpl_Gradient( SvStream& rIStm, Impl_Gradient& rImpl_Gradient ) { - VersionCompat aCompat( rIStm, STREAM_READ ); + VersionCompat aCompat( rIStm, StreamMode::READ ); sal_uInt16 nTmp16; rIStm.ReadUInt16( nTmp16 ); rImpl_Gradient.meStyle = (GradientStyle) nTmp16; @@ -301,7 +301,7 @@ SvStream& ReadImpl_Gradient( SvStream& rIStm, Impl_Gradient& rImpl_Gradient ) SvStream& WriteImpl_Gradient( SvStream& rOStm, const Impl_Gradient& rImpl_Gradient ) { - VersionCompat aCompat( rOStm, STREAM_WRITE, 1 ); + VersionCompat aCompat( rOStm, StreamMode::WRITE, 1 ); rOStm.WriteUInt16( rImpl_Gradient.meStyle ); WriteColor( rOStm, rImpl_Gradient.maStartColor ); diff --git a/vcl/source/gdi/graphictools.cxx b/vcl/source/gdi/graphictools.cxx index 9a53bb638368..8dfc8f3e2a5f 100644 --- a/vcl/source/gdi/graphictools.cxx +++ b/vcl/source/gdi/graphictools.cxx @@ -116,7 +116,7 @@ void SvtGraphicStroke::scale( double fXScale, double fYScale ) SvStream& WriteSvtGraphicStroke( SvStream& rOStm, const SvtGraphicStroke& rClass ) { - VersionCompat aCompat( rOStm, STREAM_WRITE, 1 ); + VersionCompat aCompat( rOStm, StreamMode::WRITE, 1 ); rClass.maPath.Write( rOStm ); rClass.maStartArrow.Write( rOStm ); @@ -139,7 +139,7 @@ SvStream& WriteSvtGraphicStroke( SvStream& rOStm, const SvtGraphicStroke& rClass SvStream& ReadSvtGraphicStroke( SvStream& rIStm, SvtGraphicStroke& rClass ) { - VersionCompat aCompat( rIStm, STREAM_READ ); + VersionCompat aCompat( rIStm, StreamMode::READ ); rClass.maPath.Read( rIStm ); rClass.maStartArrow.Read( rIStm ); @@ -241,7 +241,7 @@ void SvtGraphicFill::setPath( const tools::PolyPolygon& rPath ) SvStream& WriteSvtGraphicFill( SvStream& rOStm, const SvtGraphicFill& rClass ) { - VersionCompat aCompat( rOStm, STREAM_WRITE, 1 ); + VersionCompat aCompat( rOStm, StreamMode::WRITE, 1 ); rClass.maPath.Write( rOStm ); WriteColor( rOStm, rClass.maFillColor ); @@ -270,7 +270,7 @@ SvStream& WriteSvtGraphicFill( SvStream& rOStm, const SvtGraphicFill& rClass ) SvStream& ReadSvtGraphicFill( SvStream& rIStm, SvtGraphicFill& rClass ) { - VersionCompat aCompat( rIStm, STREAM_READ ); + VersionCompat aCompat( rIStm, StreamMode::READ ); rClass.maPath.Read( rIStm ); ReadColor( rIStm, rClass.maFillColor ); diff --git a/vcl/source/gdi/hatch.cxx b/vcl/source/gdi/hatch.cxx index 8a131cd8e2db..a8df021002e5 100644 --- a/vcl/source/gdi/hatch.cxx +++ b/vcl/source/gdi/hatch.cxx @@ -120,7 +120,7 @@ void Hatch::SetAngle( sal_uInt16 nAngle10 ) SvStream& ReadImplHatch( SvStream& rIStm, ImplHatch& rImplHatch ) { - VersionCompat aCompat( rIStm, STREAM_READ ); + VersionCompat aCompat( rIStm, StreamMode::READ ); sal_uInt16 nTmp16; sal_Int32 nTmp32(0); @@ -133,7 +133,7 @@ SvStream& ReadImplHatch( SvStream& rIStm, ImplHatch& rImplHatch ) SvStream& WriteImplHatch( SvStream& rOStm, const ImplHatch& rImplHatch ) { - VersionCompat aCompat( rOStm, STREAM_WRITE, 1 ); + VersionCompat aCompat( rOStm, StreamMode::WRITE, 1 ); rOStm.WriteUInt16( rImplHatch.meStyle ); WriteColor( rOStm, rImplHatch.maColor ); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 2c2a7473298f..308d65d667c2 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -958,7 +958,7 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm ) if( GRAPHIC_FORMAT_50 == nId ) { // read new style header - VersionCompat* pCompat = new VersionCompat( rIStm, STREAM_READ ); + VersionCompat* pCompat = new VersionCompat( rIStm, StreamMode::READ ); rIStm.ReadInt32( nType ); rIStm.ReadInt32( nLen ); @@ -1094,7 +1094,7 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) rOStm.WriteUInt32( GRAPHIC_FORMAT_50 ); // write new style header - VersionCompat* pCompat = new VersionCompat( rOStm, STREAM_WRITE, 1 ); + VersionCompat* pCompat = new VersionCompat( rOStm, StreamMode::WRITE, 1 ); rOStm.WriteInt32( meType ); @@ -1164,7 +1164,7 @@ bool ImpGraphic::ImplSwapOut() boost::scoped_ptr<SvStream> pOStm; try { - pOStm.reset(::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE | STREAM_SHARE_DENYWRITE )); + pOStm.reset(::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE | StreamMode::SHARE_DENYWRITE )); } catch( const ::com::sun::star::uno::Exception& ) { @@ -1262,7 +1262,7 @@ bool ImpGraphic::ImplSwapIn() boost::scoped_ptr<SvStream> pIStm; try { - pIStm.reset(::utl::UcbStreamHelper::CreateStream( aSwapURL, STREAM_READWRITE | STREAM_SHARE_DENYWRITE )); + pIStm.reset(::utl::UcbStreamHelper::CreateStream( aSwapURL, STREAM_READWRITE | StreamMode::SHARE_DENYWRITE )); } catch( const ::com::sun::star::uno::Exception& ) { @@ -1449,7 +1449,7 @@ SvStream& ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic ) VersionCompat* pCompat; // read compat info - pCompat = new VersionCompat( rIStm, STREAM_READ ); + pCompat = new VersionCompat( rIStm, StreamMode::READ ); delete pCompat; ReadGfxLink( rIStm, aLink ); @@ -1589,7 +1589,7 @@ SvStream& WriteImpGraphic( SvStream& rOStm, const ImpGraphic& rImpGraphic ) rOStm.WriteUInt32( NATIVE_FORMAT_50 ); // write compat info - pCompat = new VersionCompat( rOStm, STREAM_WRITE, 1 ); + pCompat = new VersionCompat( rOStm, StreamMode::WRITE, 1 ); delete pCompat; rImpGraphic.mpGfxLink->SetPrefMapMode( rImpGraphic.ImplGetPrefMapMode() ); diff --git a/vcl/source/gdi/lineinfo.cxx b/vcl/source/gdi/lineinfo.cxx index d7ae97aa7d82..fc6fe4f6e7a8 100644 --- a/vcl/source/gdi/lineinfo.cxx +++ b/vcl/source/gdi/lineinfo.cxx @@ -190,7 +190,7 @@ bool LineInfo::IsDefault() const SvStream& ReadImplLineInfo( SvStream& rIStm, ImplLineInfo& rImplLineInfo ) { - VersionCompat aCompat( rIStm, STREAM_READ ); + VersionCompat aCompat( rIStm, StreamMode::READ ); sal_uInt16 nTmp16(0); sal_Int32 nTmp32(0); @@ -226,7 +226,7 @@ SvStream& ReadImplLineInfo( SvStream& rIStm, ImplLineInfo& rImplLineInfo ) SvStream& WriteImplLineInfo( SvStream& rOStm, const ImplLineInfo& rImplLineInfo ) { - VersionCompat aCompat( rOStm, STREAM_WRITE, 4 ); + VersionCompat aCompat( rOStm, StreamMode::WRITE, 4 ); // version 1 rOStm.WriteUInt16( rImplLineInfo.meStyle ).WriteInt32( rImplLineInfo.mnWidth ); diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx index a64f43b6aed6..2bf14e3fe112 100644 --- a/vcl/source/gdi/mapmod.cxx +++ b/vcl/source/gdi/mapmod.cxx @@ -68,7 +68,7 @@ MapMode::ImplMapMode::ImplMapMode( const ImplMapMode& rImplMapMode ) : SvStream& ReadImplMapMode(SvStream& rIStm, MapMode::ImplMapMode& rImplMapMode) { - VersionCompat aCompat( rIStm, STREAM_READ ); + VersionCompat aCompat( rIStm, StreamMode::READ ); sal_uInt16 nTmp16; rIStm.ReadUInt16( nTmp16 ); rImplMapMode.meUnit = (MapUnit) nTmp16; @@ -82,7 +82,7 @@ SvStream& ReadImplMapMode(SvStream& rIStm, MapMode::ImplMapMode& rImplMapMode) SvStream& WriteImplMapMode(SvStream& rOStm, const MapMode::ImplMapMode& rImplMapMode) { - VersionCompat aCompat( rOStm, STREAM_WRITE, 1 ); + VersionCompat aCompat( rOStm, StreamMode::WRITE, 1 ); rOStm.WriteUInt16( rImplMapMode.meUnit ); WritePair( rOStm, rImplMapMode.maOrigin ); diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 50b856b22f09..863258824054 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -262,7 +262,7 @@ MetaAction* MetaAction::ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData default: { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); } break; } @@ -317,14 +317,14 @@ bool MetaPixelAction::Compare( const MetaAction& rMetaAction ) const void MetaPixelAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WritePair( rOStm, maPt ); maColor.Write( rOStm, true ); } void MetaPixelAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadPair( rIStm, maPt ); maColor.Read( rIStm, true ); } @@ -371,13 +371,13 @@ bool MetaPointAction::Compare( const MetaAction& rMetaAction ) const void MetaPointAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WritePair( rOStm, maPt ); } void MetaPointAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadPair( rIStm, maPt ); } @@ -440,7 +440,7 @@ bool MetaLineAction::Compare( const MetaAction& rMetaAction ) const void MetaLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 2); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 2); WritePair( rOStm, maStartPt ); WritePair( rOStm, maEndPt ); // Version 1 @@ -449,7 +449,7 @@ void MetaLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaLineAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); // Version 1 ReadPair( rIStm, maStartPt ); @@ -504,13 +504,13 @@ bool MetaRectAction::Compare( const MetaAction& rMetaAction ) const void MetaRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteRectangle( rOStm, maRect ); } void MetaRectAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadRectangle( rIStm, maRect ); } @@ -565,14 +565,14 @@ bool MetaRoundRectAction::Compare( const MetaAction& rMetaAction ) const void MetaRoundRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteRectangle( rOStm, maRect ); rOStm.WriteUInt32( mnHorzRound ).WriteUInt32( mnVertRound ); } void MetaRoundRectAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadRectangle( rIStm, maRect ).ReadUInt32( mnHorzRound ).ReadUInt32( mnVertRound ); } @@ -618,13 +618,13 @@ bool MetaEllipseAction::Compare( const MetaAction& rMetaAction ) const void MetaEllipseAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteRectangle( rOStm, maRect ); } void MetaEllipseAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadRectangle( rIStm, maRect ); } @@ -679,7 +679,7 @@ bool MetaArcAction::Compare( const MetaAction& rMetaAction ) const void MetaArcAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteRectangle( rOStm, maRect ); WritePair( rOStm, maStartPt ); WritePair( rOStm, maEndPt ); @@ -687,7 +687,7 @@ void MetaArcAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaArcAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadRectangle( rIStm, maRect ); ReadPair( rIStm, maStartPt ); ReadPair( rIStm, maEndPt ); @@ -744,7 +744,7 @@ bool MetaPieAction::Compare( const MetaAction& rMetaAction ) const void MetaPieAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteRectangle( rOStm, maRect ); WritePair( rOStm, maStartPt ); WritePair( rOStm, maEndPt ); @@ -752,7 +752,7 @@ void MetaPieAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaPieAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadRectangle( rIStm, maRect ); ReadPair( rIStm, maStartPt ); ReadPair( rIStm, maEndPt ); @@ -809,7 +809,7 @@ bool MetaChordAction::Compare( const MetaAction& rMetaAction ) const void MetaChordAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteRectangle( rOStm, maRect ); WritePair( rOStm, maStartPt ); WritePair( rOStm, maEndPt ); @@ -817,7 +817,7 @@ void MetaChordAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaChordAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadRectangle( rIStm, maRect ); ReadPair( rIStm, maStartPt ); ReadPair( rIStm, maEndPt ); @@ -881,7 +881,7 @@ bool MetaPolyLineAction::Compare( const MetaAction& rMetaAction ) const void MetaPolyLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 3); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 3); Polygon aSimplePoly; maPoly.AdaptiveSubdivide( aSimplePoly ); @@ -897,7 +897,7 @@ void MetaPolyLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaPolyLineAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); // Version 1 ReadPolygon( rIStm, maPoly ); @@ -956,7 +956,7 @@ bool MetaPolygonAction::Compare( const MetaAction& rMetaAction ) const void MetaPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 2); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 2); Polygon aSimplePoly; // Version 1 maPoly.AdaptiveSubdivide( aSimplePoly ); @@ -970,7 +970,7 @@ void MetaPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadPolygon( rIStm, maPoly ); // Version 1 @@ -1026,7 +1026,7 @@ bool MetaPolyPolygonAction::Compare( const MetaAction& rMetaAction ) const void MetaPolyPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 2); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 2); sal_uInt16 nNumberOfComplexPolygons = 0; sal_uInt16 i, nPolyCount = maPolyPoly.Count(); @@ -1058,7 +1058,7 @@ void MetaPolyPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaPolyPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadPolyPolygon( rIStm, maPolyPoly ); // Version 1 if ( aCompat.GetVersion() >= 2 ) // Version 2 @@ -1133,7 +1133,7 @@ bool MetaTextAction::Compare( const MetaAction& rMetaAction ) const void MetaTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 2); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 2); WritePair( rOStm, maPt ); rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet ); rOStm.WriteUInt16(mnIndex); @@ -1144,7 +1144,7 @@ void MetaTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadPair( rIStm, maPt ); maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet); sal_uInt16 nTmpIndex(0); @@ -1252,7 +1252,7 @@ void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) const sal_Int32 nAryLen = mpDXAry ? mnLen : 0; MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 2); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 2); WritePair( rOStm, maStartPt ); rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet ); rOStm.WriteUInt16(mnIndex); @@ -1269,7 +1269,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) { delete[] mpDXAry; - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadPair( rIStm, maStartPt ); maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet); sal_uInt16 nTmpIndex(0); @@ -1385,7 +1385,7 @@ bool MetaStretchTextAction::Compare( const MetaAction& rMetaAction ) const void MetaStretchTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 2); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 2); WritePair( rOStm, maPt ); rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet ); rOStm.WriteUInt32( mnWidth ); @@ -1397,7 +1397,7 @@ void MetaStretchTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaStretchTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadPair( rIStm, maPt ); maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet); rIStm.ReadUInt32( mnWidth ); @@ -1460,7 +1460,7 @@ bool MetaTextRectAction::Compare( const MetaAction& rMetaAction ) const void MetaTextRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 2); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 2); WriteRectangle( rOStm, maRect ); rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet ); rOStm.WriteUInt16( mnStyle ); @@ -1470,7 +1470,7 @@ void MetaTextRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaTextRectAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadRectangle( rIStm, maRect ); maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet); rIStm .ReadUInt16( mnStyle ); @@ -1537,7 +1537,7 @@ bool MetaTextLineAction::Compare( const MetaAction& rMetaAction ) const void MetaTextLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 2); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 2); WritePair( rOStm, maPos ); rOStm.WriteInt32( mnWidth ); @@ -1549,7 +1549,7 @@ void MetaTextLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaTextLineAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); sal_Int32 nTempWidth(0); ReadPair( rIStm, maPos ); @@ -1614,7 +1614,7 @@ void MetaBmpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) if( !!maBmp ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteDIB(maBmp, rOStm, false, true); WritePair( rOStm, maPt ); } @@ -1622,7 +1622,7 @@ void MetaBmpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaBmpAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadDIB(maBmp, rIStm, true); ReadPair( rIStm, maPt ); } @@ -1679,7 +1679,7 @@ void MetaBmpScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) if( !!maBmp ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteDIB(maBmp, rOStm, false, true); WritePair( rOStm, maPt ); WritePair( rOStm, maSz ); @@ -1688,7 +1688,7 @@ void MetaBmpScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaBmpScaleAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadDIB(maBmp, rIStm, true); ReadPair( rIStm, maPt ); ReadPair( rIStm, maSz ); @@ -1751,7 +1751,7 @@ void MetaBmpScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) if( !!maBmp ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteDIB(maBmp, rOStm, false, true); WritePair( rOStm, maDstPt ); WritePair( rOStm, maDstSz ); @@ -1762,7 +1762,7 @@ void MetaBmpScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaBmpScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadDIB(maBmp, rIStm, true); ReadPair( rIStm, maDstPt ); ReadPair( rIStm, maDstSz ); @@ -1816,7 +1816,7 @@ void MetaBmpExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) if( !!maBmpEx.GetBitmap() ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteDIBBitmapEx(maBmpEx, rOStm); WritePair( rOStm, maPt ); } @@ -1824,7 +1824,7 @@ void MetaBmpExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaBmpExAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadDIBBitmapEx(maBmpEx, rIStm); ReadPair( rIStm, maPt ); } @@ -1881,7 +1881,7 @@ void MetaBmpExScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) if( !!maBmpEx.GetBitmap() ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteDIBBitmapEx(maBmpEx, rOStm); WritePair( rOStm, maPt ); WritePair( rOStm, maSz ); @@ -1890,7 +1890,7 @@ void MetaBmpExScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaBmpExScaleAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadDIBBitmapEx(maBmpEx, rIStm); ReadPair( rIStm, maPt ); ReadPair( rIStm, maSz ); @@ -1953,7 +1953,7 @@ void MetaBmpExScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData if( !!maBmpEx.GetBitmap() ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteDIBBitmapEx(maBmpEx, rOStm); WritePair( rOStm, maDstPt ); WritePair( rOStm, maDstSz ); @@ -1964,7 +1964,7 @@ void MetaBmpExScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData void MetaBmpExScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadDIBBitmapEx(maBmpEx, rIStm); ReadPair( rIStm, maDstPt ); ReadPair( rIStm, maDstSz ); @@ -2022,7 +2022,7 @@ void MetaMaskAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) if( !!maBmp ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteDIB(maBmp, rOStm, false, true); WritePair( rOStm, maPt ); } @@ -2030,7 +2030,7 @@ void MetaMaskAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaMaskAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadDIB(maBmp, rIStm, true); ReadPair( rIStm, maPt ); } @@ -2090,7 +2090,7 @@ void MetaMaskScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) if( !!maBmp ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteDIB(maBmp, rOStm, false, true); WritePair( rOStm, maPt ); WritePair( rOStm, maSz ); @@ -2099,7 +2099,7 @@ void MetaMaskScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaMaskScaleAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadDIB(maBmp, rIStm, true); ReadPair( rIStm, maPt ); ReadPair( rIStm, maSz ); @@ -2165,7 +2165,7 @@ void MetaMaskScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) if( !!maBmp ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteDIB(maBmp, rOStm, false, true); maColor.Write( rOStm, true ); WritePair( rOStm, maDstPt ); @@ -2177,7 +2177,7 @@ void MetaMaskScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaMaskScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadDIB(maBmp, rIStm, true); maColor.Read( rIStm, true ); ReadPair( rIStm, maDstPt ); @@ -2230,14 +2230,14 @@ bool MetaGradientAction::Compare( const MetaAction& rMetaAction ) const void MetaGradientAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteRectangle( rOStm, maRect ); WriteGradient( rOStm, maGradient ); } void MetaGradientAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadRectangle( rIStm, maRect ); ReadGradient( rIStm, maGradient ); } @@ -2291,7 +2291,7 @@ bool MetaGradientExAction::Compare( const MetaAction& rMetaAction ) const void MetaGradientExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); // #i105373# see comment at MetaTransparentAction::Write tools::PolyPolygon aNoCurvePolyPolygon; @@ -2303,7 +2303,7 @@ void MetaGradientExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaGradientExAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadPolyPolygon( rIStm, maPolyPoly ); ReadGradient( rIStm, maGradient ); } @@ -2353,7 +2353,7 @@ bool MetaHatchAction::Compare( const MetaAction& rMetaAction ) const void MetaHatchAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); // #i105373# see comment at MetaTransparentAction::Write tools::PolyPolygon aNoCurvePolyPolygon; @@ -2365,7 +2365,7 @@ void MetaHatchAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaHatchAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadPolyPolygon( rIStm, maPolyPoly ); ReadHatch( rIStm, maHatch ); } @@ -2415,14 +2415,14 @@ bool MetaWallpaperAction::Compare( const MetaAction& rMetaAction ) const void MetaWallpaperAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteWallpaper( rOStm, maWallpaper ); } void MetaWallpaperAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadWallpaper( rIStm, maWallpaper ); } @@ -2474,7 +2474,7 @@ bool MetaClipRegionAction::Compare( const MetaAction& rMetaAction ) const void MetaClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteRegion( rOStm, maRegion ); rOStm.WriteUChar( mbClip ); @@ -2482,7 +2482,7 @@ void MetaClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadRegion( rIStm, maRegion ); rIStm.ReadCharAsBool( mbClip ); } @@ -2529,13 +2529,13 @@ bool MetaISectRectClipRegionAction::Compare( const MetaAction& rMetaAction ) con void MetaISectRectClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteRectangle( rOStm, maRect ); } void MetaISectRectClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadRectangle( rIStm, maRect ); } @@ -2582,13 +2582,13 @@ bool MetaISectRegionClipRegionAction::Compare( const MetaAction& rMetaAction ) c void MetaISectRegionClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteRegion( rOStm, maRegion ); } void MetaISectRegionClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadRegion( rIStm, maRegion ); } @@ -2634,13 +2634,13 @@ bool MetaMoveClipRegionAction::Compare( const MetaAction& rMetaAction ) const void MetaMoveClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); rOStm.WriteInt32( mnHorzMove ).WriteInt32( mnVertMove ); } void MetaMoveClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); sal_Int32 nTmpHM(0), nTmpVM(0); rIStm.ReadInt32( nTmpHM ).ReadInt32( nTmpVM ); mnHorzMove = nTmpHM; @@ -2685,14 +2685,14 @@ bool MetaLineColorAction::Compare( const MetaAction& rMetaAction ) const void MetaLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); maColor.Write( rOStm, true ); rOStm.WriteUChar( mbSet ); } void MetaLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); maColor.Read( rIStm, true ); rIStm.ReadCharAsBool( mbSet ); } @@ -2735,14 +2735,14 @@ bool MetaFillColorAction::Compare( const MetaAction& rMetaAction ) const void MetaFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); maColor.Write( rOStm, true ); rOStm.WriteUChar( mbSet ); } void MetaFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); maColor.Read( rIStm, true ); rIStm.ReadCharAsBool( mbSet ); } @@ -2779,13 +2779,13 @@ bool MetaTextColorAction::Compare( const MetaAction& rMetaAction ) const void MetaTextColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); maColor.Write( rOStm, true ); } void MetaTextColorAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); maColor.Read( rIStm, true ); } @@ -2827,14 +2827,14 @@ bool MetaTextFillColorAction::Compare( const MetaAction& rMetaAction ) const void MetaTextFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); maColor.Write( rOStm, true ); rOStm.WriteUChar( mbSet ); } void MetaTextFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); maColor.Read( rIStm, true ); rIStm.ReadCharAsBool( mbSet ); } @@ -2877,14 +2877,14 @@ bool MetaTextLineColorAction::Compare( const MetaAction& rMetaAction ) const void MetaTextLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); maColor.Write( rOStm, true ); rOStm.WriteUChar( mbSet ); } void MetaTextLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); maColor.Read( rIStm, true ); rIStm.ReadCharAsBool( mbSet ); } @@ -2927,14 +2927,14 @@ bool MetaOverlineColorAction::Compare( const MetaAction& rMetaAction ) const void MetaOverlineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); maColor.Write( rOStm, true ); rOStm.WriteUChar( mbSet ); } void MetaOverlineColorAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); maColor.Read( rIStm, true ); rIStm.ReadCharAsBool( mbSet ); } @@ -2972,7 +2972,7 @@ bool MetaTextAlignAction::Compare( const MetaAction& rMetaAction ) const void MetaTextAlignAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); rOStm.WriteUInt16( maAlign ); } @@ -2980,7 +2980,7 @@ void MetaTextAlignAction::Read( SvStream& rIStm, ImplMetaReadData* ) { sal_uInt16 nTmp16(0); - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); rIStm.ReadUInt16( nTmp16 ); maAlign = (TextAlign) nTmp16; } @@ -3024,13 +3024,13 @@ bool MetaMapModeAction::Compare( const MetaAction& rMetaAction ) const void MetaMapModeAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteMapMode( rOStm, maMapMode ); } void MetaMapModeAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadMapMode( rIStm, maMapMode ); } @@ -3084,7 +3084,7 @@ bool MetaFontAction::Compare( const MetaAction& rMetaAction ) const void MetaFontAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteFont( rOStm, maFont ); pData->meActualCharSet = maFont.GetCharSet(); if ( pData->meActualCharSet == RTL_TEXTENCODING_DONTKNOW ) @@ -3093,7 +3093,7 @@ void MetaFontAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaFontAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadFont( rIStm, maFont ); pData->meActualCharSet = maFont.GetCharSet(); if ( pData->meActualCharSet == RTL_TEXTENCODING_DONTKNOW ) @@ -3133,13 +3133,13 @@ bool MetaPushAction::Compare( const MetaAction& rMetaAction ) const void MetaPushAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); rOStm.WriteUInt16( static_cast<sal_uInt16>(mnFlags) ); } void MetaPushAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); sal_uInt16 tmp; rIStm.ReadUInt16( tmp ); mnFlags = static_cast<PushFlags>(tmp); @@ -3167,12 +3167,12 @@ MetaAction* MetaPopAction::Clone() void MetaPopAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); } void MetaPopAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); } MetaRasterOpAction::MetaRasterOpAction() : @@ -3209,7 +3209,7 @@ bool MetaRasterOpAction::Compare( const MetaAction& rMetaAction ) const void MetaRasterOpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); rOStm.WriteUInt16( meRasterOp ); } @@ -3217,7 +3217,7 @@ void MetaRasterOpAction::Read( SvStream& rIStm, ImplMetaReadData* ) { sal_uInt16 nTmp16(0); - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); rIStm.ReadUInt16( nTmp16 ); meRasterOp = (RasterOp) nTmp16; } @@ -3267,7 +3267,7 @@ bool MetaTransparentAction::Compare( const MetaAction& rMetaAction ) const void MetaTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); // #i105373# The tools::PolyPolygon in this action may be a curve; this // was ignored until now what is an error. To make older office @@ -3287,7 +3287,7 @@ void MetaTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaTransparentAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadPolyPolygon( rIStm, maPolyPoly ); rIStm.ReadUInt16( mnTransPercent ); } @@ -3344,7 +3344,7 @@ bool MetaFloatTransparentAction::Compare( const MetaAction& rMetaAction ) const void MetaFloatTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); maMtf.Write( rOStm ); WritePair( rOStm, maPoint ); @@ -3354,7 +3354,7 @@ void MetaFloatTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pDat void MetaFloatTransparentAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadGDIMetaFile( rIStm, maMtf ); ReadPair( rIStm, maPoint ); ReadPair( rIStm, maSize ); @@ -3413,7 +3413,7 @@ bool MetaEPSAction::Compare( const MetaAction& rMetaAction ) const void MetaEPSAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WriteGfxLink( rOStm, maGfxLink ); WritePair( rOStm, maPoint ); @@ -3423,7 +3423,7 @@ void MetaEPSAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaEPSAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadGfxLink( rIStm, maGfxLink ); ReadPair( rIStm, maPoint ); ReadPair( rIStm, maSize ); @@ -3468,7 +3468,7 @@ bool MetaRefPointAction::Compare( const MetaAction& rMetaAction ) const void MetaRefPointAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); WritePair( rOStm, maRefPoint ); rOStm.WriteUChar( mbSet ); @@ -3476,7 +3476,7 @@ void MetaRefPointAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaRefPointAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); ReadPair( rIStm, maRefPoint ).ReadCharAsBool( mbSet ); } @@ -3548,7 +3548,7 @@ void MetaCommentAction::Move( long nXMove, long nYMove ) bool bPathStroke = (maComment == "XPATHSTROKE_SEQ_BEGIN"); if ( bPathStroke || maComment == "XPATHFILL_SEQ_BEGIN" ) { - SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ ); + SvMemoryStream aMemStm( (void*)mpData, mnDataSize, StreamMode::READ ); SvMemoryStream aDest; if ( bPathStroke ) { @@ -3604,7 +3604,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale ) bool bPathStroke = (maComment == "XPATHSTROKE_SEQ_BEGIN"); if ( bPathStroke || maComment == "XPATHFILL_SEQ_BEGIN" ) { - SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ ); + SvMemoryStream aMemStm( (void*)mpData, mnDataSize, StreamMode::READ ); SvMemoryStream aDest; if ( bPathStroke ) { @@ -3626,7 +3626,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale ) delete[] mpData; ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() ); } else if( maComment == "EMF_PLUS_HEADER_INFO" ){ - SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ ); + SvMemoryStream aMemStm( (void*)mpData, mnDataSize, StreamMode::READ ); SvMemoryStream aDest; sal_Int32 nLeft(0), nRight(0), nTop(0), nBottom(0); @@ -3667,7 +3667,7 @@ bool MetaCommentAction::Compare( const MetaAction& rMetaAction ) const void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, maComment); rOStm.WriteInt32( mnValue ).WriteUInt32( mnDataSize ); @@ -3677,7 +3677,7 @@ void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); maComment = read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); rIStm.ReadInt32( mnValue ).ReadUInt32( mnDataSize ); @@ -3727,13 +3727,13 @@ bool MetaLayoutModeAction::Compare( const MetaAction& rMetaAction ) const void MetaLayoutModeAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); rOStm.WriteUInt32( mnLayoutMode ); } void MetaLayoutModeAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); sal_uInt32 tmp; rIStm.ReadUInt32( tmp ); mnLayoutMode = static_cast<ComplexTextLayoutMode>(tmp); @@ -3772,13 +3772,13 @@ bool MetaTextLanguageAction::Compare( const MetaAction& rMetaAction ) const void MetaTextLanguageAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) { MetaAction::Write(rOStm, pData); - VersionCompat aCompat(rOStm, STREAM_WRITE, 1); + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); rOStm.WriteUInt16( meTextLanguage ); } void MetaTextLanguageAction::Read( SvStream& rIStm, ImplMetaReadData* ) { - VersionCompat aCompat(rIStm, STREAM_READ); + VersionCompat aCompat(rIStm, StreamMode::READ); rIStm.ReadUInt16( meTextLanguage ); } diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 02bfad35e478..c87993434880 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -550,7 +550,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa const sal_uInt8* pData = pA->GetData(); if ( pData ) { - SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ ); + SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), StreamMode::READ ); bool bSkipSequence = false; OString sSeqEnd; diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index 8c30c45e2d89..4e08ba694e14 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -901,7 +901,7 @@ void PNGReaderImpl::ImplReadIDAT() mpZCodec.BeginCompression( ZCODEC_NO_COMPRESSION, true ); } mpZCodec.SetBreak( mnChunkLen ); - SvMemoryStream aIStrm( &(*maDataIter), mnChunkLen, STREAM_READ ); + SvMemoryStream aIStrm( &(*maDataIter), mnChunkLen, StreamMode::READ ); while ( ( mpZCodec.GetBreak() ) ) { diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index fd23d197f64c..bdbe2e2263b6 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -389,7 +389,7 @@ bool QueueInfo::operator==( const QueueInfo& rInfo ) const SvStream& WriteQueueInfo( SvStream& rOStream, const QueueInfo& rInfo ) { - VersionCompat aCompat( rOStream, STREAM_WRITE, 1 ); + VersionCompat aCompat( rOStream, StreamMode::WRITE, 1 ); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStream, rInfo.maPrinterName, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStream, rInfo.maDriver, RTL_TEXTENCODING_UTF8); @@ -403,7 +403,7 @@ SvStream& WriteQueueInfo( SvStream& rOStream, const QueueInfo& rInfo ) SvStream& ReadQueueInfo( SvStream& rIStream, QueueInfo& rInfo ) { - VersionCompat aCompat( rIStream, STREAM_READ ); + VersionCompat aCompat( rIStream, StreamMode::READ ); rInfo.maPrinterName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); rInfo.maDriver = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 9b8e2a996a67..fa908deeb253 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -1567,7 +1567,7 @@ bool vcl::Region::operator==( const vcl::Region& rRegion ) const SvStream& ReadRegion(SvStream& rIStrm, vcl::Region& rRegion) { - VersionCompat aCompat(rIStrm, STREAM_READ); + VersionCompat aCompat(rIStrm, StreamMode::READ); sal_uInt16 nVersion(0); sal_uInt16 nTmp16(0); @@ -1627,7 +1627,7 @@ SvStream& ReadRegion(SvStream& rIStrm, vcl::Region& rRegion) SvStream& WriteRegion( SvStream& rOStrm, const vcl::Region& rRegion ) { const sal_uInt16 nVersion(2); - VersionCompat aCompat(rOStrm, STREAM_WRITE, nVersion); + VersionCompat aCompat(rOStrm, StreamMode::WRITE, nVersion); // put version rOStrm.WriteUInt16( nVersion ); diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx index 00031a3c829d..b4208f262891 100644 --- a/vcl/source/gdi/wall.cxx +++ b/vcl/source/gdi/wall.cxx @@ -87,7 +87,7 @@ void ImplWallpaper::ImplReleaseCachedBitmap() SvStream& ReadImplWallpaper( SvStream& rIStm, ImplWallpaper& rImplWallpaper ) { - VersionCompat aCompat( rIStm, STREAM_READ ); + VersionCompat aCompat( rIStm, StreamMode::READ ); sal_uInt16 nTmp16; delete rImplWallpaper.mpRect; @@ -140,7 +140,7 @@ SvStream& ReadImplWallpaper( SvStream& rIStm, ImplWallpaper& rImplWallpaper ) SvStream& WriteImplWallpaper( SvStream& rOStm, const ImplWallpaper& rImplWallpaper ) { - VersionCompat aCompat( rOStm, STREAM_WRITE, 3 ); + VersionCompat aCompat( rOStm, StreamMode::WRITE, 3 ); bool bRect = ( rImplWallpaper.mpRect != NULL ); bool bGrad = ( rImplWallpaper.mpGradient != NULL ); bool bBmp = ( rImplWallpaper.mpBitmap != NULL ); diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index ddb0e7cb4404..99ef093fffe2 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -179,7 +179,7 @@ void OpenGLHelper::renderToFile(long nWidth, long nHeight, const OUString& rFile BitmapEx aBitmap = ConvertBGRABufferToBitmapEx(pBuffer.get(), nWidth, nHeight); try { vcl::PNGWriter aWriter( aBitmap ); - SvFileStream sOutput( rFileName, STREAM_WRITE ); + SvFileStream sOutput( rFileName, StreamMode::WRITE ); aWriter.Write( sOutput ); sOutput.Close(); } catch (...) { diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index 3a9d7d400681..55c645e85aad 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -286,7 +286,7 @@ void X11SalInstance::FillFontPathList( std::list< OString >& o_rFontPaths ) aOpenWinDir += OUString::createFromAscii( lang ); aOpenWinDir += "/OWfontpath"; - SvFileStream aStream( aOpenWinDir, STREAM_READ ); + SvFileStream aStream( aOpenWinDir, StreamMode::READ ); // TODO: replace environment variables while( aStream.IsOpen() && ! aStream.IsEof() ) diff --git a/vcl/unx/generic/dtrans/bmp.cxx b/vcl/unx/generic/dtrans/bmp.cxx index e57fb93c7240..0c8e1318e735 100644 --- a/vcl/unx/generic/dtrans/bmp.cxx +++ b/vcl/unx/generic/dtrans/bmp.cxx @@ -735,7 +735,7 @@ css::uno::Sequence<sal_Int8> x11::convertBitmapDepth( SolarMutexGuard g; SvMemoryStream in( const_cast<sal_Int8 *>(data.getConstArray()), data.getLength(), - STREAM_READ); + StreamMode::READ); Bitmap bm; ReadDIB(bm, in, true); if (bm.GetBitCount() == 24 && depth <= 8) { diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx index 389f74dc8be8..ae7604098065 100644 --- a/vcl/unx/generic/printer/jobdata.cxx +++ b/vcl/unx/generic/printer/jobdata.cxx @@ -188,7 +188,7 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes ) bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobData ) { - SvMemoryStream aStream( pData, bytes, STREAM_READ ); + SvMemoryStream aStream( pData, bytes, StreamMode::READ ); OString aLine; bool bVersion = false; bool bPrinter = false; diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index ff4cdd685fd7..4ee389592c6b 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -303,7 +303,7 @@ void PPDDecompressStream::Open( const OUString& i_rFile ) { Close(); - mpFileStream = new SvFileStream( i_rFile, STREAM_READ ); + mpFileStream = new SvFileStream( i_rFile, StreamMode::READ ); maFileName = mpFileStream->GetFileName(); if( ! mpFileStream->IsOpen() ) diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index 1272792c6250..0b2c13d7812c 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -573,7 +573,7 @@ static bool checkWriteability( const OUString& rUniPath ) bool bRet = false; OUString aSysPath; FileBase::getSystemPathFromFileURL( rUniPath, aSysPath ); - SvFileStream aStream( aSysPath, STREAM_READ | STREAM_WRITE ); + SvFileStream aStream( aSysPath, StreamMode::READ | StreamMode::WRITE ); if( aStream.IsOpen() && aStream.IsWritable() ) bRet = true; return bRet; diff --git a/vcl/unx/gtk/gdi/salprn-gtk.cxx b/vcl/unx/gtk/gdi/salprn-gtk.cxx index 71fb8251c4ff..2b4b45444240 100644 --- a/vcl/unx/gtk/gdi/salprn-gtk.cxx +++ b/vcl/unx/gtk/gdi/salprn-gtk.cxx @@ -922,7 +922,7 @@ void GtkPrintDialog::ExportAsPDF(const OUString &rFileURL, GtkPrintSettings *pSe if (xController.is()) xDoc = uno::Reference< XComponent >(xController->getModel(), UNO_QUERY); - SvFileStream aStream(rFileURL, STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC); + SvFileStream aStream(rFileURL, STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | STREAM_TRUNC); uno::Reference< XOutputStream > xOStm(new utl::OOutputStreamWrapper(aStream)); uno::Reference< XExporter > xExport(xFilter, UNO_QUERY); diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index ba3f5d7e7400..f8da349aa85f 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -104,7 +104,7 @@ ImplFontAttrCache::ImplFontAttrCache( const OUString& rFileNameURL, const OUStri // open the cache file osl::FileBase::getSystemPathFromFileURL( rFileNameURL, aCacheFileName ); - SvFileStream aCacheFile( aCacheFileName, STREAM_READ ); + SvFileStream aCacheFile( aCacheFileName, StreamMode::READ ); if( !aCacheFile.IsOpen() ) return; diff --git a/vcl/workben/icontest.cxx b/vcl/workben/icontest.cxx index 74b4df8873ff..3710a16ce152 100644 --- a/vcl/workben/icontest.cxx +++ b/vcl/workben/icontest.cxx @@ -93,7 +93,7 @@ MyWorkWindow::MyWorkWindow( vcl::Window* pParent, WinBits nWinStyle ) void MyWorkWindow::LoadGraphic( const OUString& sImageFile ) { - SvFileStream aFileStream( sImageFile, STREAM_READ ); + SvFileStream aFileStream( sImageFile, StreamMode::READ ); GraphicFilter aGraphicFilter(false); if (aGraphicFilter.ImportGraphic(maGraphic, sImageFile, aFileStream) != 0) { diff --git a/vcl/workben/mtfdemo.cxx b/vcl/workben/mtfdemo.cxx index 6e4d73d353b1..4f65b0ff12ce 100644 --- a/vcl/workben/mtfdemo.cxx +++ b/vcl/workben/mtfdemo.cxx @@ -43,7 +43,7 @@ public: DemoMtfWin(OUString& aFileName) : WorkWindow(NULL, WB_APP | WB_STDWORK) { - SvFileStream aFileStream(aFileName, STREAM_READ); + SvFileStream aFileStream(aFileName, StreamMode::READ); if (aFileStream.IsOpen()) { diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx index 186b904116c4..d737394503b7 100644 --- a/writerfilter/source/filter/RtfFilter.cxx +++ b/writerfilter/source/filter/RtfFilter.cxx @@ -77,7 +77,7 @@ sal_Bool RtfFilter::filter(const uno::Sequence< beans::PropertyValue >& aDescrip OUString aOutStr; if (!bIsNewDoc && pEnv && utl::LocalFileHelper::ConvertPhysicalNameToURL(OUString::fromUtf8(pEnv), aOutStr)) { - std::unique_ptr<SvStream> pOut(utl::UcbStreamHelper::CreateStream(aOutStr, STREAM_WRITE)); + std::unique_ptr<SvStream> pOut(utl::UcbStreamHelper::CreateStream(aOutStr, StreamMode::WRITE)); std::unique_ptr<SvStream> pIn(utl::UcbStreamHelper::CreateStream(xInputStream)); pOut->WriteStream(*pIn); return true; @@ -89,7 +89,7 @@ sal_Bool RtfFilter::filter(const uno::Sequence< beans::PropertyValue >& aDescrip { OUString aInStr; utl::LocalFileHelper::ConvertPhysicalNameToURL(OUString::fromUtf8(pEnv), aInStr); - SvStream* pStream = utl::UcbStreamHelper::CreateStream(aInStr, STREAM_READ); + SvStream* pStream = utl::UcbStreamHelper::CreateStream(aInStr, StreamMode::READ); uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStream)); xInputStream.set(xStream, uno::UNO_QUERY); } diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx index a306554b4032..5fd84a7c1241 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx @@ -167,7 +167,7 @@ uno::Reference< io::XInputStream > SAL_CALL UriBindingHelper::getUriBinding( con } else { - SvFileStream* pStream = new SvFileStream( uri, STREAM_READ ); + SvFileStream* pStream = new SvFileStream( uri, StreamMode::READ ); pStream->Seek( STREAM_SEEK_TO_END ); sal_uLong nBytes = pStream->Tell(); pStream->Seek( STREAM_SEEK_TO_BEGIN ); |