summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-02-05 10:41:04 +0200
committerMichael Stahl <mstahl@redhat.com>2014-02-12 15:31:40 +0000
commit15535e32ddcfee451d4dbc9be9de0b8c9f9d78d4 (patch)
treedb4badc477cea1ecd51f5fab82ce0f24ae20f155 /sot
parent7accbd8c0d7f1d0b87748f0de599c4d8b469a61e (diff)
convert SvStream::operator>> methods to ReadXXX methods
First, I updated the clang rewriter to do the conversion. Then I lightly hand-tweaked the output for the few places where the rewriter messed up, mostly when dealing with calls on "this". Change-Id: I40a6a977959cd97415c678eafc8507de8aa3b1a9 Reviewed-on: https://gerrit.libreoffice.org/7879 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sot')
-rw-r--r--sot/source/base/filelist.cxx4
-rw-r--r--sot/source/sdstor/stgelem.cxx78
-rw-r--r--sot/source/sdstor/stgole.cxx6
-rw-r--r--sot/source/sdstor/storinfo.cxx6
-rw-r--r--sot/source/sdstor/ucbstorage.cxx14
5 files changed, 54 insertions, 54 deletions
diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx
index 9eddbc9eb619..42113063819b 100644
--- a/sot/source/base/filelist.cxx
+++ b/sot/source/base/filelist.cxx
@@ -109,7 +109,7 @@ SvStream& ReadFileList( SvStream& rIStm, FileList& rFileList )
while (!rIStm.IsEof())
{
// read first character of filepath; c==0 > reach end of stream
- rIStm >> c;
+ rIStm.ReadUInt16( c );
if (!c)
break;
@@ -117,7 +117,7 @@ SvStream& ReadFileList( SvStream& rIStm, FileList& rFileList )
while (c && !rIStm.IsEof())
{
sBuf.append((sal_Unicode)c);
- rIStm >> c;
+ rIStm.ReadUInt16( c );
}
// append the filepath
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index 3ebc7290083a..e2aae4b3b0f6 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -37,17 +37,17 @@ static const sal_uInt8 cStgSignature[ 8 ] = { 0xD0,0xCF,0x11,0xE0,0xA1,0xB1,0x1A
SvStream& ReadClsId( SvStream& r, ClsId& rId )
{
- r >> rId.n1
- >> rId.n2
- >> rId.n3
- >> rId.n4
- >> rId.n5
- >> rId.n6
- >> rId.n7
- >> rId.n8
- >> rId.n9
- >> rId.n10
- >> rId.n11;
+ r.ReadInt32( rId.n1 )
+ .ReadInt16( rId.n2 )
+ .ReadInt16( rId.n3 )
+ .ReadUChar( rId.n4 )
+ .ReadUChar( rId.n5 )
+ .ReadUChar( rId.n6 )
+ .ReadUChar( rId.n7 )
+ .ReadUChar( rId.n8 )
+ .ReadUChar( rId.n9 )
+ .ReadUChar( rId.n10 )
+ .ReadUChar( rId.n11 );
return r;
}
@@ -132,21 +132,21 @@ bool StgHeader::Load( SvStream& r )
r.Seek( 0L );
r.Read( cSignature, 8 );
ReadClsId( r, aClsId ); // 08 Class ID
- r >> nVersion // 1A version number
- >> nByteOrder // 1C Unicode byte order indicator
- >> nPageSize // 1E 1 << nPageSize = block size
- >> nDataPageSize; // 20 1 << this size == data block size
+ r.ReadInt32( nVersion ) // 1A version number
+ .ReadUInt16( nByteOrder ) // 1C Unicode byte order indicator
+ .ReadInt16( nPageSize ) // 1E 1 << nPageSize = block size
+ .ReadInt16( nDataPageSize ); // 20 1 << this size == data block size
r.SeekRel( 10 );
- r >> nFATSize // 2C total number of FAT pages
- >> nTOCstrm // 30 starting page for the TOC stream
- >> nReserved // 34
- >> nThreshold // 38 minimum file size for big data
- >> nDataFAT // 3C page # of 1st data FAT block
- >> nDataFATSize // 40 # of data FATpages
- >> nMasterChain // 44 chain to the next master block
- >> nMaster; // 48 # of additional master blocks
+ r.ReadInt32( nFATSize ) // 2C total number of FAT pages
+ .ReadInt32( nTOCstrm ) // 30 starting page for the TOC stream
+ .ReadInt32( nReserved ) // 34
+ .ReadInt32( nThreshold ) // 38 minimum file size for big data
+ .ReadInt32( nDataFAT ) // 3C page # of 1st data FAT block
+ .ReadInt32( nDataFATSize ) // 40 # of data FATpages
+ .ReadInt32( nMasterChain ) // 44 chain to the next master block
+ .ReadInt32( nMaster ); // 48 # of additional master blocks
for( short i = 0; i < cFATPagesInHeader; i++ )
- r >> nMasterFAT[ i ];
+ r.ReadInt32( nMasterFAT[ i ] );
return (r.GetErrorCode() == ERRCODE_NONE) && Check();
}
@@ -369,22 +369,22 @@ bool StgEntry::Load( const void* pFrom, sal_uInt32 nBufSize )
SvMemoryStream r( (sal_Char*) pFrom, nBufSize, STREAM_READ );
for( short i = 0; i < 32; i++ )
- r >> nName[ i ]; // 00 name as WCHAR
- r >> nNameLen // 40 size of name in bytes including 00H
- >> cType // 42 entry type
- >> cFlags // 43 0 or 1 (tree balance?)
- >> nLeft // 44 left node entry
- >> nRight // 48 right node entry
- >> nChild; // 4C 1st child entry if storage
+ r.ReadUInt16( nName[ i ] ); // 00 name as WCHAR
+ r.ReadUInt16( nNameLen ) // 40 size of name in bytes including 00H
+ .ReadUChar( cType ) // 42 entry type
+ .ReadUChar( cFlags ) // 43 0 or 1 (tree balance?)
+ .ReadInt32( nLeft ) // 44 left node entry
+ .ReadInt32( nRight ) // 48 right node entry
+ .ReadInt32( nChild ); // 4C 1st child entry if storage
ReadClsId( r, aClsId ); // 50 class ID (optional)
- r >> nFlags // 60 state flags(?)
- >> nMtime[ 0 ] // 64 modification time
- >> nMtime[ 1 ] // 64 modification time
- >> nAtime[ 0 ] // 6C creation and access time
- >> nAtime[ 1 ] // 6C creation and access time
- >> nPage1 // 74 starting block (either direct or translated)
- >> nSize // 78 file size
- >> nUnknown; // 7C unknown
+ r.ReadInt32( nFlags ) // 60 state flags(?)
+ .ReadInt32( nMtime[ 0 ] ) // 64 modification time
+ .ReadInt32( nMtime[ 1 ] ) // 64 modification time
+ .ReadInt32( nAtime[ 0 ] ) // 6C creation and access time
+ .ReadInt32( nAtime[ 1 ] ) // 6C creation and access time
+ .ReadInt32( nPage1 ) // 74 starting block (either direct or translated)
+ .ReadInt32( nSize ) // 78 file size
+ .ReadInt32( nUnknown ); // 7C unknown
sal_uInt16 n = nNameLen;
if( n )
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx
index 3bae8d637d33..98cdcad38072 100644
--- a/sot/source/sdstor/stgole.cxx
+++ b/sot/source/sdstor/stgole.cxx
@@ -106,12 +106,12 @@ bool StgCompObjStream::Load()
return false;
Seek( 8L ); // skip the first part
sal_Int32 nMarker = 0;
- *this >> nMarker;
+ ReadInt32( nMarker );
if( nMarker == -1L )
{
ReadClsId( *this, aClsId );
sal_Int32 nLen1 = 0;
- *this >> nLen1;
+ ReadInt32( nLen1 );
if ( nLen1 > 0 )
{
// higher bits are ignored
@@ -174,7 +174,7 @@ bool StgOleStream::Load()
sal_Int32 version = 0;
Seek( 0L );
- *this >> version >> nFlags;
+ ReadInt32( version ).ReadUInt32( nFlags );
return GetError() == SVSTREAM_OK;
}
diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx
index f412319bfa55..03e4a06efd58 100644
--- a/sot/source/sdstor/storinfo.cxx
+++ b/sot/source/sdstor/storinfo.cxx
@@ -29,7 +29,7 @@ sal_uLong ReadClipboardFormat( SvStream & rStm )
{
sal_uInt32 nFormat = 0;
sal_Int32 nLen = 0;
- rStm >> nLen;
+ rStm.ReadInt32( nLen );
if( rStm.IsEof() )
rStm.SetError( SVSTREAM_GENERALERROR );
if( nLen > 0 )
@@ -47,10 +47,10 @@ sal_uLong ReadClipboardFormat( SvStream & rStm )
else if( nLen == -1L )
// Windows clipboard format
// SV und Win stimmen ueberein (bis einschl. FORMAT_GDIMETAFILE)
- rStm >> nFormat;
+ rStm.ReadUInt32( nFormat );
else if( nLen == -2L )
{
- rStm >> nFormat;
+ rStm.ReadUInt32( nFormat );
// Mac clipboard format
// ??? not implemented
rStm.SetError( SVSTREAM_GENERALERROR );
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index ec0c48d742e0..51e36cf714c8 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -1645,7 +1645,7 @@ UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, bool
if ( pStream )
{
rStream.Seek(0);
- rStream >> *pStream;
+ rStream.ReadStream( *pStream );
pStream->Flush();
DELETEZ( pStream );
}
@@ -2309,7 +2309,7 @@ sal_Int16 UCBStorage_Impl::Commit()
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), STREAM_STD_READ );
m_pSource->SetStreamSize(0);
// m_pSource->Seek(0);
- *pStream >> *m_pSource;
+ pStream->ReadStream( *m_pSource );
DELETEZ( pStream );
m_pSource->Seek(0);
}
@@ -3101,7 +3101,7 @@ bool UCBStorage::IsStorageFile( SvStream* pFile )
pFile->Seek(0);
sal_uInt32 nBytes(0);
- *pFile >> nBytes;
+ pFile->ReadUInt32( nBytes );
// search for the magic bytes
bool bRet = ( nBytes == 0x04034b50 );
@@ -3112,7 +3112,7 @@ bool UCBStorage::IsStorageFile( SvStream* pFile )
if ( bRet )
{
nBytes = 0;
- *pFile >> nBytes;
+ pFile->ReadUInt32( nBytes );
bRet = ( nBytes == 0x04034b50 );
}
}
@@ -3133,13 +3133,13 @@ bool UCBStorage::IsDiskSpannedFile( SvStream* pFile )
pFile->Seek(0);
sal_uInt32 nBytes;
- *pFile >> nBytes;
+ pFile->ReadUInt32( nBytes );
// disk spanned file have an additional header in front of the usual one
bool bRet = ( nBytes == 0x08074b50 );
if ( bRet )
{
- *pFile >> nBytes;
+ pFile->ReadUInt32( nBytes );
bRet = ( nBytes == 0x04034b50 );
}
@@ -3157,7 +3157,7 @@ OUString UCBStorage::GetLinkedFile( SvStream &rStream )
rStream.Seek(0);
sal_uInt32 nBytes;
- rStream >> nBytes;
+ rStream.ReadUInt32( nBytes );
if( nBytes == 0x04034b50 )
{
OString aTmp = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream);