summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
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 /sw/source/filter/ww8
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 'sw/source/filter/ww8')
-rw-r--r--sw/source/filter/ww8/WW8FFData.cxx6
-rw-r--r--sw/source/filter/ww8/WW8Sttbf.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx12
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx12
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx6
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx28
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx34
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx10
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx8
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par.cxx28
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx4
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx26
15 files changed, 89 insertions, 101 deletions
diff --git a/sw/source/filter/ww8/WW8FFData.cxx b/sw/source/filter/ww8/WW8FFData.cxx
index 59d011396c1b..a0cf156cb6dc 100644
--- a/sw/source/filter/ww8/WW8FFData.cxx
+++ b/sw/source/filter/ww8/WW8FFData.cxx
@@ -89,7 +89,7 @@ void WW8FFData::Write(SvStream * pDataStrm)
0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
- pDataStrm->Write( aHeader, sizeof(aHeader) );
+ pDataStrm->WriteBytes(aHeader, sizeof(aHeader));
sal_uInt8 aData[10] = {
0xff, 0xff, 0xff, 0xff,
@@ -123,7 +123,7 @@ void WW8FFData::Write(SvStream * pDataStrm)
aData[8] = ::sal::static_int_cast<sal_uInt8>(mnCheckboxHeight & 0xffff);
aData[9] = ::sal::static_int_cast<sal_uInt8>(mnCheckboxHeight >> 8);
- pDataStrm->Write(aData, sizeof(aData));
+ pDataStrm->WriteBytes(aData, sizeof(aData));
WriteOUString(pDataStrm, msName, true);
@@ -141,7 +141,7 @@ void WW8FFData::Write(SvStream * pDataStrm)
if (mnType == 2)
{
sal_uInt8 aData1[2] = { 0xff, 0xff };
- pDataStrm->Write(aData1, sizeof(aData1));
+ pDataStrm->WriteBytes(aData1, sizeof(aData1));
sal_uInt32 nListboxEntries = msListEntries.size();
pDataStrm->WriteUInt32( nListboxEntries );
diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx b/sw/source/filter/ww8/WW8Sttbf.cxx
index d5b24b21d5ff..c3d1132ca0b2 100644
--- a/sw/source/filter/ww8/WW8Sttbf.cxx
+++ b/sw/source/filter/ww8/WW8Sttbf.cxx
@@ -37,7 +37,7 @@ namespace ww8
sal_Size nRemainingSize = rSt.remainingSize();
nSize = std::min<sal_uInt32>(nRemainingSize, nSize);
m_pData = o3tl::make_shared_array<sal_uInt8>(nSize);
- mn_size = rSt.Read(m_pData.get(), nSize);
+ mn_size = rSt.ReadBytes(m_pData.get(), nSize);
}
OSL_ENSURE(mn_size == nSize, "short read in WW8Struct::WW8Struct");
}
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 879f39a2d138..d1729a993c5e 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -230,11 +230,11 @@ void SwBasicEscherEx::WriteHyperlinkWithinFly( SvMemoryStream& rStrm, const SwFo
nFlags |= WW8_HLINK_BODY;
- tmpStrm.Write( aGuidFileMoniker,sizeof(aGuidFileMoniker) );
+ tmpStrm.WriteBytes(aGuidFileMoniker, sizeof(aGuidFileMoniker));
tmpStrm.WriteUInt16( nLevel );
SwWW8Writer::WriteLong(tmpStrm, aFileName.getLength()+1);
SwWW8Writer::WriteString8( tmpStrm, aFileName, true, RTL_TEXTENCODING_MS_1252 );
- tmpStrm.Write( aGuidFileTail,sizeof(aGuidFileTail) );
+ tmpStrm.WriteBytes(aGuidFileTail, sizeof(aGuidFileTail));
//For UNICODE
SwWW8Writer::WriteLong(tmpStrm, 2*aFileName.getLength()+6);
@@ -244,7 +244,7 @@ void SwBasicEscherEx::WriteHyperlinkWithinFly( SvMemoryStream& rStrm, const SwFo
}
else if( eProtocol != INetProtocol::NotValid )
{
- tmpStrm.Write( aGuidUrlMoniker,sizeof(aGuidUrlMoniker) );
+ tmpStrm.WriteBytes(aGuidUrlMoniker, sizeof(aGuidUrlMoniker));
SwWW8Writer::WriteLong(tmpStrm, 2*(rUrl.getLength()+1));
SwWW8Writer::WriteString16(tmpStrm, rUrl, true);
@@ -270,7 +270,7 @@ void SwBasicEscherEx::WriteHyperlinkWithinFly( SvMemoryStream& rStrm, const SwFo
nFlags |= WW8_HLINK_MARK;
}
- rStrm.Write( aGuidStdLink,16 );
+ rStrm.WriteBytes(aGuidStdLink, 16);
rStrm .WriteUInt32( 2 )
.WriteUInt32( nFlags );
tmpStrm.Seek( STREAM_SEEK_TO_BEGIN );
@@ -278,8 +278,8 @@ void SwBasicEscherEx::WriteHyperlinkWithinFly( SvMemoryStream& rStrm, const SwFo
if(nLen >0)
{
sal_uInt8* pBuffer = new sal_uInt8[ nLen ];
- tmpStrm.Read(pBuffer, nLen);
- rStrm.Write( pBuffer, nLen );
+ tmpStrm.ReadBytes(pBuffer, nLen);
+ rStrm.WriteBytes(pBuffer, nLen);
delete[] pBuffer;
}
}
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index cb571892d4db..e0e70be32563 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1022,13 +1022,13 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget
0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B
};
- m_rWW8Export.pDataStrm->Write( aURLData1, sizeof( aURLData1 ) );
+ m_rWW8Export.pDataStrm->WriteBytes(aURLData1, sizeof(aURLData1));
/* Write HFD Structure */
sal_uInt8 nAnchor = 0x00;
if ( !sMark.isEmpty() )
nAnchor = 0x08;
- m_rWW8Export.pDataStrm->Write( &nAnchor, 1 ); // HFDBits
- m_rWW8Export.pDataStrm->Write( MAGIC_A, sizeof(MAGIC_A) ); //clsid
+ m_rWW8Export.pDataStrm->WriteUChar(nAnchor); // HFDBits
+ m_rWW8Export.pDataStrm->WriteBytes(MAGIC_A, sizeof(MAGIC_A)); //clsid
/* Write Hyperlink Object see [MS-OSHARED] spec*/
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, 0x00000002);
@@ -1080,11 +1080,11 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget
sURL = sURL.copy( sizeof(pSmb)-3 ).replaceAll( "/", "\\" );
}
- m_rWW8Export.pDataStrm->Write( MAGIC_C, sizeof(MAGIC_C) );
+ m_rWW8Export.pDataStrm->WriteBytes(MAGIC_C, sizeof(MAGIC_C));
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, sURL.getLength()+1 );
SwWW8Writer::WriteString8( *m_rWW8Export.pDataStrm, sURL, true,
RTL_TEXTENCODING_MS_1252 );
- m_rWW8Export.pDataStrm->Write( MAGIC_D, sizeof( MAGIC_D ) );
+ m_rWW8Export.pDataStrm->WriteBytes(MAGIC_D, sizeof(MAGIC_D));
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, 2*sURL.getLength() + 6 );
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, 2*sURL.getLength() );
@@ -1102,7 +1102,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget
0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B
};
- m_rWW8Export.pDataStrm->Write( MAGIC_B, sizeof(MAGIC_B) );
+ m_rWW8Export.pDataStrm->WriteBytes(MAGIC_B, sizeof(MAGIC_B));
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, 2 * ( sURL.getLength() + 1 ) );
SwWW8Writer::WriteString16( *m_rWW8Export.pDataStrm, sURL, true );
}
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index b062c8a04436..6599d344e150 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -271,7 +271,7 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/,
// Write the rgbxchNums[9], positions of placeholders for paragraph
// numbers in the text
- m_rWW8Export.pTableStrm->Write( pNumLvlPos, WW8ListManager::nMaxLevel );
+ m_rWW8Export.pTableStrm->WriteBytes(pNumLvlPos, WW8ListManager::nMaxLevel);
// Type of the character between the bullet and the text
m_rWW8Export.pTableStrm->WriteUChar( nFollow );
@@ -333,11 +333,11 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/,
pData += 5;
Set_UInt16( pData, nListTabPos );
- m_rWW8Export.pTableStrm->Write( aPapSprms, sizeof( aPapSprms ));
+ m_rWW8Export.pTableStrm->WriteBytes(aPapSprms, sizeof(aPapSprms));
// write Chpx
if( !aCharAtrs.empty() )
- m_rWW8Export.pTableStrm->Write( aCharAtrs.data(), aCharAtrs.size() );
+ m_rWW8Export.pTableStrm->WriteBytes(aCharAtrs.data(), aCharAtrs.size());
// write the num string
SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, rNumberingString.getLength() );
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index bc52d44c2ab6..e7121afd7aa0 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -393,7 +393,7 @@ void WW8AttributeOutput::EndStyle()
p = &m_rWW8Export.pO->front() + nPOPosStdLen2;
ShortToSVBT16( nLen, p ); // dito
- m_rWW8Export.pTableStrm->Write( m_rWW8Export.pO->data(), m_rWW8Export.pO->size() ); // write it into the file
+ m_rWW8Export.pTableStrm->WriteBytes(m_rWW8Export.pO->data(), m_rWW8Export.pO->size());
m_rWW8Export.pO->clear();
}
@@ -567,13 +567,11 @@ void WW8AttributeOutput::DefaultStyle( sal_uInt16 nStyle )
{
if ( nStyle == 10 ) // Default Char-Style ( only WW )
{
- sal_uInt16 n = 0;
- m_rWW8Export.pTableStrm->Write( &n , 2 ); // empty Style
+ m_rWW8Export.pTableStrm->WriteUInt16(0); // empty Style
}
else
{
- sal_uInt16 n = 0;
- m_rWW8Export.pTableStrm->Write( &n , 2 ); // empty Style
+ m_rWW8Export.pTableStrm->WriteUInt16(0); // empty Style
}
}
@@ -661,7 +659,7 @@ void WW8AttributeOutput::StartStyles()
0x0F, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00 };
- m_rWW8Export.pTableStrm->Write( &aStShi, sizeof( aStShi ) );
+ m_rWW8Export.pTableStrm->WriteBytes(&aStShi, sizeof(aStShi));
}
void WW8AttributeOutput::EndStyles( sal_uInt16 nNumberOfStyles )
@@ -780,7 +778,7 @@ wwFont::wwFont(const OUString &rFamilyName, FontPitch ePitch, FontFamily eFamily
void wwFont::Write(SvStream *pTableStrm) const
{
- pTableStrm->Write(maWW8_FFN, sizeof(maWW8_FFN)); // fixed part
+ pTableStrm->WriteBytes(maWW8_FFN, sizeof(maWW8_FFN)); // fixed part
// ab Ver8 sind folgende beiden Felder eingeschoben,
// werden von uns ignoriert.
//char panose[ 10 ]; // 0x6 PANOSE
@@ -967,9 +965,7 @@ void WW8_WrPlc0::Write( SvStream& rStrm )
std::vector<sal_uLong>::const_iterator iter;
for( iter = aPos.begin(); iter != aPos.end(); ++iter )
{
- SVBT32 nP;
- UInt32ToSVBT32( *iter, nP );
- rStrm.Write( nP, 4 );
+ rStrm.WriteUInt32(*iter);
}
}
@@ -1829,11 +1825,9 @@ void WW8_WrPlcSepx::WriteSepx( SvStream& rStrm ) const
WW8_PdAttrDesc *const pA = rSectionAttribute.get();
if (pA->m_nLen && pA->m_pData != nullptr)
{
- SVBT16 nL;
pA->m_nSepxFcPos = rStrm.Tell();
- ShortToSVBT16( pA->m_nLen, nL );
- rStrm.Write( nL, 2 );
- rStrm.Write( pA->m_pData.get(), pA->m_nLen );
+ rStrm.WriteUInt16(pA->m_nLen);
+ rStrm.WriteBytes(pA->m_pData.get(), pA->m_nLen);
}
}
}
@@ -1849,9 +1843,7 @@ void WW8_WrPlcSepx::WritePlcSed( WW8Export& rWrt ) const
for( i = 0; i <= aSects.size(); i++ )
{
sal_uInt32 nP = aCps[i];
- SVBT32 nPos;
- UInt32ToSVBT32( nP, nPos );
- rWrt.pTableStrm->Write( nPos, 4 );
+ rWrt.pTableStrm->WriteUInt32(nP);
}
static WW8_SED aSed = {{4, 0},{0, 0, 0, 0},{0, 0},{0xff, 0xff, 0xff, 0xff}};
@@ -1860,7 +1852,7 @@ void WW8_WrPlcSepx::WritePlcSed( WW8Export& rWrt ) const
{
// Sepx-Pos
UInt32ToSVBT32( rSectionAttribute->m_nSepxFcPos, aSed.fcSepx );
- rWrt.pTableStrm->Write( &aSed, sizeof( aSed ) );
+ rWrt.pTableStrm->WriteBytes(&aSed, sizeof(aSed));
}
rWrt.pFib->fcPlcfsed = nFcStart;
rWrt.pFib->lcbPlcfsed = rWrt.pTableStrm->Tell() - nFcStart;
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 278cec8760e5..d1c073d2a140 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -857,7 +857,7 @@ void WW8_WrPlc1::Write( SvStream& rStrm )
for( i = 0; i < aPos.size(); ++i )
SwWW8Writer::WriteLong( rStrm, aPos[i] );
if( i )
- rStrm.Write( pData, (i-1) * nStructSiz );
+ rStrm.WriteBytes(pData, (i-1) * nStructSiz);
}
// Class WW8_WrPlcField for fields
@@ -953,10 +953,10 @@ void SwWW8Writer::FillCount( SvStream& rStrm, sal_uLong nCount )
while (nCount > 64)
{
- rStrm.Write( aNulls, 64 ); // in steps of 64-Byte
+ rStrm.WriteBytes(aNulls, 64); // in steps of 64-Byte
nCount -= 64;
}
- rStrm.Write( aNulls, nCount ); // write the rest ( 0 .. 64 Bytes )
+ rStrm.WriteBytes(aNulls, nCount); // write the rest (0 .. 64 Bytes)
}
sal_uLong SwWW8Writer::FillUntil( SvStream& rStrm, sal_uLong nEndPos )
@@ -1008,7 +1008,7 @@ void WW8_WrPlcPn::AppendFkpEntry(WW8_FC nEndFc,short nVarLen,const sal_uInt8* pS
long nDataPos = rWrt.pDataStrm->Tell();
SwWW8Writer::WriteShort( *rWrt.pDataStrm, nVarLen );
- rWrt.pDataStrm->Write( pSprms, nVarLen );
+ rWrt.pDataStrm->WriteBytes(pSprms, nVarLen);
Set_UInt16( p, 0x6646 ); // set SprmCode
Set_UInt32( p, nDataPos ); // set startpos (FC) in the datastream
@@ -1279,7 +1279,7 @@ void WW8_WrFkp::Write( SvStream& rStrm, SwWW8WrGrf& rGrf )
UInt32ToSVBT32( rGrf.GetFPos(), nPos ); // FilePos the graphics
memcpy( p, nPos, 4 ); // patch FilePos over the signature
}
- rStrm.Write( pFkp, 512 );
+ rStrm.WriteBytes(pFkp, 512);
}
void WW8_WrFkp::MergeToNew( short& rVarLen, sal_uInt8 *& rpNewSprms )
@@ -1770,7 +1770,7 @@ void SwWW8Writer::WriteString16(SvStream& rStrm, const OUString& rStr,
//vectors are guaranteed to have contiguous memory, so we can do
//this while migrating away from WW8Bytes. Meyers Effective STL, item 16
if (!aBytes.empty())
- rStrm.Write(&aBytes[0], aBytes.size());
+ rStrm.WriteBytes(&aBytes[0], aBytes.size());
}
void SwWW8Writer::WriteString_xstz(SvStream& rStrm, const OUString& rStr, bool bAddZero)
@@ -1780,7 +1780,7 @@ void SwWW8Writer::WriteString_xstz(SvStream& rStrm, const OUString& rStr, bool b
SwWW8Writer::InsAsString16(aBytes, rStr);
if (bAddZero)
SwWW8Writer::InsUInt16(aBytes, 0);
- rStrm.Write(&aBytes[0], aBytes.size());
+ rStrm.WriteBytes(&aBytes[0], aBytes.size());
}
void SwWW8Writer::WriteString8(SvStream& rStrm, const OUString& rStr,
@@ -1793,7 +1793,7 @@ void SwWW8Writer::WriteString8(SvStream& rStrm, const OUString& rStr,
//vectors are guaranteed to have contiguous memory, so we can do
////this while migrating away from WW8Bytes. Meyers Effective STL, item 16
if (!aBytes.empty())
- rStrm.Write(&aBytes[0], aBytes.size());
+ rStrm.WriteBytes(&aBytes[0], aBytes.size());
}
void WW8Export::WriteStringAsPara( const OUString& rText )
@@ -3058,10 +3058,10 @@ namespace
for (sal_Size nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock)
{
sal_Size nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI;
- nBS = rIn.Read(in, nBS);
+ nBS = rIn.ReadBytes(in, nBS);
rCtx.InitCipher(nBlock);
rCtx.Encode(in, nBS, in, nBS);
- rOut.Write(in, nBS);
+ rOut.WriteBytes(in, nBS);
}
}
}
@@ -3235,7 +3235,7 @@ void WW8Export::ExportDocument_Impl()
pDataStrm = aTempData.GetStream( STREAM_READWRITE | StreamMode::SHARE_DENYWRITE );
sal_uInt8 aRC4EncryptionHeader[ 52 ] = {0};
- pTableStrm->Write( aRC4EncryptionHeader, 52 );
+ pTableStrm->WriteBytes(aRC4EncryptionHeader, 52);
}
// Default: "Standard"
@@ -3313,9 +3313,9 @@ void WW8Export::ExportDocument_Impl()
sal_uInt8 pSaltDigest[16];
aCtx.GetEncryptKey( pDocId, pSaltData, pSaltDigest );
- pTableStrmTemp->Write( pDocId, 16 );
- pTableStrmTemp->Write( pSaltData, 16 );
- pTableStrmTemp->Write( pSaltDigest, 16 );
+ pTableStrmTemp->WriteBytes(pDocId, 16);
+ pTableStrmTemp->WriteBytes(pSaltData, 16);
+ pTableStrmTemp->WriteBytes(pSaltDigest, 16);
EncryptRC4(aCtx, GetWriter().Strm(), *pStrmTemp);
@@ -3399,7 +3399,7 @@ void WW8Export::PrepareStorage()
GetWriter().GetStorage().SetClass(
aGName, SotClipboardFormatId::NONE, "Microsoft Word-Document");
tools::SvRef<SotStorageStream> xStor( GetWriter().GetStorage().OpenSotStream(sCompObj) );
- xStor->Write( pData, sizeof( pData ) );
+ xStor->WriteBytes(pData, sizeof(pData));
SwDocShell* pDocShell = m_pDoc->GetDocShell ();
OSL_ENSURE(pDocShell, "no SwDocShell");
@@ -3712,7 +3712,7 @@ void WW8Export::RestoreMacroCmds()
sal_uInt8 *pBuffer = new sal_uInt8[pFib->lcbCmds];
bool bReadOk = checkRead(*pStream, pBuffer, pFib->lcbCmds);
if (bReadOk)
- pTableStrm->Write(pBuffer, pFib->lcbCmds);
+ pTableStrm->WriteBytes(pBuffer, pFib->lcbCmds);
delete[] pBuffer;
}
@@ -3867,7 +3867,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark )
int len = sizeof( aFieldData );
OSL_ENSURE( len == 0x44-sizeof(sal_uInt32), "SwWW8Writer::WriteFormData(..) - wrong aFieldData length" );
- pDataStrm->Write( aFieldData, len );
+ pDataStrm->WriteBytes( aFieldData, len );
pDataStrm->WriteUInt32( aFieldHeader.version ).WriteUInt16( aFieldHeader.bits ).WriteUInt16( aFieldHeader.cch ).WriteUInt16( aFieldHeader.hps );
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 35122b2eeab1..e8b9aa0dce40 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -252,7 +252,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode )
tools::SvRef<SotStorageStream> rObjInfoStream = xOleStg->OpenSotStream( aObjInfo );
if ( rObjInfoStream.Is() && !rObjInfoStream->GetError() )
{
- rObjInfoStream->Write( pObjInfoData, sizeof( pObjInfoData ) );
+ rObjInfoStream->WriteBytes(pObjInfoData, sizeof(pObjInfoData));
xOleStg->Commit();
}
}
@@ -650,7 +650,7 @@ void SwWW8WrGrf::WritePICFHeader(SvStream& rStrm, const ww8::Frame &rFly,
Set_UInt16( pArr, nCropB ); // set dyaCropBottom
}
- rStrm.Write( aArr, nHdrLen );
+ rStrm.WriteBytes(aArr, nHdrLen);
}
void SwWW8WrGrf::WriteGrfFromGrfNode(SvStream& rStrm, const SwGrfNode &rGrfNd,
@@ -763,7 +763,7 @@ void SwWW8WrGrf::WritePICBulletFHeader(SvStream& rStrm, const Graphic &rGrf,
Set_UInt16( pArr, nCropR ); // set dxaCropRight
Set_UInt16( pArr, nCropB ); // set dyaCropBottom
- rStrm.Write( aArr, nHdrLen );
+ rStrm.WriteBytes(aArr, nHdrLen);
}
void SwWW8WrGrf::WriteGrfForBullet(SvStream& rStrm, const Graphic &rGrf, sal_uInt16 nWidth, sal_uInt16 nHeight)
@@ -869,9 +869,7 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem)
sal_uInt32 nPos2 = rStrm.Tell(); // store the end
rStrm.Seek( nPos );
- SVBT32 nLen;
- UInt32ToSVBT32( nPos2 - nPos, nLen ); // calculate graphic length
- rStrm.Write( nLen, 4 ); // patch it in the header
+ rStrm.WriteUInt32(nPos2 - nPos); // patch graphic length in the header
rStrm.Seek( nPos2 ); // restore Pos
}
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index a987d145e4d1..d904b5661cb6 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1583,7 +1583,7 @@ static void InsertSpecialChar( WW8Export& rWrt, sal_uInt8 c,
const sal_uInt16 nEmptyHdrLen = 0x44;
sal_uInt8 aEmptyHeader[ nEmptyHdrLen ] = { 0 };
aEmptyHeader[ 4 ] = 0x44;
- rStrm.Write( aEmptyHeader, nEmptyHdrLen );
+ rStrm.WriteBytes( aEmptyHeader, nEmptyHdrLen );
// writer fixed header
const sal_uInt16 nFixHdrLen = 0x19;
sal_uInt8 aFixHeader[ nFixHdrLen ] =
@@ -1593,7 +1593,7 @@ static void InsertSpecialChar( WW8Export& rWrt, sal_uInt8 c,
0x0B, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00,
};
- rStrm.Write( aFixHeader, nFixHdrLen );
+ rStrm.WriteBytes( aFixHeader, nFixHdrLen );
// write reference string including length+1
sal_uInt32 nStrLen( pLinkStr->getLength() + 1 );
SwWW8Writer::WriteLong( rStrm, nStrLen );
@@ -1603,9 +1603,7 @@ static void InsertSpecialChar( WW8Export& rWrt, sal_uInt8 c,
// write length of hyperlink data
const sal_uInt32 nCurrPos = rStrm.Tell();
rStrm.Seek( nLinkPosInDataStrm );
- SVBT32 nLen;
- UInt32ToSVBT32( nCurrPos - nLinkPosInDataStrm, nLen );
- rStrm.Write( nLen, 4 );
+ rStrm.WriteUInt32(nCurrPos - nLinkPosInDataStrm);
rStrm.Seek( nCurrPos );
// write attributes of hyperlink character 0x01
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index e4a5f382c59b..04b5394408a5 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -444,10 +444,10 @@ void SwWW8ImplReader::PicRead(SvStream *pDataStream, WW8_PIC *pPic,
{
//Only the first 0x2e bytes are the same between version 6/7 and 8+
WW8_PIC_SHADOW aPicS;
- pDataStream->Read( &aPicS, sizeof( aPicS ) );
+ pDataStream->ReadBytes( &aPicS, sizeof( aPicS ) );
WW8PicShadowToReal( &aPicS, pPic );
for (WW8_BRC & i : pPic->rgbrc)
- pDataStream->Read( &i, bVer67 ? 2 : 4);
+ pDataStream->ReadBytes(&i, bVer67 ? 2 : 4);
pDataStream->ReadInt16( pPic->dxaOrigin );
pDataStream->ReadInt16( pPic->dyaOrigin );
if (!bVer67)
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0719b4c79c28..c072c8346001 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -287,7 +287,7 @@ void SwWW8ImplReader::ReadEmbeddedData( SvMemoryStream& rStrm, SwDocShell* pDocS
sal_uInt8 aGuid[16];
sal_uInt32 nFlags(0);
- rStrm.Read(aGuid, 16);
+ rStrm.ReadBytes(aGuid, 16);
rStrm.SeekRel( 4 );
rStrm.ReadUInt32( nFlags );
@@ -318,7 +318,7 @@ void SwWW8ImplReader::ReadEmbeddedData( SvMemoryStream& rStrm, SwDocShell* pDocS
// file link or URL
else if( ::get_flag( nFlags, WW8_HLINK_BODY ) )
{
- rStrm.Read( aGuid, 16);
+ rStrm.ReadBytes(aGuid, 16);
if( (memcmp(aGuid, aGuidFileMoniker, 16) == 0) )
{
@@ -1157,9 +1157,9 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
::std::vector< sal_uInt8 > aBuffer( nBufferSize );
sal_uInt8* pnData = &aBuffer.front();
sal_uInt8 nStreamSize;
- if( pnData && rSt.Read( pnData, nBufferSize ) == nBufferSize )
+ if (pnData && rSt.ReadBytes(pnData, nBufferSize) == nBufferSize)
{
- aMemStream.Write( pnData, nBufferSize );
+ aMemStream.WriteBytes(pnData, nBufferSize);
aMemStream.Seek( STREAM_SEEK_TO_END );
nStreamSize = aMemStream.Tell();
aMemStream.Seek( STREAM_SEEK_TO_BEGIN );
@@ -4689,8 +4689,8 @@ void SwWW8ImplReader::StoreMacroCmds()
sal_uInt32 lcbCmds = std::min<sal_uInt32>(m_pWwFib->lcbCmds, m_pTableStream->remainingSize());
std::unique_ptr<sal_uInt8[]> xBuffer(new sal_uInt8[lcbCmds]);
- m_pWwFib->lcbCmds = m_pTableStream->Read(xBuffer.get(), lcbCmds);
- xOutStream->Write(xBuffer.get(), m_pWwFib->lcbCmds);
+ m_pWwFib->lcbCmds = m_pTableStream->ReadBytes(xBuffer.get(), lcbCmds);
+ xOutStream->WriteBytes(xBuffer.get(), m_pWwFib->lcbCmds);
}
catch (...)
{
@@ -5487,10 +5487,10 @@ namespace
for (sal_Size nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock)
{
sal_Size nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI;
- nBS = rIn.Read(in, nBS);
+ nBS = rIn.ReadBytes(in, nBS);
rCtx.InitCipher(nBlock);
rCtx.Decode(in, nBS, in, nBS);
- rOut.Write(in, nBS);
+ rOut.WriteBytes(in, nBS);
}
}
@@ -5508,9 +5508,9 @@ namespace
for (sal_Size nI = nSt; nI < nLen; nI += 0x4096)
{
sal_Size nBS = (nLen - nI > 0x4096 ) ? 0x4096 : nLen - nI;
- nBS = rIn.Read(in, nBS);
+ nBS = rIn.ReadBytes(in, nBS);
rCtx.Decode(in, nBS);
- rOut.Write(in, nBS);
+ rOut.WriteBytes(in, nBS);
}
}
@@ -5714,8 +5714,8 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss)
size_t nUnencryptedHdr =
(8 == m_pWwFib->nVersion) ? 0x44 : 0x34;
sal_uInt8 *pIn = new sal_uInt8[nUnencryptedHdr];
- nUnencryptedHdr = m_pStrm->Read(pIn, nUnencryptedHdr);
- aDecryptMain.Write(pIn, nUnencryptedHdr);
+ nUnencryptedHdr = m_pStrm->ReadBytes(pIn, nUnencryptedHdr);
+ aDecryptMain.WriteBytes(pIn, nUnencryptedHdr);
delete [] pIn;
DecryptXOR(aCtx, *m_pStrm, aDecryptMain);
@@ -5768,12 +5768,12 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss)
m_pStrm->Seek(0);
sal_Size nUnencryptedHdr = 0x44;
sal_uInt8 *pIn = new sal_uInt8[nUnencryptedHdr];
- nUnencryptedHdr = m_pStrm->Read(pIn, nUnencryptedHdr);
+ nUnencryptedHdr = m_pStrm->ReadBytes(pIn, nUnencryptedHdr);
DecryptRC4(aCtx, *m_pStrm, aDecryptMain);
aDecryptMain.Seek(0);
- aDecryptMain.Write(pIn, nUnencryptedHdr);
+ aDecryptMain.WriteBytes(pIn, nUnencryptedHdr);
delete [] pIn;
pTempTable = MakeTemp(aDecryptTable);
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 2259939b0e5f..77c9d319e446 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -3591,7 +3591,7 @@ void WW8RStyle::ImportSprms(sal_Size nPosFc, short nLen, bool bPap)
if (checkSeek(*pStStrm, nPosFc))
{
sal_uInt8 *pSprms = new sal_uInt8[nLen];
- nLen = pStStrm->Read(pSprms, nLen);
+ nLen = pStStrm->ReadBytes(pSprms, nLen);
ImportSprms(pSprms, nLen, bPap);
delete[] pSprms;
}
@@ -3602,7 +3602,7 @@ static inline short WW8SkipOdd(SvStream* pSt )
if ( pSt->Tell() & 0x1 )
{
sal_uInt8 c;
- return pSt->Read( &c, 1 );
+ return pSt->ReadBytes( &c, 1 );
}
return 0;
}
@@ -3612,7 +3612,7 @@ static inline short WW8SkipEven(SvStream* pSt )
if (!(pSt->Tell() & 0x1))
{
sal_uInt8 c;
- return pSt->Read( &c, 1 );
+ return pSt->ReadBytes( &c, 1 );
}
return 0;
}
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 4882660c1f68..7f2a884e0ee4 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -575,7 +575,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, SfxItemSet*& rpItemSet,
if( aLVL.nLenGrpprlPapx )
{
sal_uInt8 aGrpprlPapx[ 255 ];
- if(aLVL.nLenGrpprlPapx != rSt.Read(&aGrpprlPapx,aLVL.nLenGrpprlPapx))
+ if (aLVL.nLenGrpprlPapx != rSt.ReadBytes(&aGrpprlPapx, aLVL.nLenGrpprlPapx))
return false;
// "sprmPDxaLeft" pap.dxaLeft;dxa;word;
sal_uInt8* pSprm;
@@ -675,7 +675,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, SfxItemSet*& rpItemSet,
{
sal_uInt8 aGrpprlChpx[ 255 ];
memset(&aGrpprlChpx, 0, sizeof( aGrpprlChpx ));
- if(aLVL.nLenGrpprlChpx != rSt.Read(&aGrpprlChpx, aLVL.nLenGrpprlChpx))
+ if (aLVL.nLenGrpprlChpx != rSt.ReadBytes(&aGrpprlChpx, aLVL.nLenGrpprlChpx))
return false;
//For i120928,parse the graphic info of bullets
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 70932d4e2b10..7c02c895b8ee 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -131,7 +131,7 @@ static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp,
STREAM_STD_READ );
SotStorageStream* pSt = xSrc2;
pSt->SetEndian( SvStreamEndian::LITTLE );
- sal_uLong nRead = pSt->Read( pMfp, sizeof(*pMfp ) );
+ size_t const nRead = pSt->ReadBytes(pMfp, sizeof(*pMfp));
// read mini-placable-header
if (nRead != sizeof(*pMfp))
return false;
@@ -185,7 +185,7 @@ static bool SwWw6ReadMacPICTStream(Graphic& rGraph, tools::SvRef<SotStorage>& rS
SotStorageStream* pStp = xSrc4;
pStp->SetEndian( SvStreamEndian::LITTLE );
sal_uInt8 aTestA[10]; // Does the 01Ole-stream even exist?
- sal_uLong nReadTst = pStp->Read( aTestA, sizeof( aTestA ) );
+ size_t const nReadTst = pStp->ReadBytes(aTestA, sizeof(aTestA));
if (nReadTst != sizeof(aTestA))
return false;
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 6bf744e2669d..545605da7ea3 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1674,7 +1674,7 @@ WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTableSt,
if (checkSeek(*pTableSt, pWwFib->fcAtrdExtra) && (pTableSt->remainingSize() >= pWwFib->lcbAtrdExtra))
{
pExtendedAtrds = new sal_uInt8[pWwFib->lcbAtrdExtra];
- pWwFib->lcbAtrdExtra = pTableSt->Read(pExtendedAtrds, pWwFib->lcbAtrdExtra);
+ pWwFib->lcbAtrdExtra = pTableSt->ReadBytes(pExtendedAtrds, pWwFib->lcbAtrdExtra);
}
else
pWwFib->lcbAtrdExtra = 0;
@@ -1939,7 +1939,7 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, sal_uInt32 nFilePos,
pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ];
pPLCF_PosArray[0] = 0;
- nPLCF = bValid ? pSt->Read(pPLCF_PosArray, nPLCF) : nValidMin;
+ nPLCF = bValid ? pSt->ReadBytes(pPLCF_PosArray, nPLCF) : nValidMin;
nPLCF = std::max(nPLCF, nValidMin);
@@ -2287,7 +2287,7 @@ WW8PLCFpcd::WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos,
pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ]; // Pointer to Pos-array
pPLCF_PosArray[0] = 0;
- nPLCF = bValid ? pSt->Read(pPLCF_PosArray, nPLCF) : nValidMin;
+ nPLCF = bValid ? pSt->ReadBytes(pPLCF_PosArray, nPLCF) : nValidMin;
nPLCF = std::max(nPLCF, nValidMin);
nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
@@ -2557,7 +2557,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt,
new sal_uInt8[aEntry.mnLen + nOrigLen];
aEntry.mbMustDelete = true;
aEntry.mnLen =
- pDataSt->Read(aEntry.mpData, aEntry.mnLen);
+ pDataSt->ReadBytes(aEntry.mpData, aEntry.mnLen);
pDataSt->Seek( nCurr );
@@ -3456,7 +3456,7 @@ void WW8PLCFx_SEPX::GetSprms(WW8PLCFxDesc* p)
nArrMax = nSprmSiz; // Get more memory
pSprms = new sal_uInt8[nArrMax];
}
- nSprmSiz = pStrm->Read(pSprms, nSprmSiz); // read Sprms
+ nSprmSiz = pStrm->ReadBytes(pSprms, nSprmSiz); // read Sprms
p->nSprmsLen = nSprmSiz;
p->pMemPos = pSprms; // return Position
@@ -3871,7 +3871,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen
if (pExtraArray)
{
ww::bytes extraData(nExtraLen);
- rStrm.Read(extraData.data(), nExtraLen);
+ rStrm.ReadBytes(extraData.data(), nExtraLen);
pExtraArray->push_back(extraData);
}
else
@@ -3927,7 +3927,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen
if (pExtraArray)
{
ww::bytes extraData(nExtraLen);
- rStrm.Read(extraData.data(), nExtraLen);
+ rStrm.ReadBytes(extraData.data(), nExtraLen);
pExtraArray->push_back(extraData);
}
else
@@ -6006,7 +6006,7 @@ void WW8Fib::WriteHeader(SvStream& rStrm)
// Marke: "rglw" Beginning of the array of longs
Set_UInt32( pData, cbMac );
- rStrm.Write( pDataPtr, nUnencryptedHdr );
+ rStrm.WriteBytes(pDataPtr, nUnencryptedHdr);
delete[] pDataPtr;
}
@@ -6250,7 +6250,7 @@ void WW8Fib::Write(SvStream& rStrm)
Set_UInt32( pData, 0);
}
- rStrm.Write( pDataPtr, fcMin - nUnencryptedHdr );
+ rStrm.WriteBytes(pDataPtr, fcMin - nUnencryptedHdr);
delete[] pDataPtr;
}
@@ -6839,7 +6839,7 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
rSt.SeekRel( 2 );
// read all font information
- nFFn = rSt.Read(pA, nFFn);
+ nFFn = rSt.ReadBytes(pA, nFFn);
sal_uInt8 * const pEnd = pA + nFFn;
const sal_uInt16 nCalcMax = calcMaxFonts(pA, nFFn);
@@ -7169,7 +7169,7 @@ WW8Dop::WW8Dop(SvStream& rSt, sal_Int16 nFib, sal_Int32 nPos, sal_uInt32 nSize)
sal_uInt8* pData = pDataPtr;
sal_uInt32 nRead = nMaxDopSize < nSize ? nMaxDopSize : nSize;
- if (nSize < 2 || !checkSeek(rSt, nPos) || nRead != rSt.Read(pData, nRead))
+ if (nSize < 2 || !checkSeek(rSt, nPos) || nRead != rSt.ReadBytes(pData, nRead))
nDopError = ERR_SWG_READ_ERROR; // report error
else
{
@@ -7781,7 +7781,7 @@ void WW8Dop::Write(SvStream& rStrm, WW8Fib& rFib) const
a16Bit = 0x0080;
Set_UInt16(pData, a16Bit);
}
- rStrm.Write( aData, nLen );
+ rStrm.WriteBytes(aData, nLen);
}
void WW8DopTypography::ReadFromMem(sal_uInt8 *&pData)
@@ -8021,7 +8021,7 @@ bool checkSeek(SvStream &rSt, sal_uInt32 nOffset)
bool checkRead(SvStream &rSt, void *pDest, sal_uInt32 nLength)
{
- return (rSt.Read(pDest, nLength) == static_cast<sal_Size>(nLength));
+ return (rSt.ReadBytes(pDest, nLength) == static_cast<sal_Size>(nLength));
}
#ifdef OSL_BIGENDIAN