summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-06-03 14:45:59 +0200
committerMichael Stahl <mstahl@redhat.com>2016-06-06 18:09:11 +0000
commit62d270116bf34778bf581f21b27fa9cdbff7de0e (patch)
tree0402df0506ab8f6825ef497f27426f01d2e01850 /sot
parentd0bc637426060593046c8d3a4d01d0b05b052cc5 (diff)
tools: rename SvStream::Read/Write to ReadBytes/WriteBytes
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a Reviewed-on: https://gerrit.libreoffice.org/25972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sot')
-rw-r--r--sot/qa/cppunit/test_sot.cxx4
-rw-r--r--sot/source/sdstor/stgcache.cxx4
-rw-r--r--sot/source/sdstor/stgdir.cxx10
-rw-r--r--sot/source/sdstor/stgelem.cxx4
-rw-r--r--sot/source/sdstor/stgole.cxx2
-rw-r--r--sot/source/sdstor/stgstrms.cxx14
-rw-r--r--sot/source/sdstor/storage.cxx4
-rw-r--r--sot/source/sdstor/storinfo.cxx2
-rw-r--r--sot/source/sdstor/ucbstorage.cxx12
9 files changed, 28 insertions, 28 deletions
diff --git a/sot/qa/cppunit/test_sot.cxx b/sot/qa/cppunit/test_sot.cxx
index 8157bdf570e3..587f62c3afc4 100644
--- a/sot/qa/cppunit/test_sot.cxx
+++ b/sot/qa/cppunit/test_sot.cxx
@@ -62,7 +62,7 @@ namespace
CPPUNIT_ASSERT_MESSAGE( "check size #2", xStream->remainingSize() == nSize );
// Read as much as we can, a corrupted FAT chain can cause real grief here
- nReadableSize = xStream->Read( static_cast<void *>(pData), nSize );
+ nReadableSize = xStream->ReadBytes(static_cast<void *>(pData), nSize);
// fprintf(stderr, "readable size %d vs size %d remaining %d\n", nReadableSize, nSize, nReadableSize);
}
{ // Read the data backwards as well
@@ -73,7 +73,7 @@ namespace
unsigned char c;
xStream->Seek( i - 1 );
CPPUNIT_ASSERT_MESSAGE( "sot storage reading byte",
- xStream->Read( &c, 1 ) == 1);
+ xStream->ReadBytes(&c, 1) == 1);
CPPUNIT_ASSERT_MESSAGE( "mismatching data storage reading byte",
pData[i - 1] == c );
}
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx
index 9360ce184f88..55f91f12bbb2 100644
--- a/sot/source/sdstor/stgcache.cxx
+++ b/sot/source/sdstor/stgcache.cxx
@@ -344,7 +344,7 @@ bool StgCache::Read( sal_Int32 nPage, void* pBuf )
{
m_pStrm->Seek(nPos);
}
- m_pStrm->Read( pBuf, nBytes );
+ m_pStrm->ReadBytes( pBuf, nBytes );
if ( 1 != nPg2 )
SetError( SVSTREAM_READ_ERROR );
else
@@ -372,7 +372,7 @@ bool StgCache::Write( sal_Int32 nPage, void* pBuf )
{
m_pStrm->Seek(nPos);
}
- sal_uLong nRes = m_pStrm->Write( pBuf, nBytes );
+ sal_uLong nRes = m_pStrm->WriteBytes( pBuf, nBytes );
if( nRes != nBytes )
SetError( SVSTREAM_WRITE_ERROR );
else
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 39845250c343..7f1230ccbbb1 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -443,9 +443,9 @@ sal_Int32 StgDirEntry::Read( void* p, sal_Int32 nLen )
if( nLen <= 0 )
return 0;
if( m_pTmpStrm )
- nLen = m_pTmpStrm->Read( p, nLen );
+ nLen = m_pTmpStrm->ReadBytes( p, nLen );
else if( m_pCurStrm )
- nLen = m_pCurStrm->Read( p, nLen );
+ nLen = m_pCurStrm->ReadBytes( p, nLen );
else
{
OSL_ENSURE( m_pStgStrm, "The pointer may not be NULL!" );
@@ -479,7 +479,7 @@ sal_Int32 StgDirEntry::Write( const void* p, sal_Int32 nLen )
if( m_pTmpStrm )
{
- nLen = m_pTmpStrm->Write( p, nLen );
+ nLen = m_pTmpStrm->WriteBytes( p, nLen );
m_pStgStrm->GetIo().SetError( m_pTmpStrm->GetError() );
}
else
@@ -589,7 +589,7 @@ bool StgDirEntry::Strm2Tmp()
nn = 4096;
if( (sal_uLong) m_pStgStrm->Read( p, nn ) != nn )
break;
- if( m_pTmpStrm->Write( p, nn ) != nn )
+ if (m_pTmpStrm->WriteBytes( p, nn ) != nn)
break;
n -= nn;
}
@@ -647,7 +647,7 @@ bool StgDirEntry::Tmp2Strm()
sal_uLong nn = n;
if( nn > 4096 )
nn = 4096;
- if( m_pTmpStrm->Read( p, nn ) != nn )
+ if (m_pTmpStrm->ReadBytes( p, nn ) != nn)
break;
if( (sal_uLong) pNewStrm->Write( p, nn ) != nn )
break;
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index fc269006c334..12ed731d22bd 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -130,7 +130,7 @@ bool StgHeader::Load( StgIo& rIo )
bool StgHeader::Load( SvStream& r )
{
r.Seek( 0L );
- r.Read( m_cSignature, 8 );
+ r.ReadBytes( m_cSignature, 8 );
ReadClsId( r, m_aClsId ); // 08 Class ID
r.ReadInt32( m_nVersion ) // 1A version number
.ReadUInt16( m_nByteOrder ) // 1C Unicode byte order indicator
@@ -158,7 +158,7 @@ bool StgHeader::Store( StgIo& rIo )
SvStream& r = *rIo.GetStrm();
r.Seek( 0L );
- r.Write( m_cSignature, 8 );
+ r.WriteBytes( m_cSignature, 8 );
WriteClsId( r, m_aClsId ); // 08 Class ID
r.WriteInt32( m_nVersion ) // 1A version number
.WriteUInt16( m_nByteOrder ) // 1C Unicode byte order indicator
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx
index 886a7306822b..96769c9cd272 100644
--- a/sot/source/sdstor/stgole.cxx
+++ b/sot/source/sdstor/stgole.cxx
@@ -123,7 +123,7 @@ bool StgCompObjStream::Load()
std::unique_ptr<sal_Char[]> p(new sal_Char[ nStrLen+1 ]);
p[nStrLen] = 0;
- if( Read( p.get(), nStrLen ) == nStrLen )
+ if (ReadBytes( p.get(), nStrLen ) == nStrLen)
{
//The encoding here is "ANSI", which is pretty useless seeing as
//the actual codepage used doesn't seem to be specified/stored
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 4f749486c1cc..521c6cf5adde 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -1149,9 +1149,9 @@ bool StgTmpStrm::Copy( StgTmpStrm& rSrc )
while( n )
{
const sal_uInt64 nn = std::min<sal_uInt64>(n, 4096);
- if( rSrc.Read( p.get(), nn ) != nn )
+ if (rSrc.ReadBytes( p.get(), nn ) != nn)
break;
- if( Write( p.get(), nn ) != nn )
+ if (WriteBytes( p.get(), nn ) != nn)
break;
n -= nn;
}
@@ -1207,8 +1207,8 @@ void StgTmpStrm::SetSize(sal_uInt64 n)
while( i )
{
const sal_uInt64 nb = std::min<sal_uInt64>(i, 4096);
- if( Read( p.get(), nb ) == nb
- && s->Write( p.get(), nb ) == nb )
+ if (ReadBytes(p.get(), nb) == nb
+ && s->WriteBytes(p.get(), nb) == nb)
i -= nb;
else
break;
@@ -1225,7 +1225,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n)
while (i)
{
const sal_uInt64 nb = std::min<sal_uInt64>(i, 4096);
- if (s->Write(p.get(), nb) == nb)
+ if (s->WriteBytes(p.get(), nb) == nb)
i -= nb;
else
break; // error
@@ -1262,7 +1262,7 @@ sal_Size StgTmpStrm::GetData( void* pData, sal_Size n )
{
if( m_pStrm )
{
- n = m_pStrm->Read( pData, n );
+ n = m_pStrm->ReadBytes( pData, n );
SetError( m_pStrm->GetError() );
return n;
}
@@ -1282,7 +1282,7 @@ sal_Size StgTmpStrm::PutData( const void* pData, sal_Size n )
}
if( m_pStrm )
{
- nNew = m_pStrm->Write( pData, n );
+ nNew = m_pStrm->WriteBytes( pData, n );
SetError( m_pStrm->GetError() );
}
else
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index b0ef715f8507..b332911cc7fa 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -201,9 +201,9 @@ void SotStorageStream::CopyTo( SotStorageStream * pDestStm )
std::unique_ptr<sal_uInt8[]> pMem(new sal_uInt8[ 8192 ]);
sal_uLong nRead;
- while( 0 != (nRead = Read( pMem.get(), 8192 )) )
+ while (0 != (nRead = ReadBytes(pMem.get(), 8192)))
{
- if( nRead != pDestStm->Write( pMem.get(), nRead ) )
+ if (nRead != pDestStm->WriteBytes(pMem.get(), nRead))
{
SetError( SVSTREAM_GENERALERROR );
break;
diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx
index d1ea728ec4d4..bfcd21410c49 100644
--- a/sot/source/sdstor/storinfo.cxx
+++ b/sot/source/sdstor/storinfo.cxx
@@ -36,7 +36,7 @@ SotClipboardFormatId ReadClipboardFormat( SvStream & rStm )
{
// get a string name
std::unique_ptr<sal_Char[]> p(new( ::std::nothrow ) sal_Char[ nLen ]);
- if( p && rStm.Read( p.get(), nLen ) == (sal_uLong) nLen )
+ if (p && rStm.ReadBytes(p.get(), nLen) == static_cast<sal_Size>(nLen))
{
nFormat = SotExchange::RegisterFormatName(OUString(p.get(), nLen-1, RTL_TEXTENCODING_ASCII_US));
}
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 0d2ef5d30850..d2badfed4f28 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -148,7 +148,7 @@ sal_Int32 SAL_CALL FileStreamWrapper_Impl::readBytes(Sequence< sal_Int8 >& aData
if (aData.getLength() < nBytesToRead)
aData.realloc(nBytesToRead);
- sal_uInt32 nRead = m_pSvStream->Read(static_cast<void*>(aData.getArray()), nBytesToRead);
+ sal_uInt32 nRead = m_pSvStream->ReadBytes(static_cast<void*>(aData.getArray()), nBytesToRead);
checkError();
// Wenn gelesene Zeichen < MaxLength, Sequence anpassen
@@ -806,7 +806,7 @@ void UCBStorageStream_Impl::ReadSourceWriteTemporary()
do
{
aReaded = m_rSource->readBytes( aData, 32000 );
- m_pStream->Write( aData.getArray(), aReaded );
+ m_pStream->WriteBytes(aData.getArray(), aReaded);
} while( aReaded == 32000 );
}
catch (const Exception &e)
@@ -839,7 +839,7 @@ sal_uInt64 UCBStorageStream_Impl::ReadSourceWriteTemporary(sal_uInt64 aLength)
{
sal_uLong aToCopy = min( aLength - nInd, 32000 );
aReaded = m_rSource->readBytes( aData, aToCopy );
- aResult += m_pStream->Write( aData.getArray(), aReaded );
+ aResult += m_pStream->WriteBytes(aData.getArray(), aReaded);
}
if( aResult < aLength )
@@ -878,7 +878,7 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize )
// read data that is in temporary stream
- aResult = m_pStream->Read( pData, nSize );
+ aResult = m_pStream->ReadBytes( pData, nSize );
if( m_bSourceRead && aResult < nSize )
{
// read the tail of the data from original stream
@@ -891,7 +891,7 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize )
{
Sequence<sal_Int8> aData( aToRead );
sal_uLong aReaded = m_rSource->readBytes( aData, aToRead );
- aResult += m_pStream->Write( static_cast<void*>(aData.getArray()), aReaded );
+ aResult += m_pStream->WriteBytes(static_cast<void*>(aData.getArray()), aReaded);
memcpy( pData, aData.getArray(), aReaded );
}
catch (const Exception &e)
@@ -918,7 +918,7 @@ sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize )
if( !nSize || !Init() )
return 0;
- sal_uLong aResult = m_pStream->Write( pData, nSize );
+ sal_uLong aResult = m_pStream->WriteBytes( pData, nSize );
m_bModified = aResult > 0;