diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-06-03 14:45:59 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-06-06 18:09:11 +0000 |
commit | 62d270116bf34778bf581f21b27fa9cdbff7de0e (patch) | |
tree | 0402df0506ab8f6825ef497f27426f01d2e01850 /filter | |
parent | Normalize on using @throws instead of @raise[s] (diff) | |
download | core-62d270116bf34778bf581f21b27fa9cdbff7de0e.tar.gz core-62d270116bf34778bf581f21b27fa9cdbff7de0e.zip |
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 'filter')
20 files changed, 95 insertions, 94 deletions
diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx index 7e58b2174cfe..b91c0f363c86 100644 --- a/filter/source/flash/swfwriter.cxx +++ b/filter/source/flash/swfwriter.cxx @@ -120,7 +120,7 @@ void ImplCopySvStreamToXOutputStream( SvStream& rIn, Reference< XOutputStream > aBuffer.realloc( nSize ); } - sal_uInt32 nRead = rIn.Read( aBuffer.getArray(), nBufferSize ); + sal_uInt32 nRead = rIn.ReadBytes(aBuffer.getArray(), nBufferSize); DBG_ASSERT( nRead == nBufferSize, "ImplCopySvStreamToXOutputStream failed!" ); xOut->writeBytes( aBuffer ); diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index 09246d6cc578..64c234b958bf 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -963,7 +963,7 @@ void Writer::Impl_writeBmp( sal_uInt16 nBitmapId, sal_uInt32 width, sal_uInt32 h mpTag->addUI16( uInt16_(width) ); mpTag->addUI16( uInt16_(height) ); - mpTag->Write( pCompressed, compressed_size ); + mpTag->WriteBytes(pCompressed, compressed_size); endTag(); } @@ -1030,8 +1030,8 @@ void Writer::Impl_writeJPEG(sal_uInt16 nBitmapId, const sal_uInt8* pJpgData, sal { case 0xD8: case 0xD9: - EncodingTableStream.Write( pJpgSearch, nLength ); - ImageBitsStream.Write( pJpgSearch, nLength ); + EncodingTableStream.WriteBytes(pJpgSearch, nLength); + ImageBitsStream.WriteBytes(pJpgSearch, nLength); break; case 0x01: @@ -1039,7 +1039,7 @@ void Writer::Impl_writeJPEG(sal_uInt16 nBitmapId, const sal_uInt8* pJpgData, sal case 0xDC: case 0xDD: case 0xC4: - EncodingTableStream.Write( pJpgSearch, nLength ); + EncodingTableStream.WriteBytes(pJpgSearch, nLength); break; case 0xC0: @@ -1058,7 +1058,7 @@ void Writer::Impl_writeJPEG(sal_uInt16 nBitmapId, const sal_uInt8* pJpgData, sal case 0xCF: case 0xDA: case 0xE0: - ImageBitsStream.Write( pJpgSearch, nLength ); + ImageBitsStream.WriteBytes(pJpgSearch, nLength); break; default: @@ -1084,10 +1084,10 @@ void Writer::Impl_writeJPEG(sal_uInt16 nBitmapId, const sal_uInt8* pJpgData, sal mpTag->addUI32( nEncodingTableSize + nImageBitsSize ); - mpTag->Write(EncodingTableStream.GetData(), nEncodingTableSize); - mpTag->Write(ImageBitsStream.GetData(), nImageBitsSize); + mpTag->WriteBytes(EncodingTableStream.GetData(), nEncodingTableSize); + mpTag->WriteBytes(ImageBitsStream.GetData(), nImageBitsSize); - mpTag->Write( pAlphaCompressed, alpha_compressed_size ); + mpTag->WriteBytes(pAlphaCompressed, alpha_compressed_size); endTag(); } @@ -1097,8 +1097,8 @@ void Writer::Impl_writeJPEG(sal_uInt16 nBitmapId, const sal_uInt8* pJpgData, sal mpTag->addUI16( nBitmapId ); - mpTag->Write(EncodingTableStream.GetData(), nEncodingTableSize); - mpTag->Write(ImageBitsStream.GetData(), nImageBitsSize); + mpTag->WriteBytes(EncodingTableStream.GetData(), nEncodingTableSize); + mpTag->WriteBytes(ImageBitsStream.GetData(), nImageBitsSize); endTag(); } diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx index 4d6683eff79c..2b2e8c1d39e0 100644 --- a/filter/source/flash/swfwriter2.cxx +++ b/filter/source/flash/swfwriter2.cxx @@ -159,7 +159,7 @@ void Tag::write( SvStream &out ) } } - out.Write( GetData(), nSz ); + out.WriteBytes( GetData(), nSz ); } #if 0 diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx index 8e26156e0f24..5955b8f1035f 100644 --- a/filter/source/graphicfilter/egif/egif.cxx +++ b/filter/source/graphicfilter/egif/egif.cxx @@ -286,7 +286,7 @@ void GIFWriter::WriteSignature( bool bGIF89a ) { if( bStatus ) { - m_rGIF.Write( bGIF89a ? "GIF89a" : "GIF87a" , 6 ); + m_rGIF.WriteBytes(bGIF89a ? "GIF89a" : "GIF87a" , 6); if( m_rGIF.GetError() ) bStatus = false; @@ -345,7 +345,7 @@ void GIFWriter::WriteLoopExtension( const Animation& rAnimation ) m_rGIF.WriteUChar( 0x21 ); m_rGIF.WriteUChar( 0xff ); m_rGIF.WriteUChar( 0x0b ); - m_rGIF.Write( "NETSCAPE2.0", 11 ); + m_rGIF.WriteBytes( "NETSCAPE2.0", 11 ); m_rGIF.WriteUChar( 0x03 ); m_rGIF.WriteUChar( 0x01 ); m_rGIF.WriteUChar( cLoByte ); @@ -363,7 +363,7 @@ void GIFWriter::WriteLogSizeExtension( const Size& rSize100 ) m_rGIF.WriteUChar( 0x21 ); m_rGIF.WriteUChar( 0xff ); m_rGIF.WriteUChar( 0x0b ); - m_rGIF.Write( "STARDIV 5.0", 11 ); + m_rGIF.WriteBytes( "STARDIV 5.0", 11 ); m_rGIF.WriteUChar( 0x09 ); m_rGIF.WriteUChar( 0x01 ); m_rGIF.WriteUInt32( rSize100.Width() ); diff --git a/filter/source/graphicfilter/egif/giflzwc.cxx b/filter/source/graphicfilter/egif/giflzwc.cxx index 7f5709a5ad62..3c2a62f46c26 100644 --- a/filter/source/graphicfilter/egif/giflzwc.cxx +++ b/filter/source/graphicfilter/egif/giflzwc.cxx @@ -94,7 +94,7 @@ void GIFImageDataOutputStream::FlushBlockBuf() if( nBlockBufSize ) { rStream.WriteUChar( nBlockBufSize ); - rStream.Write( pBlockBuf,nBlockBufSize ); + rStream.WriteBytes(pBlockBuf, nBlockBufSize); nBlockBufSize = 0; } } diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index c22e4695cf54..14a3c878ac22 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -1173,7 +1173,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) ImplWriteLine( "gs" ); ImplGetMapMode( aMapMode ); ImplWriteLine( "%%BeginDocument:" ); - mpPS->Write( pSource, aGfxLink.GetDataSize() ); + mpPS->WriteBytes(pSource, aGfxLink.GetDataSize()); ImplWriteLine( "%%EndDocument\ngr" ); } } diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index 30804b06845f..00d3ceca3567 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -675,7 +675,7 @@ bool CGM::Write( SvStream& rIStm ) mnParaSize = 0; mpSource = mpBuf; - if (rIStm.Read(mpSource, 2) != 2) + if (rIStm.ReadBytes(mpSource, 2) != 2) return false; mpEndValidSource = mpSource + 2; mnEscape = ImplGetUI16(); @@ -685,7 +685,7 @@ bool CGM::Write( SvStream& rIStm ) if ( mnElementSize == 31 ) { - if (rIStm.Read(mpSource + mnParaSize, 2) != 2) + if (rIStm.ReadBytes(mpSource + mnParaSize, 2) != 2) return false; mpEndValidSource = mpSource + mnParaSize + 2; mnElementSize = ImplGetUI16(); @@ -693,7 +693,7 @@ bool CGM::Write( SvStream& rIStm ) mnParaSize = 0; if (mnElementSize) { - if (rIStm.Read(mpSource, mnElementSize) != mnElementSize) + if (rIStm.ReadBytes(mpSource, mnElementSize) != mnElementSize) return false; mpEndValidSource = mpSource + mnElementSize; } diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.cxx b/filter/source/graphicfilter/idxf/dxfgrprd.cxx index ac1ca2d994fc..44672ed5e29e 100644 --- a/filter/source/graphicfilter/idxf/dxfgrprd.cxx +++ b/filter/source/graphicfilter/idxf/dxfgrprd.cxx @@ -39,7 +39,7 @@ OString DXFReadLine(SvStream& rIStm) while( !bEnd && !rIStm.GetError() ) // !!! do not check for EOF // !!! because we read blockwise { - sal_uInt16 nLen = (sal_uInt16)rIStm.Read( buf, sizeof(buf)-1 ); + sal_uInt16 nLen = static_cast<sal_uInt16>(rIStm.ReadBytes(buf, sizeof(buf)-1)); if( !nLen ) { if( aBuf.isEmpty() ) @@ -76,7 +76,7 @@ OString DXFReadLine(SvStream& rIStm) if( bEnd && (c=='\r' || c=='\n')) // special treatment of DOS files { char cTemp(0); - rIStm.Read(&cTemp, 1); + rIStm.ReadBytes(&cTemp, 1); if( cTemp == c || (cTemp != '\n' && cTemp != '\r') ) rIStm.Seek( nOldFilePos ); } @@ -89,7 +89,7 @@ void DXFSkipLine(SvStream& rIStm) while (rIStm.good()) { char buf[256 + 1]; - sal_uInt16 nLen = (sal_uInt16)rIStm.Read(buf, sizeof(buf) - 1); + sal_uInt16 nLen = static_cast<sal_uInt16>(rIStm.ReadBytes(buf, sizeof(buf) - 1)); for (sal_uInt16 n = 0; n < nLen; n++) { char c = buf[n]; @@ -97,7 +97,7 @@ void DXFSkipLine(SvStream& rIStm) { rIStm.SeekRel(n-nLen+1); // return stream to next to current position char c1 = 0; - rIStm.Read(&c1, 1); + rIStm.ReadBytes(&c1, 1); if (c1 == c || (c1 != '\n' && c1!= '\r')) rIStm.SeekRel(-1); return; diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 82d397e54166..d6ba321bfaad 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -203,7 +203,7 @@ static bool RenderAsEMF(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r osl::FileBase::getSystemPathFromFileURL(aTempInput.GetURL(), input); SvStream* pInputStream = aTempInput.GetStream(StreamMode::WRITE); - sal_uInt64 nCount = pInputStream->Write(pBuf, nBytesRead); + sal_uInt64 nCount = pInputStream->WriteBytes(pBuf, nBytesRead); aTempInput.CloseStream(); //fdo#64161 pstoedit under non-windows uses libEMF to output the EMF, but @@ -316,7 +316,7 @@ static bool RenderAsBMPThroughHelper(const sal_uInt8* pBuf, sal_uInt32 nBytesRea oslFileError eFileErr = osl_readFile(pOut, aBuf, 32000, &nCount); while (eFileErr == osl_File_E_None && nCount) { - aMemStm.Write(aBuf, sal::static_int_cast< sal_Size >(nCount)); + aMemStm.WriteBytes(aBuf, sal::static_int_cast< sal_Size >(nCount)); eFileErr = osl_readFile(pOut, aBuf, 32000, &nCount); } @@ -420,15 +420,15 @@ void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_uInt32 { std::unique_ptr<sal_uInt8[]> pBuf(new sal_uInt8[ nSizeWMF ]); rStrm.Seek( nOrigPos + nPosWMF ); - rStrm.Read( pBuf.get(), nSizeWMF ); - aReplacement.Write( pBuf.get(), nSizeWMF ); + rStrm.ReadBytes(pBuf.get(), nSizeWMF); + aReplacement.WriteBytes(pBuf.get(), nSizeWMF); } if ( nSizeTIFF ) { std::unique_ptr<sal_uInt8[]> pBuf(new sal_uInt8[ nSizeTIFF ]); rStrm.Seek( nOrigPos + nPosTIFF ); - rStrm.Read( pBuf.get(), nSizeTIFF ); - aReplacement.Write( pBuf.get(), nSizeTIFF ); + rStrm.ReadBytes(pBuf.get(), nSizeTIFF); + aReplacement.WriteBytes(pBuf.get(), nSizeTIFF); } rMtf.AddAction( static_cast<MetaAction*>( new MetaCommentAction( aComment, 0, static_cast<const sal_uInt8*>(aReplacement.GetData()), aReplacement.Tell() ) ) ); } @@ -581,7 +581,7 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) } std::unique_ptr<sal_uInt8[]> pHeader( new sal_uInt8[ 22 ] ); rStream.Seek( nPSStreamPos ); - rStream.Read( pHeader.get(), 22 ); // check PostScript header + rStream.ReadBytes(pHeader.get(), 22); // check PostScript header if ( ImplSearchEntry( pHeader.get(), reinterpret_cast<sal_uInt8 const *>("%!PS-Adobe"), 10, 10 ) && ImplSearchEntry( &pHeader[ 15 ], reinterpret_cast<sal_uInt8 const *>("EPS"), 3, 3 ) ) { @@ -589,7 +589,7 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) std::unique_ptr<sal_uInt8[]> pBuf( new sal_uInt8[ nPSSize ] ); sal_uInt32 nBufStartPos = rStream.Tell(); - sal_uInt32 nBytesRead = rStream.Read( pBuf.get(), nPSSize ); + sal_uInt32 nBytesRead = rStream.ReadBytes(pBuf.get(), nPSSize); if ( nBytesRead == nPSSize ) { sal_uInt32 nSecurityCount = 32; diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index 253a5c8144ba..f97bd23b25b2 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -2260,7 +2260,7 @@ void OS2METReader::ReadImageData(sal_uInt16 nDataID, sal_uInt16 nDataLen) // OK, now the map data is being pushed. Unfortunately OS2 and BMP // do have a different RGB ordering when using 24-bit std::unique_ptr<sal_uInt8[]> pBuf(new sal_uInt8[nDataLen]); - pOS2MET->Read(pBuf.get(),nDataLen); + pOS2MET->ReadBytes(pBuf.get(), nDataLen); if (p->nBitsPerPixel==24) { sal_uLong i, j, nAlign, nBytesPerLine; sal_uInt8 nTemp; @@ -2278,7 +2278,7 @@ void OS2METReader::ReadImageData(sal_uInt16 nDataID, sal_uInt16 nDataLen) } } } - p->pBMP->Write(pBuf.get(),nDataLen); + p->pBMP->WriteBytes(pBuf.get(), nDataLen); p->nMapPos+=nDataLen; break; } @@ -2321,7 +2321,7 @@ void OS2METReader::ReadFont(sal_uInt16 nFieldSize) case 0x08: { // Font Typeface char str[33]; pOS2MET->SeekRel(1); - pOS2MET->Read( &str, 32 ); + pOS2MET->ReadBytes( &str, 32 ); str[ 32 ] = 0; OUString aStr( str, strlen(str), osl_getThreadTextEncoding() ); if ( aStr.compareToIgnoreAsciiCase( "Helv" ) == 0 ) @@ -2588,8 +2588,8 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize) pOrdFile->SetEndian(SvStreamEndian::LITTLE); } std::unique_ptr<sal_uInt8[]> pBuf(new sal_uInt8[nFieldSize]); - pOS2MET->Read(pBuf.get(),nFieldSize); - pOrdFile->Write(pBuf.get(),nFieldSize); + pOS2MET->ReadBytes(pBuf.get(), nFieldSize); + pOrdFile->WriteBytes(pBuf.get(), nFieldSize); break; } case MapCodFntMagic: diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx index 42861ded4cde..7ae9f324775f 100644 --- a/filter/source/graphicfilter/ipcd/ipcd.cxx +++ b/filter/source/graphicfilter/ipcd/ipcd.cxx @@ -174,7 +174,7 @@ void PCDReader::CheckPCDImagePacFile() char Buf[ 8 ]; m_rPCD.Seek( 2048 ); - m_rPCD.Read( Buf, 7 ); + m_rPCD.ReadBytes(Buf, 7); Buf[ 7 ] = 0; if (OString(Buf) != "PCD_IPI") bStatus = false; @@ -235,10 +235,10 @@ void PCDReader::ReadImage() m_rPCD.Seek( nImagePos ); // next pair of rows := first pair of rows: - m_rPCD.Read( pL0N, nWidth ); - m_rPCD.Read( pL1N, nWidth ); - m_rPCD.Read( pCbN, nW2 ); - m_rPCD.Read( pCrN, nW2 ); + m_rPCD.ReadBytes( pL0N, nWidth ); + m_rPCD.ReadBytes( pL1N, nWidth ); + m_rPCD.ReadBytes( pCbN, nW2 ); + m_rPCD.ReadBytes( pCrN, nW2 ); pCbN[ nW2 ] = pCbN[ nW2 - 1 ]; pCrN[ nW2 ] = pCrN[ nW2 - 1 ]; @@ -253,10 +253,10 @@ void PCDReader::ReadImage() // get the next pair of rows: if ( nYPair < nH2 - 1 ) { - m_rPCD.Read( pL0N, nWidth ); - m_rPCD.Read( pL1N, nWidth ); - m_rPCD.Read( pCbN, nW2 ); - m_rPCD.Read( pCrN, nW2 ); + m_rPCD.ReadBytes( pL0N, nWidth ); + m_rPCD.ReadBytes( pL1N, nWidth ); + m_rPCD.ReadBytes( pCbN, nW2 ); + m_rPCD.ReadBytes( pCrN, nW2 ); pCbN[nW2]=pCbN[ nW2 - 1 ]; pCrN[nW2]=pCrN[ nW2 - 1 ]; } diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx index b5cef0429929..2aa8c6f2a5df 100644 --- a/filter/source/graphicfilter/ipcx/ipcx.cxx +++ b/filter/source/graphicfilter/ipcx/ipcx.cxx @@ -237,7 +237,7 @@ void PCXReader::ImplReadBody(BitmapWriteAccess * pAcc) for ( np = 0; np < nPlanes; np++) { if ( nEncoding == 0) - m_rPCX.Read( static_cast<void *>(pPlane[ np ]), nBytesPerPlaneLin ); + m_rPCX.ReadBytes( static_cast<void *>(pPlane[ np ]), nBytesPerPlaneLin ); else { pDest = pPlane[ np ]; diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index 188595fedc5d..2cafb482d6eb 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -684,7 +684,7 @@ sal_uLong PictReader::ReadAndDrawText() pPict->ReadChar( nByteLen ); nLen=((sal_uLong)nByteLen)&0x000000ff; nDataLen = nLen + 1; - pPict->Read( &sText, nLen ); + pPict->ReadBytes(&sText, nLen); if (IsInvisible(PDM_TEXT)) return nDataLen; DrawingMethod(PDM_TEXT); @@ -1177,7 +1177,7 @@ void PictReader::ReadHeader() nOffset = 509+st; // illogical : more logical will be nStartPos+509+st or to consider that nStartPos=0 // a small test to check if versionOp code exists after the bdbox ( with no extra NOP codes) pPict->Seek(nOffset+10); - pPict->Read( sBuf, 2 ); + pPict->ReadBytes(sBuf, 2); if (pPict->IsEof() || pPict->GetError()) break; if (sBuf[0] == 0x11 || (sBuf[0] == 0x00 && sBuf[1] == 0x11)) ; // maybe ok else continue; @@ -1198,7 +1198,7 @@ void PictReader::ReadHeader() if (pPict->IsEof() || pPict->GetError()) continue; // read version - pPict->Read( sBuf, 2 ); + pPict->ReadBytes(sBuf, 2); // version 1 file if ( sBuf[ 0 ] == 0x11 && sBuf[ 1 ] == 0x01 ) { // pict v1 must be rare and we do only few tests @@ -1211,7 +1211,7 @@ void PictReader::ReadHeader() { numZero++; pPict->SeekRel(-1); - pPict->Read( sBuf, 2 ); + pPict->ReadBytes(sBuf, 2); } while ( sBuf[0] == 0x00 && numZero < 10); actualConfid -= (numZero-1); // extra nop are dubious @@ -1589,7 +1589,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) else aActFont.SetFamily(FAMILY_ROMAN); aActFont.SetCharSet(GetTextEncoding(nUSHORT)); pPict->ReadChar( nByteLen ); nLen=((sal_uInt16)nByteLen)&0x00ff; - pPict->Read( &sFName, nLen ); + pPict->ReadBytes(&sFName, nLen); sFName[ nLen ] = 0; OUString aString( sFName, strlen(sFName), osl_getThreadTextEncoding() ); aActFont.SetFamilyName( aString ); diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx index 5b68a175844a..7f763836f614 100644 --- a/filter/source/graphicfilter/ipsd/ipsd.cxx +++ b/filter/source/graphicfilter/ipsd/ipsd.cxx @@ -237,7 +237,7 @@ bool PSDReader::ImplReadHeader() if ( nColorLength != 768 ) // we need the color map return false; mpPalette = new sal_uInt8[ 768 ]; - m_rPSD.Read( mpPalette, 768 ); + m_rPSD.ReadBytes(mpPalette, 768); } break; diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx index 6bf858c9e351..33464c5d349b 100644 --- a/filter/source/graphicfilter/itga/itga.cxx +++ b/filter/source/graphicfilter/itga/itga.cxx @@ -217,12 +217,12 @@ bool TGAReader::ImplReadHeader() { mnTGAVersion = 2; - m_rTGA.Read( mpExtension->sAuthorName, 41 ); - m_rTGA.Read( mpExtension->sAuthorComment, 324 ); - m_rTGA.Read( mpExtension->sDateTimeStamp, 12 ); - m_rTGA.Read( mpExtension->sJobNameID, 12 ); + m_rTGA.ReadBytes(mpExtension->sAuthorName, 41); + m_rTGA.ReadBytes(mpExtension->sAuthorComment, 324); + m_rTGA.ReadBytes(mpExtension->sDateTimeStamp, 12); + m_rTGA.ReadBytes(mpExtension->sJobNameID, 12); m_rTGA.ReadChar( mpExtension->sJobNameID[ 0 ] ).ReadChar( mpExtension->sJobNameID[ 1 ] ).ReadChar( mpExtension->sJobNameID[ 2 ] ); - m_rTGA.Read( mpExtension->sSoftwareID, 41 ); + m_rTGA.ReadBytes(mpExtension->sSoftwareID, 41); m_rTGA.ReadUInt16( mpExtension->nSoftwareVersionNumber ).ReadUChar( mpExtension->nSoftwareVersionLetter ) .ReadUInt32( mpExtension->nKeyColor ).ReadUInt16( mpExtension->nPixelAspectRatioNumerator ) .ReadUInt16( mpExtension->nPixelAspectRatioDeNumerator ).ReadUInt16( mpExtension->nGammaValueNumerator ) diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index d7a26ead6670..609786a6aad7 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -557,7 +557,7 @@ bool TIFFReader::ReadMap() pTIFF->Seek( pStripOffsets[ nStrip ] + ( ny % GetRowsPerStrip() ) * nStripBytesPerRow ); if (np >= SAL_N_ELEMENTS(pMap)) return false; - pTIFF->Read( pMap[ np ], nBytesPerRow ); + pTIFF->ReadBytes(pMap[ np ], nBytesPerRow); if (!pTIFF->good()) return false; } @@ -693,7 +693,7 @@ bool TIFFReader::ReadMap() nRecCount=0x00000001+((sal_uLong)nRecHeader); if ( nRecCount > nRowBytesLeft ) return false; - pTIFF->Read(pdst,nRecCount); + pTIFF->ReadBytes(pdst, nRecCount); if (!pTIFF->good()) return false; pdst+=nRecCount; diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 3de4007fdf38..3c85227f8f4d 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -314,7 +314,7 @@ void EscherPropertyContainer::Commit( SvStream& rSt, sal_uInt16 nVersion, sal_uI for ( i = 0; i < nSortCount; i++ ) { if ( pSortStruct[ i ].pBuf ) - rSt.Write( pSortStruct[ i ].pBuf, pSortStruct[ i ].nPropSize ); + rSt.WriteBytes(pSortStruct[i].pBuf, pSortStruct[i].nPropSize); } } } @@ -4062,7 +4062,7 @@ void EscherBlibEntry::WriteBlibEntry( SvStream& rSt, bool bWritePictureOffset, s rSt.WriteUChar( meBlibType ); } - rSt.Write( &mnIdentifier[ 0 ], 16 ); + rSt.WriteBytes(&mnIdentifier[0], 16); rSt.WriteUInt16( 0 ) .WriteUInt32( mnSize + mnSizeExtra ) .WriteUInt32( mnRefCount ) @@ -4185,8 +4185,8 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM while ( nBlipSize ) { sal_uInt32 nBytes = ( nBlipSize > nBuf ? nBuf : nBlipSize ); - pMergePicStreamBSE->Read( pBuf.get(), nBytes ); - rSt.Write( pBuf.get(), nBytes ); + pMergePicStreamBSE->ReadBytes(pBuf.get(), nBytes); + rSt.WriteBytes(pBuf.get(), nBytes); nBlipSize -= nBytes; } } @@ -4303,7 +4303,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter(); SvMemoryStream aGIFStream; const char* pString = "MSOFFICE9.0"; - aGIFStream.Write( pString, strlen(pString) ); + aGIFStream.WriteBytes(pString, strlen(pString)); nErrCode = rFilter.ExportGraphic( aGraphic, OUString(), aGIFStream, rFilter.GetExportFormatNumberForShortName( "GIF" ) ); css::uno::Sequence< css::beans::PropertyValue > aFilterData( 1 ); @@ -4312,7 +4312,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin css::uno::Sequence< sal_Int8 > aGIFSeq( nGIFSreamLen ); sal_Int8* pSeq = aGIFSeq.getArray(); aGIFStream.Seek( STREAM_SEEK_TO_BEGIN ); - aGIFStream.Read( pSeq, nGIFSreamLen ); + aGIFStream.ReadBytes(pSeq, nGIFSreamLen); css::beans::PropertyValue aChunkProp, aFilterProp; aChunkProp.Name = "msOG"; aChunkProp.Value <<= aGIFSeq; @@ -4382,9 +4382,9 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin rPicOutStrm.WriteUInt32( nInstance ).WriteUInt32( p_EscherBlibEntry->mnSize + nExtra ); - rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 ); + rPicOutStrm.WriteBytes(p_EscherBlibEntry->mnIdentifier, 16); rPicOutStrm.WriteUChar( 0xff ); - rPicOutStrm.Write( pGraphicAry, p_EscherBlibEntry->mnSize ); + rPicOutStrm.WriteBytes(pGraphicAry, p_EscherBlibEntry->mnSize); } else { @@ -4403,8 +4403,8 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin nInstance = ( eBlibType == WMF ) ? 0xf01b2170 : 0xf01a3d40; // !EMF -> no change rPicOutStrm.WriteUInt32( nInstance ).WriteUInt32( p_EscherBlibEntry->mnSize + nExtra ); if ( eBlibType == WMF ) // !EMF -> no change - rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 ); - rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 ); + rPicOutStrm.WriteBytes(p_EscherBlibEntry->mnIdentifier, 16); + rPicOutStrm.WriteBytes(p_EscherBlibEntry->mnIdentifier, 16); /* ##913## @@ -4440,7 +4440,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin .WriteUInt32( nHeight ) .WriteUInt32( p_EscherBlibEntry->mnSize ) .WriteUInt16( 0xfe00 ); // compression Flags - rPicOutStrm.Write( pGraphicAry, p_EscherBlibEntry->mnSize ); + rPicOutStrm.WriteBytes(pGraphicAry, p_EscherBlibEntry->mnSize); } } if ( nAtomSize ) @@ -5063,9 +5063,9 @@ void EscherEx::InsertAtCurrentPos( sal_uInt32 nBytes ) nToCopy -= nBufSize; nSource -= nBufSize; mpOutStrm->Seek( nSource ); - mpOutStrm->Read( pBuf.get(), nBufSize ); + mpOutStrm->ReadBytes(pBuf.get(), nBufSize); mpOutStrm->Seek( nSource + nBytes ); - mpOutStrm->Write( pBuf.get(), nBufSize ); + mpOutStrm->WriteBytes(pBuf.get(), nBufSize); } mpOutStrm->Seek( nCurPos ); } diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 996fa2803fd6..d547335db7cd 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -170,7 +170,7 @@ void Impl_OlePres::Write( SvStream & rStm ) WriteClipboardFormat( rStm, SotClipboardFormatId::GDIMETAFILE ); rStm.WriteInt32( nJobLen + 4 ); // a TargetDevice that's always empty if( nJobLen ) - rStm.Write( pJob, nJobLen ); + rStm.WriteBytes(pJob, nJobLen); rStm.WriteUInt32( nAspect ); rStm.WriteInt32( -1 ); //L-Index always -1 rStm.WriteInt32( nAdvFlags ); @@ -2708,7 +2708,7 @@ void DffPropertyReader::CheckAndCorrectExcelTextRotation( SvStream& rIn, SfxItem if ( nLen ) { css::uno::Sequence< sal_Int8 > aXMLDataSeq( nLen ); - rIn.Read( aXMLDataSeq.getArray(), nLen ); + rIn.ReadBytes(aXMLDataSeq.getArray(), nLen); css::uno::Reference< css::io::XInputStream > xInputStream ( new ::comphelper::SequenceInputStream( aXMLDataSeq ) ); try @@ -6520,7 +6520,7 @@ bool SvxMSDffManager::ProcessClientAnchor(SvStream& rStData, sal_uInt32 nDatLen, { rBuffLen = std::min(rStData.remainingSize(), static_cast<sal_uInt64>(nDatLen)); rpBuff = new char[rBuffLen]; - rBuffLen = rStData.Read(rpBuff, rBuffLen); + rBuffLen = rStData.ReadBytes(rpBuff, rBuffLen); } return true; } @@ -6532,7 +6532,7 @@ bool SvxMSDffManager::ProcessClientData(SvStream& rStData, sal_uInt32 nDatLen, { rBuffLen = std::min(rStData.remainingSize(), static_cast<sal_uInt64>(nDatLen)); rpBuff = new char[rBuffLen]; - rBuffLen = rStData.Read(rpBuff, rBuffLen); + rBuffLen = rStData.ReadBytes(rpBuff, rBuffLen); } return true; } @@ -6739,7 +6739,7 @@ bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen, if( 0x10000L > nStrLen ) { std::unique_ptr<sal_Char[]> pBuf(new sal_Char[ nStrLen ]); - rStm.Read( pBuf.get(), nStrLen ); + rStm.ReadBytes(pBuf.get(), nStrLen); aSvrName = OUString( pBuf.get(), (sal_uInt16) nStrLen-1, osl_getThreadTextEncoding() ); } else @@ -6759,11 +6759,11 @@ bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen, if( !pData ) return false; - rStm.Read( pData.get(), nDataLen ); + rStm.ReadBytes(pData.get(), nDataLen); // write to ole10 stream xOle10Stm->WriteUInt32( nDataLen ); - xOle10Stm->Write( pData.get(), nDataLen ); + xOle10Stm->WriteBytes(pData.get(), nDataLen); xOle10Stm = tools::SvRef<SotStorageStream>(); // set the compobj stream @@ -6791,7 +6791,7 @@ bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen, { sal_uLong nPos = rStm.Tell(); sal_uInt16 sz[4]; - rStm.Read( sz, 8 ); + rStm.ReadBytes( sz, 8 ); Graphic aGraphic; if( ERRCODE_NONE == GraphicConverter::Import( rStm, aGraphic ) && aGraphic.GetType() != GraphicType::NONE ) { @@ -7093,13 +7093,13 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( sal_uInt8 aTestA[10]; // exist the \1CompObj-Stream ? tools::SvRef<SotStorageStream> xSrcTst = xObjStg->OpenSotStream( "\1CompObj" ); bValidStorage = xSrcTst.Is() && sizeof( aTestA ) == - xSrcTst->Read( aTestA, sizeof( aTestA ) ); + xSrcTst->ReadBytes(aTestA, sizeof(aTestA)); if( !bValidStorage ) { // or the \1Ole-Stream ? xSrcTst = xObjStg->OpenSotStream( "\1Ole" ); bValidStorage = xSrcTst.Is() && sizeof(aTestA) == - xSrcTst->Read(aTestA, sizeof(aTestA)); + xSrcTst->ReadBytes(aTestA, sizeof(aTestA)); } } diff --git a/filter/source/msfilter/msoleexp.cxx b/filter/source/msfilter/msoleexp.cxx index 6660d7cd0f05..9c56db12c3e6 100644 --- a/filter/source/msfilter/msoleexp.cxx +++ b/filter/source/msfilter/msoleexp.cxx @@ -272,7 +272,7 @@ void SvxMSExportOLEObjects::ExportOLEObject( svt::EmbeddedObjectRef& rObj, SotSt } } - bExtentSuccess = ( xExtStm->Write( aWriteSet, 16 ) == 16 ); + bExtentSuccess = (xExtStm->WriteBytes(aWriteSet, 16) == 16); } } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 3b5670f0eb76..a68a19e0c5c0 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -310,7 +310,7 @@ SvStream& ReadPptSlideLayoutAtom( SvStream& rIn, PptSlideLayoutAtom& rAtom ) rIn.ReadInt32(nTmp); rAtom.eLayout = static_cast<PptSlideLayout>(nTmp); static_assert(sizeof(rAtom.aPlaceholderId) == 8, "wrong size of serialized array"); - rIn.Read( rAtom.aPlaceholderId, 8 ); + rIn.ReadBytes(rAtom.aPlaceholderId, 8); return rIn; } @@ -371,7 +371,7 @@ SvStream& ReadPptColorSchemeAtom( SvStream& rIn, PptColorSchemeAtom& rAtom ) { DffRecordHeader aHd; ReadDffRecordHeader( rIn, aHd ); - rIn.Read( rAtom.aData, 32 ); + rIn.ReadBytes(rAtom.aData, 32); aHd.SeekToEndOfRecord( rIn ); return rIn; } @@ -381,7 +381,7 @@ SvStream& ReadPptFontEntityAtom( SvStream& rIn, PptFontEntityAtom& rAtom ) DffRecordHeader aHd; ReadDffRecordHeader( rIn, aHd ); sal_Unicode nTemp, cData[ 32 ]; - rIn.Read( cData, 64 ); + rIn.ReadBytes(cData, 64); sal_uInt8 lfCharset, lfPitchAndFamily; @@ -1768,7 +1768,7 @@ bool SdrPowerPointOLEDecompress( SvStream& rOutput, SvStream& rInput, sal_uInt32 { sal_uInt32 nOldPos = rInput.Tell(); std::unique_ptr<char[]> pBuf(new char[ nInputSize ]); - rInput.Read( pBuf.get(), nInputSize ); + rInput.ReadBytes(pBuf.get(), nInputSize); ZCodec aZCodec( 0x8000, 0x8000 ); aZCodec.BeginCompression(); SvMemoryStream aSource( pBuf.get(), nInputSize, StreamMode::READ ); @@ -1857,11 +1857,12 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId, if ( xSrcTst.Is() ) { sal_uInt8 aTestA[ 10 ]; - bool bGetItAsOle = ( sizeof( aTestA ) == xSrcTst->Read( aTestA, sizeof( aTestA ) ) ); + bool bGetItAsOle = (sizeof(aTestA) == xSrcTst->ReadBytes(aTestA, sizeof(aTestA))); if ( !bGetItAsOle ) { // maybe there is a contents stream in here xSrcTst = xObjStor->OpenSotStream( "Contents", STREAM_READWRITE | StreamMode::NOCREATE ); - bGetItAsOle = ( xSrcTst.Is() && sizeof( aTestA ) == xSrcTst->Read( aTestA, sizeof( aTestA ) ) ); + bGetItAsOle = (xSrcTst.Is() && + sizeof(aTestA) == xSrcTst->ReadBytes(aTestA, sizeof(aTestA))); } if ( bGetItAsOle ) { @@ -2065,8 +2066,8 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt while ( nToCopy ) { nBufSize = ( nToCopy >= 0x40000 ) ? 0x40000 : nToCopy; - rStCtrl.Read( pBuf.get(), nBufSize ); - xOriginal->Write( pBuf.get(), nBufSize ); + rStCtrl.ReadBytes(pBuf.get(), nBufSize); + xOriginal->WriteBytes(pBuf.get(), nBufSize); nToCopy -= nBufSize; } } @@ -5239,7 +5240,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, const DffRecordHeader& rTextHe sal_uInt32 i; sal_Unicode nChar; std::unique_ptr<sal_Unicode[]> pBuf(new sal_Unicode[ ( nMaxLen >> 1 ) + 1 ]); - rIn.Read( pBuf.get(), nMaxLen ); + rIn.ReadBytes(pBuf.get(), nMaxLen); nMaxLen >>= 1; pBuf[ nMaxLen ] = 0; sal_Unicode* pPtr = pBuf.get(); @@ -5275,7 +5276,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, const DffRecordHeader& rTextHe { std::unique_ptr<sal_Char[]> pBuf(new sal_Char[ nMaxLen + 1 ]); pBuf[ nMaxLen ] = 0; - rIn.Read( pBuf.get(), nMaxLen ); + rIn.ReadBytes(pBuf.get(), nMaxLen); sal_Char* pPtr = pBuf.get(); for (;;) { |