diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qa/cppunit/test_stream.cxx | 12 | ||||
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 2 | ||||
-rw-r--r-- | tools/source/generic/poly.cxx | 4 | ||||
-rw-r--r-- | tools/source/generic/poly2.cxx | 4 | ||||
-rw-r--r-- | tools/source/rc/resmgr.cxx | 4 | ||||
-rw-r--r-- | tools/source/stream/stream.cxx | 4 | ||||
-rw-r--r-- | tools/source/stream/strmunx.cxx | 30 | ||||
-rw-r--r-- | tools/source/stream/strmwnt.cxx | 6 | ||||
-rw-r--r-- | tools/source/stream/vcompat.cxx | 6 |
9 files changed, 36 insertions, 36 deletions
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(); |