diff options
author | Noel Grandin <noel@peralex.com> | 2014-01-08 08:48:26 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-01-10 13:26:24 +0000 |
commit | b69864f3f8c9be2e1f28f4b422074d2040b084a0 (patch) | |
tree | 93d51bc91257472198beffccb92188ceee61667d /filter | |
parent | de84529b55f5b295b089043a7119d6b0d8b92408 (diff) |
re-write SvStream operator<< to non-overloaded methods
This is the actual re-write.
Use a clang rewriter to rewrite SvStream::operator<< to methods
like WriteuInt32.
Note that the rewriter is not perfect, and I hand-tweaked the output.
In particular, I had to adjust places doing things like
(*this) << 1;
Change-Id: I5923eda3f4ebaa8b452b6ef109e726e116235a2a
Reviewed-on: https://gerrit.libreoffice.org/7342
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/flash/swfwriter.cxx | 6 | ||||
-rw-r--r-- | filter/source/flash/swfwriter2.cxx | 22 | ||||
-rw-r--r-- | filter/source/graphicfilter/egif/egif.cxx | 82 | ||||
-rw-r--r-- | filter/source/graphicfilter/egif/giflzwc.cxx | 6 | ||||
-rw-r--r-- | filter/source/graphicfilter/eos2met/eos2met.cxx | 308 | ||||
-rw-r--r-- | filter/source/graphicfilter/epbm/epbm.cxx | 20 | ||||
-rw-r--r-- | filter/source/graphicfilter/epgm/epgm.cxx | 32 | ||||
-rw-r--r-- | filter/source/graphicfilter/epict/epict.cxx | 250 | ||||
-rw-r--r-- | filter/source/graphicfilter/eppm/eppm.cxx | 36 | ||||
-rw-r--r-- | filter/source/graphicfilter/eps/eps.cxx | 150 | ||||
-rw-r--r-- | filter/source/graphicfilter/eras/eras.cxx | 28 | ||||
-rw-r--r-- | filter/source/graphicfilter/etiff/etiff.cxx | 42 | ||||
-rw-r--r-- | filter/source/graphicfilter/expm/expm.cxx | 36 | ||||
-rw-r--r-- | filter/source/graphicfilter/ieps/ieps.cxx | 6 | ||||
-rw-r--r-- | filter/source/graphicfilter/ios2met/ios2met.cxx | 10 | ||||
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 278 | ||||
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 20 | ||||
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 4 |
18 files changed, 668 insertions, 668 deletions
diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx index 073ae56b1d87..0a6e562739e9 100644 --- a/filter/source/flash/swfwriter.cxx +++ b/filter/source/flash/swfwriter.cxx @@ -150,7 +150,7 @@ void Writer::storeTo( Reference< XOutputStream > &xOutStream ) } // Endtag - *mpMovieStream << (sal_uInt16)0; + mpMovieStream->WriteUInt16( (sal_uInt16)0 ); Tag aHeader( 0xff ); @@ -161,7 +161,7 @@ void Writer::storeTo( Reference< XOutputStream > &xOutStream ) sal_uInt32 nSizePos = aHeader.Tell(); - aHeader << (sal_uInt32)0; + aHeader.WriteUInt32( (sal_uInt32)0 ); Rectangle aDocRect( 0, 0, static_cast<long>(mnDocWidth*mnDocXScale), static_cast<long>(mnDocHeight*mnDocYScale) ); @@ -176,7 +176,7 @@ void Writer::storeTo( Reference< XOutputStream > &xOutStream ) const sal_uInt32 nSize = aHeader.Tell() + mpFontsStream->Tell() + mpMovieStream->Tell(); aHeader.Seek( nSizePos ); - aHeader << (sal_uInt32)nSize; + aHeader.WriteUInt32( (sal_uInt32)nSize ); ImplCopySvStreamToXOutputStream( aHeader, xOutStream ); ImplCopySvStreamToXOutputStream( *mpFontsStream, xOutStream ); diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx index 766b02a34025..d8d21f05c074 100644 --- a/filter/source/flash/swfwriter2.cxx +++ b/filter/source/flash/swfwriter2.cxx @@ -121,7 +121,7 @@ void BitStream::writeTo( SvStream& out ) const vector< sal_uInt8>::iterator aEnd( maData.end() ); while(aIter != aEnd) { - out << (*aIter++); + out.WriteUChar( (*aIter++) ); } } @@ -153,20 +153,20 @@ void Tag::write( SvStream &out ) sal_uInt16 nCode = ( mnTagId << 6 ) | ( bLarge ? 0x3f : _uInt16(nSz) ); - out << (sal_uInt8)nCode; - out << (sal_uInt8)(nCode >> 8); + out.WriteUChar( (sal_uInt8)nCode ); + out.WriteUChar( (sal_uInt8)(nCode >> 8) ); if( bLarge ) { sal_uInt32 nTmp = nSz; - out << (sal_uInt8)nTmp; + out.WriteUChar( (sal_uInt8)nTmp ); nTmp >>= 8; - out << (sal_uInt8)nTmp; + out.WriteUChar( (sal_uInt8)nTmp ); nTmp >>= 8; - out << (sal_uInt8)nTmp; + out.WriteUChar( (sal_uInt8)nTmp ); nTmp >>= 8; - out << (sal_uInt8)nTmp; + out.WriteUChar( (sal_uInt8)nTmp ); } } @@ -184,7 +184,7 @@ void Tag::addI32( sal_Int32 nValue ) void Tag::addUI32( sal_uInt32 nValue ) { - *this << nValue; + WriteUInt32( nValue ); } #if 0 // ----------------------------------------------------------------------------- @@ -198,15 +198,15 @@ void Tag::addI16( sal_Int16 nValue ) void Tag::addUI16( sal_uInt16 nValue ) { - *this << (sal_uInt8)nValue; - *this << (sal_uInt8)(nValue >> 8); + WriteUChar( (sal_uInt8)nValue ); + WriteUChar( (sal_uInt8)(nValue >> 8) ); } // ----------------------------------------------------------------------------- void Tag::addUI8( sal_uInt8 nValue ) { - *this << (sal_uInt8)nValue; + WriteUChar( (sal_uInt8)nValue ); } // ----------------------------------------------------------------------------- diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx index 74b82a6daf97..946968e177b4 100644 --- a/filter/source/graphicfilter/egif/egif.cxx +++ b/filter/source/graphicfilter/egif/egif.cxx @@ -307,18 +307,18 @@ void GIFWriter::WriteGlobalHeader( const Size& rSize ) const sal_uInt8 cFlags = 128 | ( 7 << 4 ); // write values - m_rGIF << nWidth; - m_rGIF << nHeight; - m_rGIF << cFlags; - m_rGIF << (sal_uInt8) 0x00; - m_rGIF << (sal_uInt8) 0x00; + m_rGIF.WriteUInt16( nWidth ); + m_rGIF.WriteUInt16( nHeight ); + m_rGIF.WriteUChar( cFlags ); + m_rGIF.WriteUChar( (sal_uInt8) 0x00 ); + m_rGIF.WriteUChar( (sal_uInt8) 0x00 ); // write dummy palette with two entries (black/white); // we do this only because of a bug in Photoshop, since those can't // read pictures without a global color palette - m_rGIF << (sal_uInt16) 0; - m_rGIF << (sal_uInt16) 255; - m_rGIF << (sal_uInt16) 65535; + m_rGIF.WriteUInt16( (sal_uInt16) 0 ); + m_rGIF.WriteUInt16( (sal_uInt16) 255 ); + m_rGIF.WriteUInt16( (sal_uInt16) 65535 ); if( m_rGIF.GetError() ) bStatus = sal_False; @@ -346,15 +346,15 @@ void GIFWriter::WriteLoopExtension( const Animation& rAnimation ) const sal_uInt8 cLoByte = (const sal_uInt8) nLoopCount; const sal_uInt8 cHiByte = (const sal_uInt8) ( nLoopCount >> 8 ); - m_rGIF << (sal_uInt8) 0x21; - m_rGIF << (sal_uInt8) 0xff; - m_rGIF << (sal_uInt8) 0x0b; + m_rGIF.WriteUChar( (sal_uInt8) 0x21 ); + m_rGIF.WriteUChar( (sal_uInt8) 0xff ); + m_rGIF.WriteUChar( (sal_uInt8) 0x0b ); m_rGIF.Write( "NETSCAPE2.0", 11 ); - m_rGIF << (sal_uInt8) 0x03; - m_rGIF << (sal_uInt8) 0x01; - m_rGIF << cLoByte; - m_rGIF << cHiByte; - m_rGIF << (sal_uInt8) 0x00; + m_rGIF.WriteUChar( (sal_uInt8) 0x03 ); + m_rGIF.WriteUChar( (sal_uInt8) 0x01 ); + m_rGIF.WriteUChar( cLoByte ); + m_rGIF.WriteUChar( cHiByte ); + m_rGIF.WriteUChar( (sal_uInt8) 0x00 ); } } @@ -365,15 +365,15 @@ void GIFWriter::WriteLogSizeExtension( const Size& rSize100 ) // writer PrefSize in 100th-mm as ApplicationExtension if( rSize100.Width() && rSize100.Height() ) { - m_rGIF << (sal_uInt8) 0x21; - m_rGIF << (sal_uInt8) 0xff; - m_rGIF << (sal_uInt8) 0x0b; + m_rGIF.WriteUChar( (sal_uInt8) 0x21 ); + m_rGIF.WriteUChar( (sal_uInt8) 0xff ); + m_rGIF.WriteUChar( (sal_uInt8) 0x0b ); m_rGIF.Write( "STARDIV 5.0", 11 ); - m_rGIF << (sal_uInt8) 0x09; - m_rGIF << (sal_uInt8) 0x01; - m_rGIF << (sal_uInt32) rSize100.Width(); - m_rGIF << (sal_uInt32) rSize100.Height(); - m_rGIF << (sal_uInt8) 0x00; + m_rGIF.WriteUChar( (sal_uInt8) 0x09 ); + m_rGIF.WriteUChar( (sal_uInt8) 0x01 ); + m_rGIF.WriteUInt32( (sal_uInt32) rSize100.Width() ); + m_rGIF.WriteUInt32( (sal_uInt32) rSize100.Height() ); + m_rGIF.WriteUChar( (sal_uInt8) 0x00 ); } } @@ -396,13 +396,13 @@ void GIFWriter::WriteImageExtension( long nTimer, Disposal eDisposal ) else if( eDisposal == DISPOSE_PREVIOUS ) cFlags |= ( 3 << 2 ); - m_rGIF << (sal_uInt8) 0x21; - m_rGIF << (sal_uInt8) 0xf9; - m_rGIF << (sal_uInt8) 0x04; - m_rGIF << cFlags; - m_rGIF << nDelay; - m_rGIF << (sal_uInt8) m_pAcc->GetBestPaletteIndex( BMP_COL_TRANS ); - m_rGIF << (sal_uInt8) 0x00; + m_rGIF.WriteUChar( (sal_uInt8) 0x21 ); + m_rGIF.WriteUChar( (sal_uInt8) 0xf9 ); + m_rGIF.WriteUChar( (sal_uInt8) 0x04 ); + m_rGIF.WriteUChar( cFlags ); + m_rGIF.WriteUInt16( nDelay ); + m_rGIF.WriteUChar( (sal_uInt8) m_pAcc->GetBestPaletteIndex( BMP_COL_TRANS ) ); + m_rGIF.WriteUChar( (sal_uInt8) 0x00 ); if( m_rGIF.GetError() ) bStatus = sal_False; @@ -429,12 +429,12 @@ void GIFWriter::WriteLocalHeader() cFlags |= 0x80; // alles rausschreiben - m_rGIF << (sal_uInt8) 0x2c; - m_rGIF << nPosX; - m_rGIF << nPosY; - m_rGIF << nWidth; - m_rGIF << nHeight; - m_rGIF << cFlags; + m_rGIF.WriteUChar( (sal_uInt8) 0x2c ); + m_rGIF.WriteUInt16( nPosX ); + m_rGIF.WriteUInt16( nPosY ); + m_rGIF.WriteUInt16( nWidth ); + m_rGIF.WriteUInt16( nHeight ); + m_rGIF.WriteUChar( cFlags ); if( m_rGIF.GetError() ) bStatus = sal_False; @@ -454,9 +454,9 @@ void GIFWriter::WritePalette() { const BitmapColor& rColor = m_pAcc->GetPaletteColor( i ); - m_rGIF << rColor.GetRed(); - m_rGIF << rColor.GetGreen(); - m_rGIF << rColor.GetBlue(); + m_rGIF.WriteUChar( rColor.GetRed() ); + m_rGIF.WriteUChar( rColor.GetGreen() ); + m_rGIF.WriteUChar( rColor.GetBlue() ); } // fill up the rest with 0 @@ -549,7 +549,7 @@ void GIFWriter::WriteTerminator() { if( bStatus ) { - m_rGIF << (sal_uInt8) 0x3b; + m_rGIF.WriteUChar( (sal_uInt8) 0x3b ); if( m_rGIF.GetError() ) bStatus = sal_False; diff --git a/filter/source/graphicfilter/egif/giflzwc.cxx b/filter/source/graphicfilter/egif/giflzwc.cxx index dcc1533640d5..57b5efd6fdba 100644 --- a/filter/source/graphicfilter/egif/giflzwc.cxx +++ b/filter/source/graphicfilter/egif/giflzwc.cxx @@ -81,7 +81,7 @@ GIFImageDataOutputStream::GIFImageDataOutputStream( SvStream & rGIF, sal_uInt8 n nBlockBufSize = 0; nBitsBufSize = 0; nBitsBuf = 0; - rStream << nLZWDataSize; + rStream.WriteUChar( nLZWDataSize ); } // ------------------------------------------------------------------------ @@ -92,7 +92,7 @@ GIFImageDataOutputStream::~GIFImageDataOutputStream() WriteBits(0,7); FlushBitsBufsFullBytes(); FlushBlockBuf(); - rStream << (sal_uInt8)0; + rStream.WriteUChar( (sal_uInt8)0 ); delete[] pBlockBuf; } @@ -102,7 +102,7 @@ void GIFImageDataOutputStream::FlushBlockBuf() { if( nBlockBufSize ) { - rStream << (sal_uInt8) nBlockBufSize; + rStream.WriteUChar( (sal_uInt8) nBlockBufSize ); rStream.Write( pBlockBuf,nBlockBufSize ); nBlockBufSize = 0; } diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx index e48c370d5e19..ff2f3e74e01b 100644 --- a/filter/source/graphicfilter/eos2met/eos2met.cxx +++ b/filter/source/graphicfilter/eos2met/eos2met.cxx @@ -282,8 +282,8 @@ void METWriter::WriteClipRect( const Rectangle& rRect ) METEndPath(); } WillWriteOrder(8); - *pMET << (sal_uInt8)0xb4 << (sal_uInt8)6 - << (sal_uInt8)0x00 << (sal_uInt8)0 << nPathId; + pMET->WriteUChar( (sal_uInt8)0xb4 ).WriteUChar( (sal_uInt8)6 ) + .WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0 ).WriteUInt32( nPathId ); } void METWriter::CountActionsAndBitmaps(const GDIMetaFile * pMTF) @@ -323,7 +323,7 @@ void METWriter::CountActionsAndBitmaps(const GDIMetaFile * pMTF) void METWriter::WriteBigEndianShort(sal_uInt16 nWord) { - *pMET << ((sal_uInt8)(nWord>>8)) << ((sal_uInt8)(nWord&0x00ff)); + pMET->WriteUChar( (sal_uInt8)(nWord>>8) ).WriteUChar( (sal_uInt8)(nWord&0x00ff) ); } @@ -338,8 +338,8 @@ void METWriter::WritePoint(Point aPt) { Point aNewPt = pCompDev->LogicToLogic( aPt, aPictureMapMode, aTargetMapMode ); - *pMET << (sal_Int32) ( aNewPt.X() - aPictureRect.Left() ) - << (sal_Int32) ( aPictureRect.Bottom() - aNewPt.Y() ); + pMET->WriteInt32( (sal_Int32) ( aNewPt.X() - aPictureRect.Left() ) ) + .WriteInt32( (sal_Int32) ( aPictureRect.Bottom() - aNewPt.Y() ) ); } @@ -348,7 +348,7 @@ void METWriter::WriteFieldIntroducer(sal_uInt16 nFieldSize, sal_uInt16 nFieldTyp { nActualFieldStartPos=pMET->Tell(); WriteBigEndianShort(nFieldSize); - *pMET << (sal_uInt8)0xd3 << nFieldType << nFlags << nSegSeqNum; + pMET->WriteUChar( (sal_uInt8)0xd3 ).WriteUInt16( nFieldType ).WriteUChar( nFlags ).WriteUInt16( nSegSeqNum ); } @@ -370,7 +370,7 @@ void METWriter::WriteFieldId(sal_uLong nId) for (i=1; i<=8; i++) { nbyte= '0' + (sal_uInt8)((nId >> (32-i*4)) & 0x0f); - *pMET << nbyte; + pMET->WriteUChar( nbyte ); } } @@ -445,13 +445,13 @@ void METWriter::WriteChrSets() WriteBigEndianShort(0x0050); - *pMET << (sal_uInt8)0x0c << (sal_uInt8)0x02 << (sal_uInt8)0x84 << (sal_uInt8)0x00; - *pMET << (sal_uInt8)0xa4 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x01; - *pMET << (sal_uInt8)0x01 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0x0c ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x84 ).WriteUChar( (sal_uInt8)0x00 ); + pMET->WriteUChar( (sal_uInt8)0xa4 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x01 ); + pMET->WriteUChar( (sal_uInt8)0x01 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ); - *pMET << (sal_uInt8)0x04 << (sal_uInt8)0x24 << (sal_uInt8)0x05 << (sal_uInt8)pCS->nSet; + pMET->WriteUChar( (sal_uInt8)0x04 ).WriteUChar( (sal_uInt8)0x24 ).WriteUChar( (sal_uInt8)0x05 ).WriteUChar( (sal_uInt8)pCS->nSet ); - *pMET << (sal_uInt8)0x14 << (sal_uInt8)0x1f; + pMET->WriteUChar( (sal_uInt8)0x14 ).WriteUChar( (sal_uInt8)0x1f ); switch (pCS->eWeight) { case WEIGHT_THIN: nbyte=1; break; @@ -465,24 +465,24 @@ void METWriter::WriteChrSets() case WEIGHT_BLACK: nbyte=9; break; default: nbyte=5; } - *pMET << nbyte; - *pMET << (sal_uInt8)0x05; - *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00; - *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00; - *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00; - *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x0c; + pMET->WriteUChar( nbyte ); + pMET->WriteUChar( (sal_uInt8)0x05 ); + pMET->WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ); + pMET->WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ); + pMET->WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ); + pMET->WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x0c ); - *pMET << (sal_uInt8)0x06 << (sal_uInt8)0x20 << (sal_uInt8)0x03 << (sal_uInt8)0xd4; - *pMET << (sal_uInt8)0x03 << (sal_uInt8)0x52; + pMET->WriteUChar( (sal_uInt8)0x06 ).WriteUChar( (sal_uInt8)0x20 ).WriteUChar( (sal_uInt8)0x03 ).WriteUChar( (sal_uInt8)0xd4 ); + pMET->WriteUChar( (sal_uInt8)0x03 ).WriteUChar( (sal_uInt8)0x52 ); - *pMET << (sal_uInt8)0x24 << (sal_uInt8)0x02 << (sal_uInt8)0x08 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0x24 ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x08 ).WriteUChar( (sal_uInt8)0x00 ); OString n(OUStringToOString(pCS->aName, osl_getThreadTextEncoding())); for (i=0; i<32; i++) { if ( i == 0 || c != 0 ) c = n[i]; - *pMET << c; + pMET->WriteChar( c ); } } } @@ -500,7 +500,7 @@ void METWriter::WriteColorAttributeTable(sal_uLong nFieldId, BitmapPalette* pPal //--- The Field 'Color Attribute Table': WriteFieldIntroducer(0,BlkColAtrMagic,0,0); - *pMET << nBasePartFlags << (sal_uInt8)0x00 << nBasePartLCTID; // 'Base Part' + pMET->WriteUChar( nBasePartFlags ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( nBasePartLCTID ); // 'Base Part' if (pPalette!=NULL) { nIndex=0; @@ -508,18 +508,18 @@ void METWriter::WriteColorAttributeTable(sal_uLong nFieldId, BitmapPalette* pPal { nNumI=pPalette->GetEntryCount()-nIndex; if (nNumI>81) nNumI=81; - *pMET << (sal_uInt8)(11+nNumI*3); // length of the parameter - *pMET << (sal_uInt8)1 << (sal_uInt8)0 << (sal_uInt8)1; // typ: element list, Reserved, Format: RGB - *pMET << (sal_uInt8)0; WriteBigEndianShort(nIndex); // start-Index (3 Bytes) - *pMET << (sal_uInt8)8 << (sal_uInt8)8 << (sal_uInt8)8; // Bits per component R,G,B - *pMET << (sal_uInt8)3; // number of bytes per entry + pMET->WriteUChar( (sal_uInt8)(11+nNumI*3) ); // length of the parameter + pMET->WriteUChar( (sal_uInt8)1 ).WriteUChar( (sal_uInt8)0 ).WriteUChar( (sal_uInt8)1 ); // typ: element list, Reserved, Format: RGB + pMET->WriteUChar( (sal_uInt8)0 ); WriteBigEndianShort(nIndex); // start-Index (3 Bytes) + pMET->WriteUChar( (sal_uInt8)8 ).WriteUChar( (sal_uInt8)8 ).WriteUChar( (sal_uInt8)8 ); // Bits per component R,G,B + pMET->WriteUChar( (sal_uInt8)3 ); // number of bytes per entry for (i=0; i<nNumI; i++) { const BitmapColor& rCol = (*pPalette)[ nIndex ]; - *pMET << (sal_uInt8) rCol.GetRed(); - *pMET << (sal_uInt8) rCol.GetGreen(); - *pMET << (sal_uInt8) rCol.GetBlue(); + pMET->WriteUChar( (sal_uInt8) rCol.GetRed() ); + pMET->WriteUChar( (sal_uInt8) rCol.GetGreen() ); + pMET->WriteUChar( (sal_uInt8) rCol.GetBlue() ); nIndex++; } } @@ -527,8 +527,8 @@ void METWriter::WriteColorAttributeTable(sal_uLong nFieldId, BitmapPalette* pPal else { // 'Trible Generating' - *pMET << (sal_uInt8)0x0a << (sal_uInt8)0x02 << (sal_uInt8)0x00 << (sal_uInt8)0x01 << (sal_uInt8)0x00; - *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x08 << (sal_uInt8)0x08 << (sal_uInt8)0x08; + pMET->WriteUChar( (sal_uInt8)0x0a ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x01 ).WriteUChar( (sal_uInt8)0x00 ); + pMET->WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x08 ).WriteUChar( (sal_uInt8)0x08 ).WriteUChar( (sal_uInt8)0x08 ); } UpdateFieldSize(); @@ -606,9 +606,9 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap) //--- The Field 'Map Color Attribute Table': WriteFieldIntroducer(26,MapColAtrMagic,0,0); WriteBigEndianShort(0x0012); - *pMET << (sal_uInt8)0x0c << (sal_uInt8)0x02 << (sal_uInt8)0x84 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0x0c ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x84 ).WriteUChar( (sal_uInt8)0x00 ); WriteFieldId(nActColMapId); - *pMET << (sal_uInt8)0x04 << (sal_uInt8)0x24 << (sal_uInt8)0x07 << (sal_uInt8)0x01; + pMET->WriteUChar( (sal_uInt8)0x04 ).WriteUChar( (sal_uInt8)0x24 ).WriteUChar( (sal_uInt8)0x07 ).WriteUChar( (sal_uInt8)0x01 ); //--- The Field 'End Object Environment Group': WriteFieldIntroducer(16,EndObjEnvMagic,0,0); @@ -617,7 +617,7 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap) //--- The Field 'Image Data Descriptor': WriteFieldIntroducer(17,DscImgObjMagic,0,0); - *pMET << (sal_uInt8)0x01; // Unit of measure: tens of centimeters + pMET->WriteUChar( (sal_uInt8)0x01 ); // Unit of measure: tens of centimeters WriteBigEndianShort((sal_uInt16)nResX); WriteBigEndianShort((sal_uInt16)nResY); WriteBigEndianShort((sal_uInt16)nWidth); @@ -627,32 +627,32 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap) WriteFieldIntroducer(0,DatImgObjMagic,0,0); // Begin Segment: - *pMET << (sal_uInt8)0x70 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0x70 ).WriteUChar( (sal_uInt8)0x00 ); // Begin Image Content: - *pMET << (sal_uInt8)0x91 << (sal_uInt8)0x01 << (sal_uInt8)0xff; + pMET->WriteUChar( (sal_uInt8)0x91 ).WriteUChar( (sal_uInt8)0x01 ).WriteUChar( (sal_uInt8)0xff ); // Image Size: - *pMET << (sal_uInt8)0x94 << (sal_uInt8)0x09 << (sal_uInt8)0x02; - *pMET << (sal_uInt16) 0 << (sal_uInt16) 0; + pMET->WriteUChar( (sal_uInt8)0x94 ).WriteUChar( (sal_uInt8)0x09 ).WriteUChar( (sal_uInt8)0x02 ); + pMET->WriteUInt16( (sal_uInt16) 0 ).WriteUInt16( (sal_uInt16) 0 ); WriteBigEndianShort((sal_uInt16)nHeight); WriteBigEndianShort((sal_uInt16)nWidth); // Image Encoding: - *pMET << (sal_uInt8)0x95 << (sal_uInt8)0x02 << (sal_uInt8)0x03 << (sal_uInt8)0x03; + pMET->WriteUChar( (sal_uInt8)0x95 ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x03 ).WriteUChar( (sal_uInt8)0x03 ); // Image IDE-Size: - *pMET << (sal_uInt8)0x96 << (sal_uInt8)0x01 << (sal_uInt8)nBitsPerPixel; + pMET->WriteUChar( (sal_uInt8)0x96 ).WriteUChar( (sal_uInt8)0x01 ).WriteUChar( (sal_uInt8)nBitsPerPixel ); if (nBitsPerPixel<=8) { // Image LUT-ID - *pMET << (sal_uInt8)0x97 << (sal_uInt8)0x01 << (sal_uInt8)0x01; + pMET->WriteUChar( (sal_uInt8)0x97 ).WriteUChar( (sal_uInt8)0x01 ).WriteUChar( (sal_uInt8)0x01 ); } else { // IDE Structure - *pMET << (sal_uInt8)0x9b << (sal_uInt8)0x08 << (sal_uInt8)0x00 << (sal_uInt8)0x01; - *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x08; - *pMET << (sal_uInt8)0x08 << (sal_uInt8)0x08; + pMET->WriteUChar( (sal_uInt8)0x9b ).WriteUChar( (sal_uInt8)0x08 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x01 ); + pMET->WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x08 ); + pMET->WriteUChar( (sal_uInt8)0x08 ).WriteUChar( (sal_uInt8)0x08 ); } pBuf=new sal_uInt8[nBytesPerLine]; @@ -689,10 +689,10 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap) delete[] pBuf; // End Image Content: - *pMET << (sal_uInt8)0x93 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0x93 ).WriteUChar( (sal_uInt8)0x00 ); // End Segment: - *pMET << (sal_uInt8)0x71 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0x71 ).WriteUChar( (sal_uInt8)0x00 ); // finalize the last field 'Image Picture Data': UpdateFieldSize(); @@ -819,9 +819,9 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *) // 8 Coordinate types in data // 0x04Intel16 // 0x05Intel32 - *pMET << (sal_uInt8)0xf7 << (sal_uInt8)0x07 << (sal_uInt8)0xb0 << (sal_uInt8)0x00 - << (sal_uInt8)0x00 << (sal_uInt8)0x23 << (sal_uInt8)0x01 << (sal_uInt8)0x01 - << (sal_uInt8)0x05; + pMET->WriteUChar( (sal_uInt8)0xf7 ).WriteUChar( (sal_uInt8)0x07 ).WriteUChar( (sal_uInt8)0xb0 ).WriteUChar( (sal_uInt8)0x00 ) + .WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x23 ).WriteUChar( (sal_uInt8)0x01 ).WriteUChar( (sal_uInt8)0x01 ) + .WriteUChar( (sal_uInt8)0x05 ); // 0 0xF6 Set Picture Descriptor // 1 Length of following data @@ -851,14 +851,14 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *) // GPS Y bottom, Y top // GPS Z near, Z far Size aUnitsPerDecimeter=OutputDevice::LogicToLogic(Size(10,10),MapMode(MAP_CM),aPictureMapMode); - *pMET << (sal_uInt8)0xf6 << (sal_uInt8)0x28 << (sal_uInt8)0x40 << (sal_uInt8)0x00 - << (sal_uInt8)0x05 << (sal_uInt8)0x01 - << (sal_uInt32)(aUnitsPerDecimeter.Width()) - << (sal_uInt32)(aUnitsPerDecimeter.Height()) - << (sal_uInt32)0 - << (sal_uInt32)0 << (sal_uInt32)aPictureRect.GetWidth() - << (sal_uInt32)0 << (sal_uInt32)aPictureRect.GetHeight() - << (sal_uInt32)0 << (sal_uInt32)0; + pMET->WriteUChar( (sal_uInt8)0xf6 ).WriteUChar( (sal_uInt8)0x28 ).WriteUChar( (sal_uInt8)0x40 ).WriteUChar( (sal_uInt8)0x00 ) + .WriteUChar( (sal_uInt8)0x05 ).WriteUChar( (sal_uInt8)0x01 ) + .WriteUInt32( (sal_uInt32)(aUnitsPerDecimeter.Width()) ) + .WriteUInt32( (sal_uInt32)(aUnitsPerDecimeter.Height()) ) + .WriteUInt32( (sal_uInt32)0 ) + .WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)aPictureRect.GetWidth() ) + .WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)aPictureRect.GetHeight() ) + .WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)0 ); // 0 0x21 Set Current Defaults // 1 Length of following data @@ -873,9 +873,9 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *) // 8 Geometrics // 0x04 Intel16 // 0x05 Intel32 - *pMET << (sal_uInt8)0x21 << (sal_uInt8)0x07 << (sal_uInt8)0x08 << (sal_uInt8)0xe0 - << (sal_uInt8)0x00 << (sal_uInt8)0x8f << (sal_uInt8)0x00 << (sal_uInt8)0x05 - << (sal_uInt8)0x05; + pMET->WriteUChar( (sal_uInt8)0x21 ).WriteUChar( (sal_uInt8)0x07 ).WriteUChar( (sal_uInt8)0x08 ).WriteUChar( (sal_uInt8)0xe0 ) + .WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x8f ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x05 ) + .WriteUChar( (sal_uInt8)0x05 ); // 0 0x21 Set Current Defaults // 1 Length of following data @@ -883,10 +883,10 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *) // 3-4 Mask 0xCC0C // 5 Names 0x8F // 6-n M11, M12, M21, M22, M41, M42 Matrix elements - *pMET << (sal_uInt8)0x21 << (sal_uInt8)0x1c << (sal_uInt8)0x07 << (sal_uInt8)0xcc - << (sal_uInt8)0x0c << (sal_uInt8)0x8f - << (sal_uInt32)0x00010000 << (sal_uInt32)0x00000000 << (sal_uInt32)0x00000000 - << (sal_uInt32)0x00010000 << (sal_uInt32)0x00000000 << (sal_uInt32)0x00000000; + pMET->WriteUChar( (sal_uInt8)0x21 ).WriteUChar( (sal_uInt8)0x1c ).WriteUChar( (sal_uInt8)0x07 ).WriteUChar( (sal_uInt8)0xcc ) + .WriteUChar( (sal_uInt8)0x0c ).WriteUChar( (sal_uInt8)0x8f ) + .WriteUInt32( (sal_uInt32)0x00010000 ).WriteUInt32( (sal_uInt32)0x00000000 ).WriteUInt32( (sal_uInt32)0x00000000 ) + .WriteUInt32( (sal_uInt32)0x00010000 ).WriteUInt32( (sal_uInt32)0x00000000 ).WriteUInt32( (sal_uInt32)0x00000000 ); // 0 0x21 Set Current Defaults // 1 Length of following data @@ -955,11 +955,11 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *) // (1 byte) - Character mix // (1 byte) - Character background mix (G=2 or 4 depending on the Geometrics // parameter of Set Default Parameter Format) - *pMET << (sal_uInt8)0x21 << (sal_uInt8)0x10 << (sal_uInt8)0x02 << (sal_uInt8)0x40 - << (sal_uInt8)0x00 << (sal_uInt8)0x8f - << (sal_uInt8)0xaa << (sal_uInt8)0x02 << (sal_uInt8)0x00 << (sal_uInt8)0x00 - << (sal_uInt8)0x44 << (sal_uInt8)0x04 << (sal_uInt8)0x00 << (sal_uInt8)0x00 - << (sal_uInt8)0xa8 << (sal_uInt8)0xaa << (sal_uInt8)0x40 << (sal_uInt8)0x44; + pMET->WriteUChar( (sal_uInt8)0x21 ).WriteUChar( (sal_uInt8)0x10 ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x40 ) + .WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x8f ) + .WriteUChar( (sal_uInt8)0xaa ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ) + .WriteUChar( (sal_uInt8)0x44 ).WriteUChar( (sal_uInt8)0x04 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ) + .WriteUChar( (sal_uInt8)0xa8 ).WriteUChar( (sal_uInt8)0xaa ).WriteUChar( (sal_uInt8)0x40 ).WriteUChar( (sal_uInt8)0x44 ); // 0 0x21 Set Current Defaults // 1 Length of following data @@ -989,10 +989,10 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *) // (1 byte) - Marker mix // (1 byte) - Marker background mix (G=2 or 4 depending on the Geometrics // parameter of Set Default Parameter Format) - *pMET << (sal_uInt8)0x21 << (sal_uInt8)0x0c << (sal_uInt8)0x03 << (sal_uInt8)0x40 - << (sal_uInt8)0x00 << (sal_uInt8)0x8f - << (sal_uInt8)0x66 << (sal_uInt8)0x02 << (sal_uInt8)0x00 << (sal_uInt8)0x00 - << (sal_uInt8)0x66 << (sal_uInt8)0x02 << (sal_uInt8)0x00 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0x21 ).WriteUChar( (sal_uInt8)0x0c ).WriteUChar( (sal_uInt8)0x03 ).WriteUChar( (sal_uInt8)0x40 ) + .WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x8f ) + .WriteUChar( (sal_uInt8)0x66 ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ) + .WriteUChar( (sal_uInt8)0x66 ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ); // 0 0x21 Set Current Defaults // 1 Length of following data @@ -1101,9 +1101,9 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *) // 4-7 Bit-map handle // 8 Lcid if (nNumberOfBitmaps>0) { - *pMET << (sal_uInt8)0xe7 << (sal_uInt8)0x07 << (sal_uInt8)0x80 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0xe7 ).WriteUChar( (sal_uInt8)0x07 ).WriteUChar( (sal_uInt8)0x80 ).WriteUChar( (sal_uInt8)0x00 ); WriteBigEndianLong(nActBitmapId); - *pMET << (sal_uInt8)0xfe; + pMET->WriteUChar( (sal_uInt8)0xfe ); } UpdateFieldSize(); @@ -1132,14 +1132,14 @@ void METWriter::WillWriteOrder(sal_uLong nNextOrderMaximumLength) void METWriter::METBitBlt(Point aPt, Size aSize, const Size& rBmpSizePixel) { WillWriteOrder(46); - *pMET << (sal_uInt8)0xd6 << (sal_uInt8)44 << (sal_uInt16)0 << (sal_uInt16) 0x00cc; + pMET->WriteUChar( (sal_uInt8)0xd6 ).WriteUChar( (sal_uInt8)44 ).WriteUInt16( (sal_uInt16)0 ).WriteUInt16( (sal_uInt16) 0x00cc ); WriteBigEndianLong(nActBitmapId++); - *pMET << (sal_uInt8)0x02 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ); WritePoint(Point(aPt.X(),aPt.Y()+aSize.Height())); WritePoint(Point(aPt.X()+aSize.Width(),aPt.Y())); - *pMET << (sal_uInt32)0 << (sal_uInt32)0 - << (sal_uInt32)(rBmpSizePixel.Width()) - << (sal_uInt32)(rBmpSizePixel.Height()); + pMET->WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)0 ) + .WriteUInt32( (sal_uInt32)(rBmpSizePixel.Width()) ) + .WriteUInt32( (sal_uInt32)(rBmpSizePixel.Height()) ); } void METWriter::METSetAndPushLineInfo( const LineInfo& rLineInfo ) @@ -1147,11 +1147,11 @@ void METWriter::METSetAndPushLineInfo( const LineInfo& rLineInfo ) sal_Int32 nWidth = pCompDev->LogicToLogic( Size( rLineInfo.GetWidth(),0 ), aPictureMapMode, aTargetMapMode ).Width(); WillWriteOrder( 8 ); // set stroke linewidth - *pMET << (sal_uInt8)0x15 - << (sal_uInt8)6 - << (sal_uInt8)0 // Flags - << (sal_uInt8)0 - << nWidth; + pMET ->WriteUChar( (sal_uInt8)0x15 ) + .WriteUChar( (sal_uInt8)6 ) + .WriteUChar( (sal_uInt8)0 ) // Flags + .WriteUChar( (sal_uInt8)0 ) + .WriteInt32( nWidth ); if ( rLineInfo.GetStyle() != LINE_SOLID ) { @@ -1181,83 +1181,83 @@ void METWriter::METSetAndPushLineInfo( const LineInfo& rLineInfo ) break; // not handled -Wall } WillWriteOrder( 2 ); - *pMET << (sal_uInt8)0x18 << nStyle; // set LineType + pMET->WriteUChar( (sal_uInt8)0x18 ).WriteUChar( nStyle ); // set LineType } } void METWriter::METPopLineInfo( const LineInfo& rLineInfo ) { WillWriteOrder( 8 ); // set stroke linewidth - *pMET << (sal_uInt8)0x15 - << (sal_uInt8)6 - << (sal_uInt8)0 // Flags - << (sal_uInt8)0 - << (sal_uInt32)1; + pMET ->WriteUChar( (sal_uInt8)0x15 ) + .WriteUChar( (sal_uInt8)6 ) + .WriteUChar( (sal_uInt8)0 ) // Flags + .WriteUChar( (sal_uInt8)0 ) + .WriteUInt32( (sal_uInt32)1 ); if ( rLineInfo.GetStyle() != LINE_SOLID ) { WillWriteOrder( 2 ); - *pMET << (sal_uInt8)0x18 << (sal_uInt8)0; // set LineType + pMET->WriteUChar( (sal_uInt8)0x18 ).WriteUChar( (sal_uInt8)0 ); // set LineType } } void METWriter::METBeginArea(sal_Bool bBoundaryLine) { WillWriteOrder(2); - *pMET << (sal_uInt8)0x68; - if (bBoundaryLine) *pMET << (sal_uInt8)0xc0; - else *pMET << (sal_uInt8)0x80; + pMET->WriteUChar( (sal_uInt8)0x68 ); + if (bBoundaryLine) pMET->WriteUChar( (sal_uInt8)0xc0 ); + else pMET->WriteUChar( (sal_uInt8)0x80 ); } void METWriter::METEndArea() { WillWriteOrder(2); - *pMET << (sal_uInt8)0x60 << (sal_uInt8)0; + pMET->WriteUChar( (sal_uInt8)0x60 ).WriteUChar( (sal_uInt8)0 ); } void METWriter::METBeginPath(sal_uInt32 nPathId) { WillWriteOrder(8); - *pMET << (sal_uInt8)0xd0 << (sal_uInt8)6 << (sal_uInt16) 0 << nPathId; + pMET->WriteUChar( (sal_uInt8)0xd0 ).WriteUChar( (sal_uInt8)6 ).WriteUInt16( (sal_uInt16) 0 ).WriteUInt32( nPathId ); } void METWriter::METEndPath() { WillWriteOrder(2); - *pMET << (sal_uInt8)0x7f << (sal_uInt8)0; + pMET->WriteUChar( (sal_uInt8)0x7f ).WriteUChar( (sal_uInt8)0 ); } void METWriter::METFillPath(sal_uInt32 nPathId) { WillWriteOrder(8); - *pMET << (sal_uInt8)0xd7 << (sal_uInt8)6 - << (sal_uInt8)0x00 << (sal_uInt8)0 << nPathId; + pMET->WriteUChar( (sal_uInt8)0xd7 ).WriteUChar( (sal_uInt8)6 ) + .WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0 ).WriteUInt32( nPathId ); } void METWriter::METOutlinePath(sal_uInt32 nPathId) { WillWriteOrder(8); - *pMET << (sal_uInt8)0xd4 << (sal_uInt8)6 - << (sal_uInt8)0 << (sal_uInt8)0 << nPathId; + pMET->WriteUChar( (sal_uInt8)0xd4 ).WriteUChar( (sal_uInt8)6 ) + .WriteUChar( (sal_uInt8)0 ).WriteUChar( (sal_uInt8)0 ).WriteUInt32( nPathId ); } void METWriter::METCloseFigure() { WillWriteOrder(2); - *pMET << (sal_uInt8)0x7d << (sal_uInt8)0; + pMET->WriteUChar( (sal_uInt8)0x7d ).WriteUChar( (sal_uInt8)0 ); } void METWriter::METMove(Point aPt) { WillWriteOrder(10); - *pMET << (sal_uInt8)0x21 << (sal_uInt8)8; + pMET->WriteUChar( (sal_uInt8)0x21 ).WriteUChar( (sal_uInt8)8 ); WritePoint(aPt); } @@ -1265,7 +1265,7 @@ void METWriter::METMove(Point aPt) void METWriter::METLine(Point aPt1, Point aPt2) { WillWriteOrder(18); - *pMET << (sal_uInt8)0xc1 << (sal_uInt8)16; + pMET->WriteUChar( (sal_uInt8)0xc1 ).WriteUChar( (sal_uInt8)16 ); WritePoint(aPt1); WritePoint(aPt2); } @@ -1282,13 +1282,13 @@ void METWriter::METLine(const Polygon & rPolygon) if (nOrderPoints>30) nOrderPoints=30; WillWriteOrder(nOrderPoints*8+2); if (bFirstOrder==sal_True) { - *pMET << (sal_uInt8)0xc1; // Line at given pos + pMET->WriteUChar( (sal_uInt8)0xc1 ); // Line at given pos bFirstOrder=sal_False; } else { - *pMET << (sal_uInt8)0x81; // Line at current pos + pMET->WriteUChar( (sal_uInt8)0x81 ); // Line at current pos } - *pMET << (sal_uInt8)(nOrderPoints*8); + pMET->WriteUChar( (sal_uInt8)(nOrderPoints*8) ); for (j=0; j<nOrderPoints; j++) WritePoint(rPolygon.GetPoint(i++)); } } @@ -1308,7 +1308,7 @@ void METWriter::METLine(const PolyPolygon & rPolyPolygon) void METWriter::METLineAtCurPos(Point aPt) { WillWriteOrder(10); - *pMET << (sal_uInt8)0x81 << (sal_uInt8)8; + pMET->WriteUChar( (sal_uInt8)0x81 ).WriteUChar( (sal_uInt8)8 ); WritePoint(aPt); } @@ -1321,19 +1321,19 @@ void METWriter::METBox(sal_Bool bFill, sal_Bool bBoundary, if (bBoundary) nFlags|=0x20; WillWriteOrder(28); - *pMET << (sal_uInt8)0xc0 << (sal_uInt8)26 << nFlags << (sal_uInt8)0; + pMET->WriteUChar( (sal_uInt8)0xc0 ).WriteUChar( (sal_uInt8)26 ).WriteUChar( nFlags ).WriteUChar( (sal_uInt8)0 ); WritePoint(aRect.BottomLeft()); WritePoint(aRect.TopRight()); - *pMET << nHAxis << nVAxis; + pMET->WriteUInt32( nHAxis ).WriteUInt32( nVAxis ); } void METWriter::METFullArc(Point aCenter, double fMultiplier) { WillWriteOrder(14); - *pMET << (sal_uInt8)0xc7 << (sal_uInt8)12; + pMET->WriteUChar( (sal_uInt8)0xc7 ).WriteUChar( (sal_uInt8)12 ); WritePoint(aCenter); - *pMET << (sal_Int32)(fMultiplier*65536.0+0.5); + pMET->WriteInt32( (sal_Int32)(fMultiplier*65536.0+0.5) ); } @@ -1347,11 +1347,11 @@ void METWriter::METPartialArcAtCurPos(Point aCenter, double fMultiplier, while (fSweepAngle>360.0) fSweepAngle-=360.0; while (fSweepAngle<.00) fSweepAngle+=360.0; WillWriteOrder(22); - *pMET << (sal_uInt8)0xa3 << (sal_uInt8)20; + pMET->WriteUChar( (sal_uInt8)0xa3 ).WriteUChar( (sal_uInt8)20 ); WritePoint(aCenter); - *pMET << (sal_Int32)(fMultiplier*65536.0+0.5); - *pMET << (sal_Int32)(fStartAngle*65536.0+0.5); - *pMET << (sal_Int32)(fSweepAngle*65536.0+0.5); + pMET->WriteInt32( (sal_Int32)(fMultiplier*65536.0+0.5) ); + pMET->WriteInt32( (sal_Int32)(fStartAngle*65536.0+0.5) ); + pMET->WriteInt32( (sal_Int32)(fSweepAngle*65536.0+0.5) ); } @@ -1361,18 +1361,18 @@ void METWriter::METChrStr( Point aPt, OUString aUniStr ) osl_getThreadTextEncoding())); sal_uInt16 nLen = aStr.getLength(); WillWriteOrder( 11 + nLen ); - *pMET << (sal_uInt8)0xc3 << (sal_uInt8)( 9 + nLen ); + pMET->WriteUChar( (sal_uInt8)0xc3 ).WriteUChar( (sal_uInt8)( 9 + nLen ) ); WritePoint(aPt); for (sal_uInt16 i = 0; i < nLen; ++i) - *pMET << aStr[i]; - *pMET << (sal_uInt8)0; + pMET->WriteChar( aStr[i] ); + pMET->WriteUChar( (sal_uInt8)0 ); } void METWriter::METSetArcParams(sal_Int32 nP, sal_Int32 nQ, sal_Int32 nR, sal_Int32 nS) { WillWriteOrder(18); - *pMET << (sal_uInt8)0x22 << (sal_uInt8)16 << nP << nQ << nR << nS; + pMET->WriteUChar( (sal_uInt8)0x22 ).WriteUChar( (sal_uInt8)16 ).WriteInt32( nP ).WriteInt32( nQ ).WriteInt32( nR ).WriteInt32( nS ); } @@ -1382,10 +1382,10 @@ void METWriter::METSetColor(Color aColor) aMETColor=aColor; WillWriteOrder(6); - *pMET << (sal_uInt8)0xa6 << (sal_uInt8)4 << (sal_uInt8)0 - << (sal_uInt8)(aColor.GetBlue()) - << (sal_uInt8)(aColor.GetGreen()) - << (sal_uInt8)(aColor.GetRed()); + pMET->WriteUChar( (sal_uInt8)0xa6 ).WriteUChar( (sal_uInt8)4 ).WriteUChar( (sal_uInt8)0 ) + .WriteUChar( (sal_uInt8)(aColor.GetBlue()) ) + .WriteUChar( (sal_uInt8)(aColor.GetGreen()) ) + .WriteUChar( (sal_uInt8)(aColor.GetRed()) ); } @@ -1395,10 +1395,10 @@ void METWriter::METSetBackgroundColor(Color aColor) aMETBackgroundColor=aColor; WillWriteOrder(6); - *pMET << (sal_uInt8)0xa7 << (sal_uInt8)4 << (sal_uInt8)0 - << (sal_uInt8)(aColor.GetBlue()) - << (sal_uInt8)(aColor.GetGreen()) - << (sal_uInt8)(aColor.GetRed()); + pMET->WriteUChar( (sal_uInt8)0xa7 ).WriteUChar( (sal_uInt8)4 ).WriteUChar( (sal_uInt8)0 ) + .WriteUChar( (sal_uInt8)(aColor.GetBlue()) ) + .WriteUChar( (sal_uInt8)(aColor.GetGreen()) ) + .WriteUChar( (sal_uInt8)(aColor.GetRed()) ); } void METWriter::METSetMix(RasterOp eROP) @@ -1418,7 +1418,7 @@ void METWriter::METSetMix(RasterOp eROP) } WillWriteOrder(2); - *pMET << (sal_uInt8)0x0c << nMix; + pMET->WriteUChar( (sal_uInt8)0x0c ).WriteUChar( nMix ); } @@ -1430,7 +1430,7 @@ void METWriter::METSetChrCellSize(Size aSize) aMETChrCellSize=aSize; WillWriteOrder(10); if (aSize.Width()==0) aSize.Width()=aSize.Height(); - *pMET << (sal_uInt8)0x33 << (sal_uInt8)8 << (sal_Int32)aSize.Width() << (sal_Int32)aSize.Height(); + pMET->WriteUChar( (sal_uInt8)0x33 ).WriteUChar( (sal_uInt8)8 ).WriteInt32( (sal_Int32)aSize.Width() ).WriteInt32( (sal_Int32)aSize.Height() ); } @@ -1454,7 +1454,7 @@ void METWriter::METSetChrAngle(short nAngle) } WillWriteOrder(10); - *pMET << (sal_uInt8)0x34 << (sal_uInt8)8 << nax << nay; + pMET->WriteUChar( (sal_uInt8)0x34 ).WriteUChar( (sal_uInt8)8 ).WriteInt32( nax ).WriteInt32( nay ); } @@ -1465,7 +1465,7 @@ void METWriter::METSetChrSet(sal_uInt8 nSet) nMETChrSet=nSet; WillWriteOrder(2); - *pMET << (sal_uInt8)0x38 << nSet; + pMET->WriteUChar( (sal_uInt8)0x38 ).WriteUChar( nSet ); } @@ -2331,18 +2331,18 @@ void METWriter::WriteObjectEnvironmentGroup(const GDIMetaFile * pMTF) //--- The Field 'Map Color Attribute Table': WriteFieldIntroducer(22,MapColAtrMagic,0,0); WriteBigEndianShort(0x000e); - *pMET << (sal_uInt8)0x0c << (sal_uInt8)0x02 << (sal_uInt8)0x84 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0x0c ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x84 ).WriteUChar( (sal_uInt8)0x00 ); WriteFieldId(4); //--- The first Field 'Map Coded Font': WriteFieldIntroducer(32,MapCodFntMagic,0,0); WriteBigEndianShort(0x0018); - *pMET << (sal_uInt8)0x0c << (sal_uInt8)0x02 << (sal_uInt8)0x84 << (sal_uInt8)0x00; - *pMET << (sal_uInt8)0xff << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00; - *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00; - *pMET << (sal_uInt8)0x04 << (sal_uInt8)0x24 << (sal_uInt8)0x05 << (sal_uInt8)0x00; - *pMET << (sal_uInt8)0x06 << (sal_uInt8)0x20; - *pMET << (sal_uInt8)0x03 << (sal_uInt8)0x97 << (sal_uInt8)0x01 << (sal_uInt8)0xb5; + pMET->WriteUChar( (sal_uInt8)0x0c ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x84 ).WriteUChar( (sal_uInt8)0x00 ); + pMET->WriteUChar( (sal_uInt8)0xff ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ); + pMET->WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ); + pMET->WriteUChar( (sal_uInt8)0x04 ).WriteUChar( (sal_uInt8)0x24 ).WriteUChar( (sal_uInt8)0x05 ).WriteUChar( (sal_uInt8)0x00 ); + pMET->WriteUChar( (sal_uInt8)0x06 ).WriteUChar( (sal_uInt8)0x20 ); + pMET->WriteUChar( (sal_uInt8)0x03 ).WriteUChar( (sal_uInt8)0x97 ).WriteUChar( (sal_uInt8)0x01 ).WriteUChar( (sal_uInt8)0xb5 ); //--- The additional Fields 'Map Coded Font': CreateChrSets(pMTF); @@ -2354,10 +2354,10 @@ void METWriter::WriteObjectEnvironmentGroup(const GDIMetaFile * pMTF) { WriteFieldIntroducer(29,MapDatResMagic,0,0); WriteBigEndianShort(0x0015); - *pMET << (sal_uInt8)0x0c << (sal_uInt8)0x02 << (sal_uInt8)0x84 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0x0c ).WriteUChar( (sal_uInt8)0x02 ).WriteUChar( (sal_uInt8)0x84 ).WriteUChar( (sal_uInt8)0x00 ); WriteFieldId(nId); - *pMET << (sal_uInt8)0x07 << (sal_uInt8)0x22 << (sal_uInt8)0x10; - *pMET << (sal_uInt32)nId; + pMET->WriteUChar( (sal_uInt8)0x07 ).WriteUChar( (sal_uInt8)0x22 ).WriteUChar( (sal_uInt8)0x10 ); + pMET->WriteUInt32( (sal_uInt32)nId ); nId++; } @@ -2395,11 +2395,11 @@ void METWriter::WriteGraphicsObject(const GDIMetaFile * pMTF) nNumberOfDataFields++; // now at first we write the head of the segment: - *pMET << (sal_uInt8)0x70 << (sal_uInt8)0x0e << (sal_uInt32)0; - *pMET << (sal_uInt8)0x70 << (sal_uInt8)0x10; // Flags - *pMET << (sal_uInt16)0; // Lo-Word of the length of the segment data (Big Endian) - *pMET << (sal_uInt32)0; // Reserved - *pMET << (sal_uInt16)0; // Hi-Word of the length of the segment (Big Endian) (Ohh Ohh OS2) + pMET->WriteUChar( (sal_uInt8)0x70 ).WriteUChar( (sal_uInt8)0x0e ).WriteUInt32( (sal_uInt32)0 ); + pMET->WriteUChar( (sal_uInt8)0x70 ).WriteUChar( (sal_uInt8)0x10 ); // Flags + pMET->WriteUInt16( (sal_uInt16)0 ); // Lo-Word of the length of the segment data (Big Endian) + pMET->WriteUInt32( (sal_uInt32)0 ); // Reserved + pMET->WriteUInt16( (sal_uInt16)0 ); // Hi-Word of the length of the segment (Big Endian) (Ohh Ohh OS2) // Annotation: we're writing the correct data length again below // now all orders are being written out: @@ -2462,10 +2462,10 @@ void METWriter::WriteDocument(const GDIMetaFile * pMTF) //--- The Field 'Begin Document': WriteFieldIntroducer(0,BegDocumnMagic,0,0); WriteFieldId(1); - *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00; - *pMET << (sal_uInt8)0x05 << (sal_uInt8)0x18 << (sal_uInt8)0x03 << (sal_uInt8)0x0c << (sal_uInt8)0x00; - *pMET << (sal_uInt8)0x06 << (sal_uInt8)0x01 << (sal_uInt8)0x03 << (sal_uInt8)0xd4 << (sal_uInt8)0x03 << (sal_uInt8)0x52; - *pMET << (sal_uInt8)0x03 << (sal_uInt8)0x65 << (sal_uInt8)0x00; + pMET->WriteUChar( (sal_uInt8)0x00 ).WriteUChar( (sal_uInt8)0x00 ); + pMET->WriteUChar( (sal_uInt8)0x05 ).WriteUChar( (sal_uInt8)0x18 ).WriteUChar( (sal_uInt8)0x03 ).WriteUChar( (sal_uInt8)0x0c ).WriteUChar( (sal_uInt8)0x00 ); + pMET->WriteUChar( (sal_uInt8)0x06 ).WriteUChar( (sal_uInt8)0x01 ).WriteUChar( (sal_uInt8)0x03 ).WriteUChar( (sal_uInt8)0xd4 ).WriteUChar( (sal_uInt8)0x03 ).WriteUChar( (sal_uInt8)0x52 ); + pMET->WriteUChar( (sal_uInt8)0x03 ).WriteUChar( (sal_uInt8)0x65 ).WriteUChar( (sal_uInt8)0x00 ); UpdateFieldSize(); //--- The Content: diff --git a/filter/source/graphicfilter/epbm/epbm.cxx b/filter/source/graphicfilter/epbm/epbm.cxx index 7fc5743d23ed..f71ed0cad0d9 100644 --- a/filter/source/graphicfilter/epbm/epbm.cxx +++ b/filter/source/graphicfilter/epbm/epbm.cxx @@ -119,14 +119,14 @@ sal_Bool PBMWriter::ImplWriteHeader() if ( mnWidth && mnHeight ) { if ( mnMode == 0 ) - m_rOStm << "P4\x0a"; + m_rOStm.WriteCharPtr( "P4\x0a" ); else - m_rOStm << "P1\x0a"; + m_rOStm.WriteCharPtr( "P1\x0a" ); ImplWriteNumber( mnWidth ); - m_rOStm << (sal_uInt8)32; + m_rOStm.WriteUChar( (sal_uInt8)32 ); ImplWriteNumber( mnHeight ); - m_rOStm << (sal_uInt8)10; + m_rOStm.WriteUChar( (sal_uInt8)10 ); } else mbStatus = sal_False; return mbStatus; @@ -148,10 +148,10 @@ void PBMWriter::ImplWriteBody() if (!(mpAcc->GetPixelIndex( y, x ) & 1 ) ) nBYTE++; if ( ( x & 7 ) == 7 ) - m_rOStm << nBYTE; + m_rOStm.WriteUChar( nBYTE ); } if ( ( x & 7 ) != 0 ) - m_rOStm << (sal_uInt8)( nBYTE << ( ( x ^ 7 ) + 1 ) ); + m_rOStm.WriteUChar( (sal_uInt8)( nBYTE << ( ( x ^ 7 ) + 1 ) ) ); } } else @@ -165,11 +165,11 @@ void PBMWriter::ImplWriteBody() if (!( --nxCount ) ) { nxCount = 69; - m_rOStm << (sal_uInt8)10; + m_rOStm.WriteUChar( (sal_uInt8)10 ); } - m_rOStm << (sal_uInt8)( ( mpAcc->GetPixelIndex( y, x ) ^ 1 ) + '0' ) ; + m_rOStm.WriteUChar( (sal_uInt8)( ( mpAcc->GetPixelIndex( y, x ) ^ 1 ) + '0' ) ) ; } - m_rOStm << (sal_uInt8)10; + m_rOStm.WriteUChar( (sal_uInt8)10 ); } } } @@ -180,7 +180,7 @@ void PBMWriter::ImplWriteBody() void PBMWriter::ImplWriteNumber(sal_Int32 nNumber) { const OString aNum(OString::number(nNumber)); - m_rOStm << aNum.getStr(); + m_rOStm.WriteCharPtr( aNum.getStr() ); } // ------------------------------------------------------------------------ diff --git a/filter/source/graphicfilter/epgm/epgm.cxx b/filter/source/graphicfilter/epgm/epgm.cxx index 40ee4c5066e7..3a61cf0b0dfe 100644 --- a/filter/source/graphicfilter/epgm/epgm.cxx +++ b/filter/source/graphicfilter/epgm/epgm.cxx @@ -120,16 +120,16 @@ sal_Bool PGMWriter::ImplWriteHeader() if ( mnWidth && mnHeight ) { if ( mnMode == 0 ) - m_rOStm << "P5\x0a"; + m_rOStm.WriteCharPtr( "P5\x0a" ); else - m_rOStm << "P2\x0a"; + m_rOStm.WriteCharPtr( "P2\x0a" ); ImplWriteNumber( mnWidth ); - m_rOStm << (sal_uInt8)32; + m_rOStm.WriteUChar( (sal_uInt8)32 ); ImplWriteNumber( mnHeight ); - m_rOStm << (sal_uInt8)32; + m_rOStm.WriteUChar( (sal_uInt8)32 ); ImplWriteNumber( 255 ); // max. gray value - m_rOStm << (sal_uInt8)10; + m_rOStm.WriteUChar( (sal_uInt8)10 ); } else mbStatus = sal_False; @@ -147,7 +147,7 @@ void PGMWriter::ImplWriteBody() { for ( sal_uLong x = 0; x < mnWidth; x++ ) { - m_rOStm << mpAcc->GetPixelIndex( y, x ); + m_rOStm.WriteUChar( mpAcc->GetPixelIndex( y, x ) ); } } } @@ -162,18 +162,18 @@ void PGMWriter::ImplWriteBody() if ( nCount < 0 ) { nCount = 69; - m_rOStm << (sal_uInt8)10; + m_rOStm.WriteUChar( (sal_uInt8)10 ); } nDat = mpAcc->GetPixelIndex( y, x ); nNumb = nDat / 100; if ( nNumb ) { - m_rOStm << (sal_uInt8)( nNumb + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nNumb + '0' ) ); nDat -= ( nNumb * 100 ); nNumb = nDat / 10; - m_rOStm << (sal_uInt8)( nNumb + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nNumb + '0' ) ); nDat -= ( nNumb * 10 ); - m_rOStm << (sal_uInt8)( nDat + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nDat + '0' ) ); nCount -= 4; } else @@ -181,20 +181,20 @@ void PGMWriter::ImplWriteBody() nNumb = nDat / 10; if ( nNumb ) { - m_rOStm << (sal_uInt8)( nNumb + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nNumb + '0' ) ); nDat -= ( nNumb * 10 ); - m_rOStm << (sal_uInt8)( nDat + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nDat + '0' ) ); nCount -= 3; } else { - m_rOStm << (sal_uInt8)( nDat + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nDat + '0' ) ); nCount -= 2; } } - m_rOStm << (sal_uInt8)' '; + m_rOStm.WriteUChar( (sal_uInt8)' ' ); } - m_rOStm << (sal_uInt8)10; + m_rOStm.WriteUChar( (sal_uInt8)10 ); } } } @@ -204,7 +204,7 @@ void PGMWriter::ImplWriteBody() void PGMWriter::ImplWriteNumber(sal_Int32 nNumber) { const OString aNum(OString::number(nNumber)); - m_rOStm << aNum.getStr(); + m_rOStm.WriteCharPtr( aNum.getStr() ); } // ------------------------------------------------------------------------ diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx index b0a19bb0c2da..54a02a99f233 100644 --- a/filter/source/graphicfilter/epict/epict.cxx +++ b/filter/source/graphicfilter/epict/epict.cxx @@ -288,14 +288,14 @@ Polygon PictWriter::PolyPolygonToPolygon(const PolyPolygon & rPolyPoly) void PictWriter::WritePoint(const Point & rPoint) { Point aPoint = OutputDevice::LogicToLogic( rPoint, aSrcMapMode, aTargetMapMode ); - *pPict << ((short)aPoint.Y()) << ((short)aPoint.X()); + pPict->WriteInt16( (short)aPoint.Y() ).WriteInt16( (short)aPoint.X() ); } void PictWriter::WriteSize(const Size & rSize) { OutputDevice::LogicToLogic( rSize, aSrcMapMode, aTargetMapMode ); // -Wall is this needed. - *pPict << ((short)rSize.Height()) << ((short)rSize.Width()); + pPict->WriteInt16( (short)rSize.Height() ).WriteInt16( (short)rSize.Width() ); } @@ -305,7 +305,7 @@ void PictWriter::WriteRGBColor(const Color & rColor) const sal_uInt16 nG = ( (sal_uInt16) rColor.GetGreen() << 8 ) | (sal_uInt16) rColor.GetGreen(); const sal_uInt16 nB = ( (sal_uInt16) rColor.GetBlue() << 8 ) | (sal_uInt16) rColor.GetBlue(); - *pPict << nR << nG << nB; + pPict->WriteUInt16( nR ).WriteUInt16( nG ).WriteUInt16( nB ); } void PictWriter::WriteString( const OUString & rString ) @@ -314,9 +314,9 @@ void PictWriter::WriteString( const OUString & rString ) sal_Int32 nLen = aString.getLength(); if ( nLen > 255 ) nLen = 255; - *pPict << ( (sal_uInt8)nLen ); + pPict->WriteUChar( (sal_uInt8)nLen ); for (sal_Int32 i = 0; i < nLen; ++i) - *pPict << aString[i]; + pPict->WriteChar( aString[i] ); } Rectangle PictWriter::MapRectangle( const Rectangle& rRect ) @@ -333,8 +333,8 @@ Rectangle PictWriter::MapRectangle( const Rectangle& rRect ) void PictWriter::WriteRectangle(const Rectangle & rRect) { Rectangle aRect( MapRectangle( rRect ) ); - *pPict << (sal_Int16)aRect.Top() << (sal_Int16)aRect.Left() - << (sal_Int16)aRect.Bottom() << (sal_Int16)aRect.Right(); + pPict ->WriteInt16( (sal_Int16)aRect.Top() ).WriteInt16( (sal_Int16)aRect.Left() ) + .WriteInt16( (sal_Int16)aRect.Bottom() ).WriteInt16( (sal_Int16)aRect.Right() ); } void PictWriter::WritePolygon(const Polygon & rPoly) @@ -373,7 +373,7 @@ void PictWriter::WritePolygon(const Polygon & rPoly) nMaxY=ny; } - *pPict << nDataSize << nMinY << nMinX << nMaxY << nMaxX; + pPict->WriteUInt16( nDataSize ).WriteInt16( nMinY ).WriteInt16( nMinX ).WriteInt16( nMaxY ).WriteInt16( nMaxX ); for (i=0; i<nSize; i++) WritePoint( aPoly.GetPoint(i) ); @@ -418,7 +418,7 @@ void PictWriter::WriteArcAngles(const Rectangle & rRect, const Point & rStartPt, nArcAngle=((short)(fAngE*180.0/3.14159265359))-nStartAngle; if (nArcAngle<0) nArcAngle += 360; - *pPict << nStartAngle << nArcAngle; + pPict->WriteInt16( nStartAngle ).WriteInt16( nArcAngle ); } @@ -468,7 +468,7 @@ void PictWriter::WriteOpcode_TxFace(const Font & rFont) if (rFont.IsShadow()==sal_True) nFace|=0x10; if (bDstTxFaceValid==sal_False || nDstTxFace!=nFace) { - *pPict << (sal_uInt16)0x0004 << nFace << (sal_uInt8)0; + pPict->WriteUInt16( (sal_uInt16)0x0004 ).WriteUChar( nFace ).WriteUChar( (sal_uInt8)0 ); nDstTxFace=nFace; bDstTxFaceValid=sal_True; } @@ -485,7 +485,7 @@ void PictWriter::WriteOpcode_TxMode(RasterOp eMode) case ROP_XOR: nVal=0x000a; break; default: nVal=0x0008; } - *pPict << (sal_uInt16)0x0005 << nVal; + pPict->WriteUInt16( (sal_uInt16)0x0005 ).WriteUInt16( nVal ); eDstTxMode=eMode; bDstTxModeValid=sal_True; } @@ -496,7 +496,7 @@ void PictWriter::WriteOpcode_PnSize(sal_uInt16 nSize) { if (nSize==0) nSize=1; if (bDstPnSizeValid==sal_False || nDstPnSize!=nSize) { - *pPict << (sal_uInt16)0x0007 << nSize << nSize; + pPict->WriteUInt16( (sal_uInt16)0x0007 ).WriteUInt16( nSize ).WriteUInt16( nSize ); nDstPnSize=nSize; bDstPnSizeValid=sal_True; } @@ -514,7 +514,7 @@ void PictWriter::WriteOpcode_PnMode(RasterOp eMode) case ROP_XOR: nVal=0x000a; break; default: nVal=0x0008; } - *pPict << (sal_uInt16)0x0008 << nVal; + pPict->WriteUInt16( (sal_uInt16)0x0008 ).WriteUInt16( nVal ); eDstPnMode=eMode; bDstPnModeValid=sal_True; } @@ -527,7 +527,7 @@ void PictWriter::WriteOpcode_PnLinePat(sal_Bool bVisible) ConvertLinePattern(aPat,bVisible); if (bDstPnPatValid==sal_False || aDstPnPat.nHi!=aPat.nHi || aDstPnPat.nLo!=aPat.nLo) { - *pPict << (sal_uInt16)0x0009 << aPat.nHi << aPat.nLo; + pPict->WriteUInt16( (sal_uInt16)0x0009 ).WriteUInt32( aPat.nHi ).WriteUInt32( aPat.nLo ); aDstPnPat=aPat; bDstPnPatValid=sal_True; } @@ -540,7 +540,7 @@ void PictWriter::WriteOpcode_PnFillPat(sal_Bool bVisible) ConvertFillPattern(aPat,bVisible); if (bDstPnPatValid==sal_False || aDstPnPat.nHi!=aPat.nHi || aDstPnPat.nLo!=aPat.nLo) { - *pPict << (sal_uInt16)0x0009 << aPat.nHi << aPat.nLo; + pPict->WriteUInt16( (sal_uInt16)0x0009 ).WriteUInt32( aPat.nHi ).WriteUInt32( aPat.nLo ); aDstPnPat=aPat; bDstPnPatValid=sal_True; } @@ -549,7 +549,7 @@ void PictWriter::WriteOpcode_PnFillPat(sal_Bool bVisible) void PictWriter::WriteOpcode_OvSize(const Size & rSize) { - *pPict << (sal_uInt16)0x000b; + pPict->WriteUInt16( (sal_uInt16)0x000b ); WriteSize(rSize); } @@ -561,7 +561,7 @@ void PictWriter::WriteOpcode_TxSize(sal_uInt16 nSize) nDstTxSize = (sal_uInt16) OutputDevice::LogicToLogic( Size( 0, nSize ), aSrcMapMode, aTargetMapMode ).Height(); - *pPict << (sal_uInt16)0x000d << nDstTxSize; + pPict->WriteUInt16( (sal_uInt16)0x000d ).WriteUInt16( nDstTxSize ); bDstTxSizeValid=sal_True; } } @@ -570,7 +570,7 @@ void PictWriter::WriteOpcode_TxSize(sal_uInt16 nSize) void PictWriter::WriteOpcode_RGBFgCol(const Color & rColor) { if (bDstFgColValid==sal_False || aDstFgCol!=rColor) { - *pPict << (sal_uInt16)0x001a; + pPict->WriteUInt16( (sal_uInt16)0x001a ); WriteRGBColor(rColor); aDstFgCol=rColor; bDstFgColValid=sal_True; @@ -581,7 +581,7 @@ void PictWriter::WriteOpcode_RGBFgCol(const Color & rColor) void PictWriter::WriteOpcode_RGBBkCol(const Color & rColor) { if (bDstBkColValid==sal_False || aDstBkCol!=rColor) { - *pPict << (sal_uInt16)0x001b; + pPict->WriteUInt16( (sal_uInt16)0x001b ); WriteRGBColor(rColor); aDstBkCol=rColor; bDstBkColValid=sal_True; @@ -603,13 +603,13 @@ void PictWriter::WriteOpcode_Line(const Point & rLocPt, const Point & rNewPt) dv=aNewPt.Y()-aLocPt.Y(); if (dh<=127 && dh>=-128 && dv<=127 && dv>=-128) { // ShortLine - *pPict << (sal_uInt16)0x0022; + pPict->WriteUInt16( (sal_uInt16)0x0022 ); WritePoint(rLocPt); - *pPict << (char)dh << (char)dv; + pPict->WriteChar( (char)dh ).WriteChar( (char)dv ); } else { - *pPict << (sal_uInt16)0x0020; + pPict->WriteUInt16( (sal_uInt16)0x0020 ); WritePoint(rLocPt); WritePoint(rNewPt); } @@ -630,12 +630,12 @@ void PictWriter::WriteOpcode_LineFrom(const Point & rNewPt) if (dh<=127 && dh>=-128 && dv<=127 && dv>=-128) { // ShortLine - *pPict << (sal_uInt16)0x0023; - *pPict << (char)dh << (char)dv; + pPict->WriteUInt16( (sal_uInt16)0x0023 ); + pPict->WriteChar( (char)dh ).WriteChar( (char)dv ); } else { - *pPict << (sal_uInt16)0x0021; + pPict->WriteUInt16( (sal_uInt16)0x0021 ); WritePoint(rNewPt); } aDstPenPosition=rNewPt; @@ -657,25 +657,25 @@ void PictWriter::WriteOpcode_Text(const Point & rPoint, const OUString& rString, if (bDstTextPositionValid==sal_False || dh<0 || dh>255 || dv<0 || dv>255 || bDelta==sal_False) { - *pPict << (sal_uInt16)0x0028; + pPict->WriteUInt16( (sal_uInt16)0x0028 ); WritePoint(rPoint); } else if (dv==0) { - *pPict << (sal_uInt16)0x0029 << (sal_uInt8)dh; + pPict->WriteUInt16( (sal_uInt16)0x0029 ).WriteUChar( (sal_uInt8)dh ); } else if (dh==0) { - *pPict << (sal_uInt16)0x002a << (sal_uInt8)dv; + pPict->WriteUInt16( (sal_uInt16)0x002a ).WriteUChar( (sal_uInt8)dv ); } else { - *pPict << (sal_uInt16)0x002b << (sal_uInt8)dh << (sal_uInt8)dv; + pPict->WriteUInt16( (sal_uInt16)0x002b ).WriteUChar( (sal_uInt8)dh ).WriteUChar( (sal_uInt8)dv ); } WriteString( rString ); if (((pPict->Tell()-nPos)&1)!=0) - *pPict << (sal_uInt8)0; + pPict->WriteUChar( (sal_uInt8)0 ); aDstTextPosition = aPoint; bDstTextPositionValid=sal_True; @@ -700,12 +700,12 @@ void PictWriter::WriteOpcode_FontName(const Font & rFont) if ( nFontNameLen ) { nDataLen = 3 + nFontNameLen; - *pPict << (sal_uInt16)0x002c << nDataLen << nFontId; + pPict->WriteUInt16( (sal_uInt16)0x002c ).WriteUInt16( nDataLen ).WriteUInt16( nFontId ); WriteString( rFont.GetName() ); if ( ( nFontNameLen & 1 ) == 0 ) - *pPict << (sal_uInt8)0; + pPict->WriteUChar( (sal_uInt8)0 ); } - *pPict << (sal_uInt16)0x0003 << nFontId; + pPict->WriteUInt16( (sal_uInt16)0x0003 ).WriteUInt16( nFontId ); aDstFontName=rFont.GetName(); nDstFontNameId=nFontId; bDstFontNameValid=sal_True; @@ -717,10 +717,10 @@ void PictWriter::WriteOpcode_ClipRect( const Rectangle& rRect ) Rectangle aRect( MapRectangle( rRect ) ); ++aRect.Bottom(); ++aRect.Right(); - *pPict << (sal_uInt16)1 // opcode 1 - << (sal_uInt16)10 // data size - << (sal_Int16)aRect.Top() << (sal_Int16)aRect.Left() - << (sal_Int16)aRect.Bottom() << (sal_Int16)aRect.Right(); + pPict ->WriteUInt16( (sal_uInt16)1 ) // opcode 1 + .WriteUInt16( (sal_uInt16)10 ) // data size + .WriteInt16( (sal_Int16)aRect.Top() ).WriteInt16( (sal_Int16)aRect.Left() ) + .WriteInt16( (sal_Int16)aRect.Bottom() ).WriteInt16( (sal_Int16)aRect.Right() ); aClipRect = aRect; } @@ -735,7 +735,7 @@ void PictWriter::WriteOpcode_Rect(PictDrawingMethod eMethod, const Rectangle & r case PDM_FILL: oc=0x0034; break; default: oc=0; break; // -Wall a default for oc... } - *pPict << oc; + pPict->WriteUInt16( oc ); WriteRectangle(rRect); } @@ -751,7 +751,7 @@ void PictWriter::WriteOpcode_SameRect(PictDrawingMethod eMethod) case PDM_FILL: oc=0x003c; break; default: oc=0; break; // -Wall a default for oc... } - *pPict << oc; + pPict->WriteUInt16( oc ); } @@ -766,7 +766,7 @@ void PictWriter::WriteOpcode_RRect(PictDrawingMethod eMethod, const Rectangle & case PDM_FILL: oc=0x0044; break; default: oc=0; break; // -Wall a default for oc... } - *pPict << oc; + pPict->WriteUInt16( oc ); WriteRectangle(rRect); } @@ -782,7 +782,7 @@ void PictWriter::WriteOpcode_SameRRect(PictDrawingMethod eMethod) case PDM_FILL: oc=0x004c; break; default: oc=0; break; // -Wall a default for oc... } - *pPict << oc; + pPict->WriteUInt16( oc ); } @@ -797,7 +797,7 @@ void PictWriter::WriteOpcode_Oval(PictDrawingMethod eMethod, const Rectangle & r case PDM_FILL: oc=0x0054; break; default: oc=0; break; // -Wall a default for oc... } - *pPict << oc; + pPict->WriteUInt16( oc ); WriteRectangle(rRect); } @@ -813,7 +813,7 @@ void PictWriter::WriteOpcode_SameOval(PictDrawingMethod eMethod) case PDM_FILL: oc=0x005c; break; default: oc=0; break; // -Wall a default for oc... } - *pPict << oc; + pPict->WriteUInt16( oc ); } @@ -829,7 +829,7 @@ void PictWriter::WriteOpcode_Arc(PictDrawingMethod eMethod, const Rectangle & rR case PDM_FILL: oc=0x0064; break; default: oc=0; break; // -Wall a default for oc... } - *pPict << oc; + pPict->WriteUInt16( oc ); WriteRectangle(rRect); WriteArcAngles(rRect,rStartPt,rEndPt); } @@ -847,7 +847,7 @@ void PictWriter::WriteOpcode_SameArc(PictDrawingMethod eMethod, const Rectangle case PDM_FILL: oc=0x006c; break; default: oc=0; break; // -Wall a default for oc... } - *pPict << oc; + pPict->WriteUInt16( oc ); WriteArcAngles(rRect,rStartPt,rEndPt); } @@ -865,7 +865,7 @@ void PictWriter::WriteOpcode_Poly(PictDrawingMethod eMethod, const Polygon & rPo case PDM_FILL: oc=0x0074; break; default: oc=0; break; // -Wall a default for oc... } - *pPict << oc; + pPict->WriteUInt16( oc ); WritePolygon(rPoly); } @@ -910,7 +910,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, nDstRowBytes = nWidth * 4; // writing Opcode and BaseAddr (?): - *pPict << (sal_uInt16)0x009a << (sal_uInt32)0x000000ff; + pPict->WriteUInt16( (sal_uInt16)0x009a ).WriteUInt32( (sal_uInt32)0x000000ff ); // Normally we want to produce packing type 4 (run length encoding // for 32-bit pixels). But if RowBytes<8 is true, generally all data is @@ -923,36 +923,36 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, nPackType = 4; // writing PixMap-Structure: - *pPict << (sal_uInt16)(nDstRowBytes|0x8000) // Bytes per row and the fact that it's a 'PixMap' - << (sal_uInt16)0x0000 // Y1-position of the bitmap in the source - << (sal_uInt16)0x0000 // X1-position of the bitmap in the source - << (sal_uInt16)nHeight // Y2-position of the bitmap in the source - << (sal_uInt16)nWidth // X2-position of the bitmap in the source - << (sal_uInt16)0x0000 // Version - << (sal_uInt16)nPackType // Packing type - << (sal_uInt32) 0x00000000 // Packing size (?) - << (sal_uInt32) 0x00480000 // H-Res - << (sal_uInt32) 0x00480000 // V-Res - << (sal_uInt16)0x0010 // Pixel type (?) - << (sal_uInt16)0x0020 // Pixel size: 32 bit - << (sal_uInt16)0x0004 // CmpCount: 4 components - << (sal_uInt16)0x0008 // CmpSize: 8 bits - << (sal_uInt32) 0x00000000 // PlaneBytes (?) - << (sal_uInt32) 0x00000000 // (?) - << (sal_uInt32) 0x00000000; // (?) + pPict->WriteUInt16( (sal_uInt16)(nDstRowBytes|0x8000) ) // Bytes per row and the fact that it's a 'PixMap' + .WriteUInt16( (sal_uInt16)0x0000 ) // Y1-position of the bitmap in the source + .WriteUInt16( (sal_uInt16)0x0000 ) // X1-position of the bitmap in the source + .WriteUInt16( (sal_uInt16)nHeight ) // Y2-position of the bitmap in the source + .WriteUInt16( (sal_uInt16)nWidth ) // X2-position of the bitmap in the source + .WriteUInt16( (sal_uInt16)0x0000 ) // Version + .WriteUInt16( (sal_uInt16)nPackType ) // Packing type + .WriteUInt32( (sal_uInt32) 0x00000000 ) // Packing size (?) + .WriteUInt32( (sal_uInt32) 0x00480000 ) // H-Res + .WriteUInt32( (sal_uInt32) 0x00480000 ) // V-Res + .WriteUInt16( (sal_uInt16)0x0010 ) // Pixel type (?) + .WriteUInt16( (sal_uInt16)0x0020 ) // Pixel size: 32 bit + .WriteUInt16( (sal_uInt16)0x0004 ) // CmpCount: 4 components + .WriteUInt16( (sal_uInt16)0x0008 ) // CmpSize: 8 bits + .WriteUInt32( (sal_uInt32) 0x00000000 ) // PlaneBytes (?) + .WriteUInt32( (sal_uInt32) 0x00000000 ) // (?) + .WriteUInt32( (sal_uInt32) 0x00000000 ); // (?) // Source-Rectangle schreiben: - *pPict << (sal_uInt16)0x0000 // Y1-position on the bitmap - << (sal_uInt16)0x0000 // X1-position on the bitmap - << (sal_uInt16)nHeight // Y2-position on the bitmap - << (sal_uInt16)nWidth; // X2-position on the bitmap + pPict->WriteUInt16( (sal_uInt16)0x0000 ) // Y1-position on the bitmap + .WriteUInt16( (sal_uInt16)0x0000 ) // X1-position on the bitmap + .WriteUInt16( (sal_uInt16)nHeight ) // Y2-position on the bitmap + .WriteUInt16( (sal_uInt16)nWidth ); // X2-position on the bitmap // writing the Destination-Rectangle: WritePoint( rPoint ); WritePoint( Point( rPoint.X() + rSize.Width(), rPoint.Y() + rSize.Height() ) ); // writing the Transfer mode: - *pPict << (sal_uInt16)0x0000; // (?) + pPict->WriteUInt16( (sal_uInt16)0x0000 ); // (?) // remember position of the Map-data in the target: nDstMapPos=pPict->Tell(); @@ -961,10 +961,10 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, { // don't pack for ( ny = 0; ny < nHeight; ny++ ) { - *pPict << (sal_uInt8)0; - *pPict << (sal_uInt8)pAcc->GetPixel( ny, 0 ).GetRed(); - *pPict << (sal_uInt8)pAcc->GetPixel( ny, 0 ).GetGreen(); - *pPict << (sal_uInt8)pAcc->GetPixel( ny, 0 ).GetBlue(); + pPict->WriteUChar( (sal_uInt8)0 ); + pPict->WriteUChar( (sal_uInt8)pAcc->GetPixel( ny, 0 ).GetRed() ); + pPict->WriteUChar( (sal_uInt8)pAcc->GetPixel( ny, 0 ).GetGreen() ); + pPict->WriteUChar( (sal_uInt8)pAcc->GetPixel( ny, 0 ).GetBlue() ); // count percentages, Callback, check errors: nActBitmapPercent = ( ny * 70 / nHeight ) + 30; // (30% already added up to the writing of the Win-BMP file) MayCallback(); @@ -994,9 +994,9 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, // ByteCount (that's the size of the packed row) is at first 0 (will be corrected later): if ( nDstRowBytes > 250 ) - *pPict << (sal_uInt16)0; + pPict->WriteUInt16( (sal_uInt16)0 ); else - *pPict << (sal_uInt8)0; + pPict->WriteUChar( (sal_uInt8)0 ); // loop trough components: for ( nc = 0; nc < 4; nc++ ) @@ -1029,10 +1029,10 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, if ( nCount > 128 ) nCount=128; nFlagCounterByte = (sal_uInt8)(nCount-1); - *pPict << nFlagCounterByte; + pPict->WriteUChar( nFlagCounterByte ); do { - *pPict << pComp[nc][nx++]; + pPict->WriteUChar( pComp[nc][nx++] ); nCount--; } while ( nCount > 0 ); @@ -1051,7 +1051,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, } // nCount write equal Bytes compressed: nFlagCounterByte = (sal_uInt8)( 1 - (long)nCount ); - *pPict << nFlagCounterByte << nEquData; + pPict->WriteUChar( nFlagCounterByte ).WriteUChar( nEquData ); nx += nCount; } } @@ -1060,9 +1060,9 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, nPos = pPict->Tell(); pPict->Seek( nDstRowPos ); if ( nDstRowBytes > 250 ) - *pPict << ( (sal_uInt16)( nPos - nDstRowPos - 2 ) ); + pPict->WriteUInt16( (sal_uInt16)( nPos - nDstRowPos - 2 ) ); else - *pPict << ( (sal_uInt8)( nPos - nDstRowPos - 1 ) ); + pPict->WriteUChar( (sal_uInt8)( nPos - nDstRowPos - 1 ) ); pPict->Seek( nPos ); // count percentages, Callback, check errors: @@ -1095,7 +1095,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, nSrcRowBytes = ( nDstRowBytes + 3 ) & 0xfffffffc; // writing Opcode: - *pPict << (sal_uInt16)0x0098; + pPict->WriteUInt16( (sal_uInt16)0x0098 ); // Normally we want to produce packing type 0 (default packing). // But if RowBytes<8 is true, generally all data is unpacked even if packing @@ -1107,45 +1107,45 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, nPackType = 0; // write PixMap-Structure: - *pPict << (sal_uInt16)(nDstRowBytes|0x8000) // Bytes per row and the fact that it's a 'PixMap' - << (sal_uInt16)0x0000 // Y1-position of the bitmap in the source - << (sal_uInt16)0x0000 // X1-position of the bitmap in the source - << (sal_uInt16)nHeight // Y2-position of the bitmap in the source - << (sal_uInt16)nWidth // X2-position of the bitmap in the source - << (sal_uInt16)0x0000 // Version - << (sal_uInt16)nPackType // Packing type - << (sal_uInt32) 0x00000000 // Packing size (?) - << (sal_uInt32) 0x00480000 // H-Res - << (sal_uInt32) 0x00480000 // V-Res - << (sal_uInt16)0x0000 // Pixel type (?) - << (sal_uInt16)nBitsPerPixel // Pixel size - << (sal_uInt16)0x0001 // CmpCount: 1 component - << (sal_uInt16)nBitsPerPixel // CmpSize - << (sal_uInt32) 0x00000000 // PlaneBytes (?) - << (sal_uInt32) 0x00000000 // (?) - << (sal_uInt32) 0x00000000; // (?) + pPict->WriteUInt16( (sal_uInt16)(nDstRowBytes|0x8000) ) // Bytes per row and the fact that it's a 'PixMap' + .WriteUInt16( (sal_uInt16)0x0000 ) // Y1-position of the bitmap in the source + .WriteUInt16( (sal_uInt16)0x0000 ) // X1-position of the bitmap in the source + .WriteUInt16( (sal_uInt16)nHeight ) // Y2-position of the bitmap in the source + .WriteUInt16( (sal_uInt16)nWidth ) // X2-position of the bitmap in the source + .WriteUInt16( (sal_uInt16)0x0000 ) // Version + .WriteUInt16( (sal_uInt16)nPackType ) // Packing type + .WriteUInt32( (sal_uInt32) 0x00000000 ) // Packing size (?) + .WriteUInt32( (sal_uInt32) 0x00480000 ) // H-Res + .WriteUInt32( (sal_uInt32) 0x00480000 ) // V-Res + .WriteUInt16( (sal_uInt16)0x0000 ) // Pixel type (?) + .WriteUInt16( (sal_uInt16)nBitsPerPixel ) // Pixel size + .WriteUInt16( (sal_uInt16)0x0001 ) // CmpCount: 1 component + .WriteUInt16( (sal_uInt16)nBitsPerPixel ) // CmpSize + .WriteUInt32( (sal_uInt32) 0x00000000 ) // PlaneBytes (?) + .WriteUInt32( (sal_uInt32) 0x00000000 ) // (?) + .WriteUInt32( (sal_uInt32) 0x00000000 ); // (?) // writing and reading the palette: nColTabSize = pAcc->GetPaletteEntryCount(); - *pPict << (sal_uInt32)0 << (sal_uInt16)0x8000 << (sal_uInt16)( nColTabSize - 1 ); + pPict->WriteUInt32( (sal_uInt32)0 ).WriteUInt16( (sal_uInt16)0x8000 ).WriteUInt16( (sal_uInt16)( nColTabSize - 1 ) ); for ( i = 0; i < nColTabSize; i++ ) { nRed = (sal_uInt8)pAcc->GetPaletteColor( (sal_uInt16)i ).GetRed(); nGreen = (sal_uInt8)pAcc->GetPaletteColor( (sal_uInt16)i ).GetGreen(); nBlue = (sal_uInt8)pAcc->GetPaletteColor( (sal_uInt16)i ).GetBlue(); - *pPict << (sal_uInt16)0 << nRed << nRed << nGreen << nGreen << nBlue << nBlue; + pPict->WriteUInt16( (sal_uInt16)0 ).WriteUChar( nRed ).WriteUChar( nRed ).WriteUChar( nGreen ).WriteUChar( nGreen ).WriteUChar( nBlue ).WriteUChar( nBlue ); } // writing Source-Rectangle: - *pPict << (sal_uInt16)0 << (sal_uInt16)0 << (sal_uInt16)nHeight << (sal_uInt16)nWidth; + pPict->WriteUInt16( (sal_uInt16)0 ).WriteUInt16( (sal_uInt16)0 ).WriteUInt16( (sal_uInt16)nHeight ).WriteUInt16( (sal_uInt16)nWidth ); // writing Destination-Rectangle: WritePoint( rPoint ); WritePoint( Point( rPoint.X() + rSize.Width(), rPoint.Y() + rSize.Height() ) ); // writing Transfer mode: - *pPict << (sal_uInt16)0; // (?) + pPict->WriteUInt16( (sal_uInt16)0 ); // (?) // allocate memory for a row: pPix = new sal_uInt8[ nSrcRowBytes ]; @@ -1190,9 +1190,9 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, // ByteCount (this is the size of the packed line) initialized with 0 (will be corrected later): if ( nDstRowBytes > 250 ) - *pPict << (sal_uInt16)0; + pPict->WriteUInt16( (sal_uInt16)0 ); else - *pPict << (sal_uInt8)0; + pPict->WriteUChar( (sal_uInt8)0 ); // loop trough bytes of the row: nx=0; @@ -1222,10 +1222,10 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, if ( nCount > 128 ) nCount = 128; nFlagCounterByte = (sal_uInt8)( nCount - 1 ); - *pPict << nFlagCounterByte; + pPict->WriteUChar( nFlagCounterByte ); do { - *pPict << pPix[ nx++ ]; + pPict->WriteUChar( pPix[ nx++ ] ); nCount--; } while ( nCount > 0 ); } @@ -1243,7 +1243,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, } // write nCount identical bytes unpacked: nFlagCounterByte = (sal_uInt8)( 1 - (long)nCount ); - *pPict << nFlagCounterByte << nEquData; + pPict->WriteUChar( nFlagCounterByte ).WriteUChar( nEquData ); nx += nCount; } } @@ -1252,9 +1252,9 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, nPos = pPict->Tell(); pPict->Seek( nDstRowPos ); if ( nDstRowBytes > 250 ) - *pPict << ( (sal_uInt16)( nPos - nDstRowPos - 2 ) ); + pPict->WriteUInt16( (sal_uInt16)( nPos - nDstRowPos - 2 ) ); else - *pPict << ( (sal_uInt8)( nPos - nDstRowPos - 1 ) ); + pPict->WriteUChar( (sal_uInt8)( nPos - nDstRowPos - 1 ) ); pPict->Seek( nPos ); } @@ -1270,7 +1270,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, // Map-Data has to be an even number of bytes: if ( ( ( pPict->Tell() - nDstMapPos ) & 1 ) != 0 ) - *pPict << (sal_uInt8)0; + pPict->WriteUChar( (sal_uInt8)0 ); // counting Bitmaps: nWrittenBitmaps++; @@ -1281,7 +1281,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize, void PictWriter::WriteOpcode_EndOfFile() { - *pPict << (sal_uInt16)0x00ff; + pPict->WriteUInt16( (sal_uInt16)0x00ff ); } @@ -2063,10 +2063,10 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF ) if ( pAt->aClipRect != aClipRect ) { Rectangle aRect( pAt->aClipRect ); - *pPict << (sal_uInt16)1 // opcode 1 - << (sal_uInt16)10 // data size - << (sal_Int16)aRect.Top() << (sal_Int16)aRect.Left() - << (sal_Int16)aRect.Bottom() << (sal_Int16)aRect.Right(); + pPict ->WriteUInt16( (sal_uInt16)1 ) // opcode 1 + .WriteUInt16( (sal_uInt16)10 ) // data size + .WriteInt16( (sal_Int16)aRect.Top() ).WriteInt16( (sal_Int16)aRect.Left() ) + .WriteInt16( (sal_Int16)aRect.Bottom() ).WriteInt16( (sal_Int16)aRect.Right() ); } aClipRect=pAt->aClipRect; pAttrStack=pAt->pSucc; @@ -2150,25 +2150,25 @@ void PictWriter::WriteHeader(const GDIMetaFile & rMTF) Rectangle aRect( aPoint, aSize ); // 512 Bytes "trash" at the beginning: - for (i=0;i<128;i++) *pPict << (sal_uInt32)0; + for (i=0;i<128;i++) pPict->WriteUInt32( (sal_uInt32)0 ); // Lo-16-Bits of the file size without the 512 bytes trash: - *pPict << (sal_uInt16)0; // gets corrected later on by UpdateHeader() + pPict->WriteUInt16( (sal_uInt16)0 ); // gets corrected later on by UpdateHeader() // The Bounding-Rectangle (y1,x1,y2,x2 !): WriteRectangle( aRect ); // Version 2: - *pPict << (sal_uInt32)0x001102ff; + pPict->WriteUInt32( (sal_uInt32)0x001102ff ); // Extended-Version-2-Header: - *pPict << (sal_uInt16)0x0c00 // Opcode - << (sal_uInt16)0xfffe // Version (?) - << (sal_uInt16)0x0000 // Reserved - << (sal_uInt32) 0x00480000 // hRes - << (sal_uInt32) 0x00480000; + pPict->WriteUInt16( (sal_uInt16)0x0c00 ) // Opcode + .WriteUInt16( (sal_uInt16)0xfffe ) // Version (?) + .WriteUInt16( (sal_uInt16)0x0000 ) // Reserved + .WriteUInt32( (sal_uInt32) 0x00480000 ) // hRes + .WriteUInt32( (sal_uInt32) 0x00480000 ); WriteRectangle( aRect ); - *pPict << (sal_uInt32)0x00000000; // Reserved + pPict->WriteUInt32( (sal_uInt32)0x00000000 ); // Reserved // many import filters demand the declaration // of a clipping area at the beginning @@ -2184,7 +2184,7 @@ void PictWriter::UpdateHeader() // correct the Lo-16-Bits of the file size without the 512 bytes trash: nPos=pPict->Tell(); pPict->Seek(512); - *pPict << (sal_uInt16)((nPos-512)&0x0000ffff); + pPict->WriteUInt16( (sal_uInt16)((nPos-512)&0x0000ffff) ); pPict->Seek(nPos); } diff --git a/filter/source/graphicfilter/eppm/eppm.cxx b/filter/source/graphicfilter/eppm/eppm.cxx index fcb40f128829..0af3cb8dabe4 100644 --- a/filter/source/graphicfilter/eppm/eppm.cxx +++ b/filter/source/graphicfilter/eppm/eppm.cxx @@ -120,16 +120,16 @@ sal_Bool PPMWriter::ImplWriteHeader() if ( mnWidth && mnHeight ) { if ( mnMode == 0 ) - m_rOStm << "P6\x0a"; + m_rOStm.WriteCharPtr( "P6\x0a" ); else - m_rOStm << "P3\x0a"; + m_rOStm.WriteCharPtr( "P3\x0a" ); ImplWriteNumber( mnWidth ); - m_rOStm << (sal_uInt8)32; + m_rOStm.WriteUChar( (sal_uInt8)32 ); ImplWriteNumber( mnHeight ); - m_rOStm << (sal_uInt8)32; + m_rOStm.WriteUChar( (sal_uInt8)32 ); ImplWriteNumber( 255 ); // max. col. - m_rOStm << (sal_uInt8)10; + m_rOStm.WriteUChar( (sal_uInt8)10 ); } else mbStatus = sal_False; @@ -148,9 +148,9 @@ void PPMWriter::ImplWriteBody() for ( sal_uLong x = 0; x < mnWidth; x++ ) { const BitmapColor& rColor = mpAcc->GetPixel( y, x ); - m_rOStm << rColor.GetRed(); - m_rOStm << rColor.GetGreen(); - m_rOStm << rColor.GetBlue(); + m_rOStm.WriteUChar( rColor.GetRed() ); + m_rOStm.WriteUChar( rColor.GetGreen() ); + m_rOStm.WriteUChar( rColor.GetBlue() ); } } } @@ -165,7 +165,7 @@ void PPMWriter::ImplWriteBody() if ( nCount < 0 ) { nCount = 69; - m_rOStm << (sal_uInt8)10; + m_rOStm.WriteUChar( (sal_uInt8)10 ); } nDat[0] = mpAcc->GetPixel( y, x ).GetRed(); nDat[1] = mpAcc->GetPixel( y, x ).GetGreen(); @@ -175,12 +175,12 @@ void PPMWriter::ImplWriteBody() nNumb = nDat[ i ] / 100; if ( nNumb ) { - m_rOStm << (sal_uInt8)( nNumb + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nNumb + '0' ) ); nDat[ i ] -= ( nNumb * 100 ); nNumb = nDat[ i ] / 10; - m_rOStm << (sal_uInt8)( nNumb + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nNumb + '0' ) ); nDat[ i ] -= ( nNumb * 10 ); - m_rOStm << (sal_uInt8)( nDat[ i ] + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nDat[ i ] + '0' ) ); nCount -= 4; } else @@ -188,21 +188,21 @@ void PPMWriter::ImplWriteBody() nNumb = nDat[ i ] / 10; if ( nNumb ) { - m_rOStm << (sal_uInt8)( nNumb + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nNumb + '0' ) ); nDat[ i ] -= ( nNumb * 10 ); - m_rOStm << (sal_uInt8)( nDat[ i ] + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nDat[ i ] + '0' ) ); nCount -= 3; } else { - m_rOStm << (sal_uInt8)( nDat[ i ] + '0' ); + m_rOStm.WriteUChar( (sal_uInt8)( nDat[ i ] + '0' ) ); nCount -= 2; } } - m_rOStm << (sal_uInt8)' '; + m_rOStm.WriteUChar( (sal_uInt8)' ' ); } } - m_rOStm << (sal_uInt8)10; + m_rOStm.WriteUChar( (sal_uInt8)10 ); } } } @@ -213,7 +213,7 @@ void PPMWriter::ImplWriteBody() void PPMWriter::ImplWriteNumber(sal_Int32 nNumber) { const OString aNum(OString::number(nNumber)); - m_rOStm << aNum.getStr(); + m_rOStm.WriteCharPtr( aNum.getStr() ); } // ------------------------------------------------------------------------ diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index effeb74087cb..07864762af68 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -328,10 +328,10 @@ sal_Bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Fi if ( mnPreview & EPS_PREVIEW_TIFF ) { - rTargetStream << (sal_uInt32)0xC6D3D0C5; + rTargetStream.WriteUInt32( (sal_uInt32)0xC6D3D0C5 ); nStreamPosition = rTargetStream.Tell(); - rTargetStream << (sal_uInt32)0 << (sal_uInt32)0 << (sal_uInt32)0 << (sal_uInt32)0 - << nStreamPosition + 26 << (sal_uInt32)0 << (sal_uInt16)0xffff; + rTargetStream.WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)0 ) + .WriteUInt32( nStreamPosition + 26 ).WriteUInt32( (sal_uInt32)0 ).WriteUInt16( (sal_uInt16)0xffff ); sal_uInt32 nErrCode; if ( mbGrayScale ) @@ -348,7 +348,7 @@ sal_Bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Fi rTargetStream.Seek( STREAM_SEEK_TO_END ); nPSPosition = rTargetStream.Tell(); rTargetStream.Seek( nStreamPosition + 20 ); - rTargetStream << nPSPosition - 30; // size of tiff gfx + rTargetStream.WriteUInt32( nPSPosition - 30 ); // size of tiff gfx rTargetStream.Seek( nPSPosition ); } else @@ -412,8 +412,8 @@ sal_Bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Fi { sal_uInt32 nPosition = rTargetStream.Tell(); rTargetStream.Seek( nStreamPosition ); - rTargetStream << nPSPosition; - rTargetStream << nPosition - nPSPosition; + rTargetStream.WriteUInt32( nPSPosition ); + rTargetStream.WriteUInt32( nPosition - nPSPosition ); rTargetStream.Seek( nPosition ); } while( pChrSetList ) @@ -455,7 +455,7 @@ sal_Bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Fi void PSWriter::ImplWriteProlog( const Graphic* pPreview ) { ImplWriteLine( "%!PS-Adobe-3.0 EPSF-3.0 " ); - *mpPS << "%%BoundingBox: "; // BoundingBox + mpPS->WriteCharPtr( "%%BoundingBox: " ); // BoundingBox ImplWriteLong( 0 ); ImplWriteLong( 0 ); Size aSizePoint = Application::GetDefaultDevice()->LogicToLogic( pMTF->GetPrefSize(), @@ -471,7 +471,7 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview ) // defaults - *mpPS << "%%LanguageLevel: "; // Language level + mpPS->WriteCharPtr( "%%LanguageLevel: " ); // Language level ImplWriteLong( mnLevel, PS_RET ); if ( !mbGrayScale && mnLevel == 1 ) ImplWriteLine( "%%Extensions: CMYK" ); // CMYK extension is to set in color mode in level 1 @@ -485,10 +485,10 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview ) BitmapReadAccess* pAcc = aTmpBitmap.AcquireReadAccess(); if ( pAcc ) { - *mpPS << "%%BeginPreview: "; // BoundingBox + mpPS->WriteCharPtr( "%%BeginPreview: " ); // BoundingBox ImplWriteLong( aSizeBitmap.Width() ); ImplWriteLong( aSizeBitmap.Height() ); - *mpPS << "1 "; + mpPS->WriteCharPtr( "1 " ); sal_Int32 nLines = aSizeBitmap.Width() / 312; if ( ( nLines * 312 ) != aSizeBitmap.Width() ) nLines++; @@ -506,7 +506,7 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview ) if ( !nCount2 ) { ImplExecMode( PS_RET ); - *mpPS << "%"; + mpPS->WriteCharPtr( "%" ); nCount2 = 312; } nVal <<= 1; @@ -518,7 +518,7 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview ) nVal += 'A' - 10; else nVal += '0'; - *mpPS << nVal; + mpPS->WriteChar( nVal ); nVal = 0; nCount += 4; } @@ -1306,12 +1306,12 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) ImplAddPath( aPolyPoly.GetObject( i ) ); if ( ++i < nPolyCount ) { - *mpPS << "p"; + mpPS->WriteCharPtr( "p" ); mnCursorPos += 2; ImplExecMode( PS_RET ); } } - *mpPS << "p ef"; + mpPS->WriteCharPtr( "p ef" ); mnCursorPos += 4; ImplExecMode( PS_RET ); } @@ -1445,7 +1445,7 @@ void PSWriter::ImplCurveTo( const Point& rP1, const Point& rP2, const Point& rP3 ImplWritePoint( rP1 ); ImplWritePoint( rP2 ); ImplWritePoint( rP3 ); - *mpPS << "ct "; + mpPS->WriteCharPtr( "ct " ); ImplExecMode( nMode ); } @@ -1483,14 +1483,14 @@ void PSWriter::ImplRect( const Rectangle & rRect ) ImplWriteLineColor( PS_SPACE ); ImplMoveTo( rRect.TopLeft() ); ImplWriteDouble( nWidth ); - *mpPS << "0 rl 0 "; + mpPS->WriteCharPtr( "0 rl 0 " ); ImplWriteDouble( nHeight ); - *mpPS << "rl "; + mpPS->WriteCharPtr( "rl " ); ImplWriteDouble( nWidth ); - *mpPS << "neg 0 rl "; + mpPS->WriteCharPtr( "neg 0 rl " ); ImplClosePathDraw(); } - *mpPS << (sal_uInt8)10; + mpPS->WriteUChar( (sal_uInt8)10 ); mnCursorPos = 0; } @@ -1504,12 +1504,12 @@ void PSWriter::ImplRectFill( const Rectangle & rRect ) ImplWriteFillColor( PS_SPACE ); ImplMoveTo( rRect.TopLeft() ); ImplWriteDouble( nWidth ); - *mpPS << "0 rl 0 "; + mpPS->WriteCharPtr( "0 rl 0 " ); ImplWriteDouble( nHeight ); - *mpPS << "rl "; + mpPS->WriteCharPtr( "rl " ); ImplWriteDouble( nWidth ); - *mpPS << "neg 0 rl ef "; - *mpPS << "p ef"; + mpPS->WriteCharPtr( "neg 0 rl ef " ); + mpPS->WriteCharPtr( "p ef" ); mnCursorPos += 2; ImplExecMode( PS_RET ); } @@ -1549,7 +1549,7 @@ void PSWriter::ImplIntersect( const PolyPolygon& rPolyPoly ) ImplAddPath( rPolyPoly.GetObject( i ) ); if ( ++i < nPolyCount ) { - *mpPS << "p"; + mpPS->WriteCharPtr( "p" ); mnCursorPos += 2; ImplExecMode( PS_RET ); } @@ -1586,12 +1586,12 @@ void PSWriter::ImplPolyPoly( const PolyPolygon & rPolyPoly, sal_Bool bTextOutlin ImplAddPath( rPolyPoly.GetObject( i ) ); if ( ++i < nPolyCount ) { - *mpPS << "p"; + mpPS->WriteCharPtr( "p" ); mnCursorPos += 2; ImplExecMode( PS_RET ); } } - *mpPS << "p ef"; + mpPS->WriteCharPtr( "p ef" ); mnCursorPos += 4; ImplExecMode( PS_RET ); } @@ -1834,14 +1834,14 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi { ImplWriteLong( nWidth ); ImplWriteLong( nHeight ); - *mpPS << "8 ["; + mpPS->WriteCharPtr( "8 [" ); ImplWriteLong( nWidth ); - *mpPS << "0 0 "; + mpPS->WriteCharPtr( "0 0 " ); ImplWriteLong( -nHeight ); ImplWriteLong( 0 ); ImplWriteLong( nHeight ); ImplWriteLine( "]" ); - *mpPS << "{currentfile "; + mpPS->WriteCharPtr( "{currentfile " ); ImplWriteLong( nWidth ); ImplWriteLine( "string readhexstring pop}" ); ImplWriteLine( "image" ); @@ -1852,7 +1852,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi ImplWriteHexByte( pAcc->GetPixelIndex( y, x ) ); } } - *mpPS << (sal_uInt8)10; + mpPS->WriteUChar( (sal_uInt8)10 ); } else // Level 2 { @@ -1861,15 +1861,15 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi ImplWriteLine( "/DeviceGray setcolorspace" ); ImplWriteLine( "<<" ); ImplWriteLine( "/ImageType 1" ); - *mpPS << "/Width "; + mpPS->WriteCharPtr( "/Width " ); ImplWriteLong( nWidth, PS_RET ); - *mpPS << "/Height "; + mpPS->WriteCharPtr( "/Height " ); ImplWriteLong( nHeight, PS_RET ); ImplWriteLine( "/BitsPerComponent 8" ); ImplWriteLine( "/Decode[0 1]" ); - *mpPS << "/ImageMatrix["; + mpPS->WriteCharPtr( "/ImageMatrix[" ); ImplWriteLong( nWidth ); - *mpPS << "0 0 "; + mpPS->WriteCharPtr( "0 0 " ); ImplWriteLong( -nHeight ); ImplWriteLong( 0 ); ImplWriteLong( nHeight, PS_NONE ); @@ -1924,15 +1924,15 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi ImplWriteLine( "] setcolorspace" ); ImplWriteLine( "<<" ); ImplWriteLine( "/ImageType 1" ); - *mpPS << "/Width "; + mpPS->WriteCharPtr( "/Width " ); ImplWriteLong( nWidth, PS_RET ); - *mpPS << "/Height "; + mpPS->WriteCharPtr( "/Height " ); ImplWriteLong( nHeight, PS_RET ); ImplWriteLine( "/BitsPerComponent 8" ); ImplWriteLine( "/Decode[0 255]" ); - *mpPS << "/ImageMatrix["; + mpPS->WriteCharPtr( "/ImageMatrix[" ); ImplWriteLong( nWidth ); - *mpPS << "0 0 "; + mpPS->WriteCharPtr( "0 0 " ); ImplWriteLong( -nHeight ); ImplWriteLong( 0); ImplWriteLong( nHeight, PS_NONE ); @@ -1971,15 +1971,15 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi ImplWriteLine( "/DeviceRGB setcolorspace" ); ImplWriteLine( "<<" ); ImplWriteLine( "/ImageType 1" ); - *mpPS << "/Width "; + mpPS->WriteCharPtr( "/Width " ); ImplWriteLong( nWidth, PS_RET ); - *mpPS << "/Height "; + mpPS->WriteCharPtr( "/Height " ); ImplWriteLong( nHeight, PS_RET ); ImplWriteLine( "/BitsPerComponent 8" ); ImplWriteLine( "/Decode[0 1 0 1 0 1]" ); - *mpPS << "/ImageMatrix["; + mpPS->WriteCharPtr( "/ImageMatrix[" ); ImplWriteLong( nWidth ); - *mpPS << "0 0 "; + mpPS->WriteCharPtr( "0 0 " ); ImplWriteLong( -nHeight ); ImplWriteLong( 0 ); ImplWriteLong( nHeight, PS_NONE ); @@ -2122,7 +2122,7 @@ void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const sa if ( nRotation ) { ImplWriteF( nRotation, 1 ); - *mpPS << "r "; + mpPS->WriteCharPtr( "r " ); } std::vector<PolyPolygon>::iterator aIter( aPolyPolyVec.begin() ); while ( aIter != aPolyPolyVec.end() ) @@ -2169,7 +2169,7 @@ void PSWriter::ImplSetAttrForText( const Point& rPoint ) maLastFont = maFont; aSize = maFont.GetSize(); ImplWriteDouble( aSize.Height() ); - *mpPS << "sf "; + mpPS->WriteCharPtr( "sf " ); } if ( eTextAlign != ALIGN_BASELINE ) { // PostScript kennt kein FontAlignment @@ -2181,9 +2181,9 @@ void PSWriter::ImplSetAttrForText( const Point& rPoint ) ImplMoveTo( aPoint ); if ( nRotation ) { - *mpPS << "gs "; + mpPS->WriteCharPtr( "gs " ); ImplWriteF( nRotation, 1 ); - *mpPS << "r "; + mpPS->WriteCharPtr( "r " ); } } @@ -2191,21 +2191,21 @@ void PSWriter::ImplSetAttrForText( const Point& rPoint ) void PSWriter::ImplDefineFont( const char* pOriginalName, const char* pItalic ) { - *mpPS << (sal_uInt8)'/'; //convert the font pOriginalName using ISOLatin1Encoding - *mpPS << pOriginalName; + mpPS->WriteUChar( (sal_uInt8)'/' ); //convert the font pOriginalName using ISOLatin1Encoding + mpPS->WriteCharPtr( pOriginalName ); switch ( maFont.GetWeight() ) { case WEIGHT_SEMIBOLD : case WEIGHT_BOLD : case WEIGHT_ULTRABOLD : case WEIGHT_BLACK : - *mpPS << "-Bold"; + mpPS->WriteCharPtr( "-Bold" ); if ( maFont.GetItalic() != ITALIC_NONE ) - *mpPS << pItalic; + mpPS->WriteCharPtr( pItalic ); break; default: if ( maFont.GetItalic() != ITALIC_NONE ) - *mpPS << pItalic; + mpPS->WriteCharPtr( pItalic ); break; } ImplWriteLine( " f" ); @@ -2217,14 +2217,14 @@ void PSWriter::ImplDefineFont( const char* pOriginalName, const char* pItalic ) void PSWriter::ImplClosePathDraw( sal_uLong nMode ) { - *mpPS << "pc"; + mpPS->WriteCharPtr( "pc" ); mnCursorPos += 2; ImplExecMode( nMode ); } void PSWriter::ImplPathDraw() { - *mpPS << "ps"; + mpPS->WriteCharPtr( "ps" ); mnCursorPos += 2; ImplExecMode( PS_RET ); } @@ -2281,7 +2281,7 @@ void PSWriter::ImplWriteColor( sal_uLong nMode ) ImplWriteB1 ( (sal_uInt8)aColor.GetGreen() ); ImplWriteB1 ( (sal_uInt8)aColor.GetBlue() ); } - *mpPS << "c"; // ( c is defined as setrgbcolor or setgray ) + mpPS->WriteCharPtr( "c" ); // ( c is defined as setrgbcolor or setgray ) ImplExecMode( nMode ); } @@ -2354,18 +2354,18 @@ inline void PSWriter::ImplExecMode( sal_uLong nMode ) if ( mnCursorPos >= PS_LINESIZE ) { mnCursorPos = 0; - *mpPS << (sal_uInt8)0xa; + mpPS->WriteUChar( (sal_uInt8)0xa ); return; } } if ( nMode & PS_SPACE ) { - *mpPS << (sal_uInt8)32; + mpPS->WriteUChar( (sal_uInt8)32 ); mnCursorPos++; } if ( nMode & PS_RET ) { - *mpPS << (sal_uInt8)0xa; + mpPS->WriteUChar( (sal_uInt8)0xa ); mnCursorPos = 0; } } @@ -2377,7 +2377,7 @@ inline void PSWriter::ImplWriteLine( const char* pString, sal_uLong nMode ) sal_uLong i = 0; while ( pString[ i ] ) { - *mpPS << (sal_uInt8)pString[ i++ ]; + mpPS->WriteUChar( (sal_uInt8)pString[ i++ ] ); } mnCursorPos += i; ImplExecMode( nMode ); @@ -2484,7 +2484,7 @@ void PSWriter::ImplWriteLong(sal_Int32 nNumber, sal_uLong nMode) { const OString aNumber(OString::number(nNumber)); mnCursorPos += aNumber.getLength(); - *mpPS << aNumber.getStr(); + mpPS->WriteCharPtr( aNumber.getStr() ); ImplExecMode(nMode); } @@ -2496,16 +2496,16 @@ void PSWriter::ImplWriteDouble( double fNumber, sal_uLong nMode ) sal_Int32 nATemp = labs( (sal_Int32)( ( fNumber - nPTemp ) * 100000 ) ); if ( !nPTemp && nATemp && ( fNumber < 0.0 ) ) - *mpPS << (sal_Char)'-'; + mpPS->WriteChar( (sal_Char)'-' ); const OString aNumber1(OString::number(nPTemp)); - *mpPS << aNumber1.getStr(); + mpPS->WriteCharPtr( aNumber1.getStr() ); mnCursorPos += aNumber1.getLength(); if ( nATemp ) { int zCount = 0; - *mpPS << (sal_uInt8)'.'; + mpPS->WriteUChar( (sal_uInt8)'.' ); mnCursorPos++; const OString aNumber2(OString::number(nATemp)); @@ -2515,13 +2515,13 @@ void PSWriter::ImplWriteDouble( double fNumber, sal_uLong nMode ) mnCursorPos += 6 - nLen; for ( n = 0; n < ( 5 - nLen ); n++ ) { - *mpPS << (sal_uInt8)'0'; + mpPS->WriteUChar( (sal_uInt8)'0' ); } } mnCursorPos += nLen; for ( n = 0; n < nLen; n++ ) { - *mpPS << aNumber2[n]; + mpPS->WriteChar( aNumber2[n] ); zCount--; if ( aNumber2[n] != '0' ) zCount = 0; @@ -2540,7 +2540,7 @@ void PSWriter::ImplWriteF( sal_Int32 nNumber, sal_uLong nCount, sal_uLong nMode { if ( nNumber < 0 ) { - *mpPS << (sal_uInt8)'-'; + mpPS->WriteUChar( (sal_uInt8)'-' ); nNumber = -nNumber; mnCursorPos++; } @@ -2549,15 +2549,15 @@ void PSWriter::ImplWriteF( sal_Int32 nNumber, sal_uLong nCount, sal_uLong nMode long nStSize = ( nCount + 1 ) - nLen; if ( nStSize >= 1 ) { - *mpPS << (sal_uInt8)'0'; + mpPS->WriteUChar( (sal_uInt8)'0' ); mnCursorPos++; } if ( nStSize >= 2 ) { - *mpPS << (sal_uInt8)'.'; + mpPS->WriteUChar( (sal_uInt8)'.' ); for ( long i = 1; i < nStSize; i++ ) { - *mpPS << (sal_uInt8)'0'; + mpPS->WriteUChar( (sal_uInt8)'0' ); mnCursorPos++; } } @@ -2566,10 +2566,10 @@ void PSWriter::ImplWriteF( sal_Int32 nNumber, sal_uLong nCount, sal_uLong nMode { if ( n == nLen - nCount ) { - *mpPS << (sal_uInt8)'.'; + mpPS->WriteUChar( (sal_uInt8)'.' ); mnCursorPos++; } - *mpPS << aScaleFactor[n]; + mpPS->WriteChar( aScaleFactor[n] ); } ImplExecMode( nMode ); } @@ -2578,7 +2578,7 @@ void PSWriter::ImplWriteF( sal_Int32 nNumber, sal_uLong nCount, sal_uLong nMode void PSWriter::ImplWriteByte( sal_uInt8 nNumb, sal_uLong nMode ) { - *mpPS << ( nNumb ); + mpPS->WriteUChar( ( nNumb ) ); mnCursorPos++; ImplExecMode( nMode ); } @@ -2588,14 +2588,14 @@ void PSWriter::ImplWriteByte( sal_uInt8 nNumb, sal_uLong nMode ) void PSWriter::ImplWriteHexByte( sal_uInt8 nNumb, sal_uLong nMode ) { if ( ( nNumb >> 4 ) > 9 ) - *mpPS << (sal_uInt8)( ( nNumb >> 4 ) + 'A' - 10 ); + mpPS->WriteUChar( (sal_uInt8)( ( nNumb >> 4 ) + 'A' - 10 ) ); else - *mpPS << (sal_uInt8)( ( nNumb >> 4 ) + '0' ); + mpPS->WriteUChar( (sal_uInt8)( ( nNumb >> 4 ) + '0' ) ); if ( ( nNumb & 0xf ) > 9 ) - *mpPS << (sal_uInt8)( ( nNumb & 0xf ) + 'A' - 10 ); + mpPS->WriteUChar( (sal_uInt8)( ( nNumb & 0xf ) + 'A' - 10 ) ); else - *mpPS << (sal_uInt8)( ( nNumb & 0xf ) + '0' ); + mpPS->WriteUChar( (sal_uInt8)( ( nNumb & 0xf ) + '0' ) ); mnCursorPos += 2; ImplExecMode( nMode ); } diff --git a/filter/source/graphicfilter/eras/eras.cxx b/filter/source/graphicfilter/eras/eras.cxx index d40ee67b5a3f..46cc4fbcecaf 100644 --- a/filter/source/graphicfilter/eras/eras.cxx +++ b/filter/source/graphicfilter/eras/eras.cxx @@ -146,17 +146,17 @@ sal_Bool RASWriter::ImplWriteHeader() } if ( mbStatus && mnWidth && mnHeight && mnDepth ) { - m_rOStm << (sal_uInt32)0x59a66a95 << (sal_uInt32)mnWidth << (sal_uInt32)mnHeight - << (sal_uInt32)mnDepth - << (sal_uInt32)(( ( ( ( mnWidth * mnDepth ) + 15 ) >> 4 ) << 1 ) * mnHeight) - << (sal_uInt32)2; + m_rOStm.WriteUInt32( (sal_uInt32)0x59a66a95 ).WriteUInt32( (sal_uInt32)mnWidth ).WriteUInt32( (sal_uInt32)mnHeight ) + .WriteUInt32( (sal_uInt32)mnDepth ) + .WriteUInt32( (sal_uInt32)(( ( ( ( mnWidth * mnDepth ) + 15 ) >> 4 ) << 1 ) * mnHeight) ) + .WriteUInt32( (sal_uInt32)2 ); if ( mnDepth > 8 ) - m_rOStm << (sal_uInt32)0 << (sal_uInt32)0; + m_rOStm.WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)0 ); else { - m_rOStm << (sal_uInt32)1 << (sal_uInt32)( mnColors * 3 ); + m_rOStm.WriteUInt32( (sal_uInt32)1 ).WriteUInt32( (sal_uInt32)( mnColors * 3 ) ); } } else mbStatus = sal_False; @@ -170,9 +170,9 @@ void RASWriter::ImplWritePalette() { sal_uInt16 i; - for ( i = 0; i < mnColors; m_rOStm << mpAcc->GetPaletteColor( i++ ).GetRed() ) ; - for ( i = 0; i < mnColors; m_rOStm << mpAcc->GetPaletteColor( i++ ).GetGreen() ) ; - for ( i = 0; i < mnColors; m_rOStm << mpAcc->GetPaletteColor( i++ ).GetBlue() ) ; + for ( i = 0; i < mnColors; m_rOStm.WriteUChar( mpAcc->GetPaletteColor( i++ ).GetRed() ) ) ; + for ( i = 0; i < mnColors; m_rOStm.WriteUChar( mpAcc->GetPaletteColor( i++ ).GetGreen() ) ) ; + for ( i = 0; i < mnColors; m_rOStm.WriteUChar( mpAcc->GetPaletteColor( i++ ).GetBlue() ) ) ; } // ------------------------------------------------------------------------ @@ -247,15 +247,15 @@ void RASWriter::ImplPutByte( sal_uInt8 nPutThis ) { if ( mnRepCount == 0 ) { - m_rOStm << (sal_uInt8)mnRepVal; + m_rOStm.WriteUChar( (sal_uInt8)mnRepVal ); if ( mnRepVal == 0x80 ) - m_rOStm << (sal_uInt8)0; + m_rOStm.WriteUChar( (sal_uInt8)0 ); } else { - m_rOStm << (sal_uInt8)0x80; - m_rOStm << (sal_uInt8)mnRepCount; - m_rOStm << (sal_uInt8)mnRepVal; + m_rOStm.WriteUChar( (sal_uInt8)0x80 ); + m_rOStm.WriteUChar( (sal_uInt8)mnRepCount ); + m_rOStm.WriteUChar( (sal_uInt8)mnRepVal ); } mnRepVal = nPutThis; mnRepCount = 0; diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx index 68af37d4b9ab..aff5ce3733f6 100644 --- a/filter/source/graphicfilter/etiff/etiff.cxx +++ b/filter/source/graphicfilter/etiff/etiff.cxx @@ -159,9 +159,9 @@ sal_Bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilt // we will use the BIG Endian Mode // TIFF header m_rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); - m_rOStm << (sal_uInt32)0x4d4d002a; // TIFF identifier + m_rOStm.WriteUInt32( (sal_uInt32)0x4d4d002a ); // TIFF identifier mnLatestIfdPos = m_rOStm.Tell(); - m_rOStm << (sal_uInt32)0; + m_rOStm.WriteUInt32( (sal_uInt32)0 ); Animation aAnimation; Bitmap aBmp; @@ -211,7 +211,7 @@ sal_Bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilt } sal_uInt32 nCurPos = m_rOStm.Tell(); m_rOStm.Seek( mnCurrentTagCountPos ); - m_rOStm << mnTagCount; + m_rOStm.WriteUInt16( mnTagCount ); m_rOStm.Seek( nCurPos ); aBmp.ReleaseAccess( mpAcc ); @@ -256,12 +256,12 @@ sal_Bool TIFFWriter::ImplWriteHeader( sal_Bool bMultiPage ) { sal_uInt32 nCurrentPos = m_rOStm.Tell(); m_rOStm.Seek( mnLatestIfdPos ); - m_rOStm << (sal_uInt32)( nCurrentPos - mnStreamOfs ); // offset to the IFD + m_rOStm.WriteUInt32( (sal_uInt32)( nCurrentPos - mnStreamOfs ) ); // offset to the IFD m_rOStm.Seek( nCurrentPos ); // (OFS8) TIFF image file directory (IFD) mnCurrentTagCountPos = m_rOStm.Tell(); - m_rOStm << (sal_uInt16)0; // the number of tagentrys is to insert later + m_rOStm.WriteUInt16( (sal_uInt16)0 ); // the number of tagentrys is to insert later sal_uInt32 nSubFileFlags = 0; if ( bMultiPage ) @@ -311,7 +311,7 @@ sal_Bool TIFFWriter::ImplWriteHeader( sal_Bool bMultiPage ) // and last we write zero to close the num dir entries list mnLatestIfdPos = m_rOStm.Tell(); - m_rOStm << (sal_uInt32)0; // there are no more IFD + m_rOStm.WriteUInt32( (sal_uInt32)0 ); // there are no more IFD } else mbStatus = sal_False; @@ -326,23 +326,23 @@ void TIFFWriter::ImplWritePalette() sal_uInt16 i; sal_uLong nCurrentPos = m_rOStm.Tell(); m_rOStm.Seek( mnPalPos + 8 ); // the palette tag entry needs the offset - m_rOStm << static_cast<sal_uInt32>(nCurrentPos - mnStreamOfs); // to the palette colors + m_rOStm.WriteUInt32( static_cast<sal_uInt32>(nCurrentPos - mnStreamOfs) ); // to the palette colors m_rOStm.Seek( nCurrentPos ); for ( i = 0; i < mnColors; i++ ) { const BitmapColor& rColor = mpAcc->GetPaletteColor( i ); - m_rOStm << (sal_uInt16)( rColor.GetRed() << 8 ); + m_rOStm.WriteUInt16( (sal_uInt16)( rColor.GetRed() << 8 ) ); } for ( i = 0; i < mnColors; i++ ) { const BitmapColor& rColor = mpAcc->GetPaletteColor( i ); - m_rOStm << (sal_uInt16)( rColor.GetGreen() << 8 ); + m_rOStm.WriteUInt16( (sal_uInt16)( rColor.GetGreen() << 8 ) ); } for ( i = 0; i < mnColors; i++ ) { const BitmapColor& rColor = mpAcc->GetPaletteColor( i ); - m_rOStm << (sal_uInt16)( rColor.GetBlue() << 8 ); + m_rOStm.WriteUInt16( (sal_uInt16)( rColor.GetBlue() << 8 ) ); } } @@ -356,7 +356,7 @@ sal_Bool TIFFWriter::ImplWriteBody() sal_uLong nGfxBegin = m_rOStm.Tell(); m_rOStm.Seek( mnBitmapPos + 8 ); // the strip offset tag entry needs the offset - m_rOStm << static_cast<sal_uInt32>(nGfxBegin - mnStreamOfs); // to the bitmap data + m_rOStm.WriteUInt32( static_cast<sal_uInt32>(nGfxBegin - mnStreamOfs) ); // to the bitmap data m_rOStm.Seek( nGfxBegin ); StartCompression(); @@ -448,7 +448,7 @@ sal_Bool TIFFWriter::ImplWriteBody() { sal_uLong nGfxEnd = m_rOStm.Tell(); m_rOStm.Seek( mnStripByteCountPos + 8 ); - m_rOStm << static_cast<sal_uInt32>( nGfxEnd - nGfxBegin ); // mnStripByteCountPos needs the size of the compression data + m_rOStm.WriteUInt32( static_cast<sal_uInt32>( nGfxEnd - nGfxBegin ) ); // mnStripByteCountPos needs the size of the compression data m_rOStm.Seek( nGfxEnd ); } return mbStatus; @@ -460,10 +460,10 @@ void TIFFWriter::ImplWriteResolution( sal_uLong nStreamPos, sal_uInt32 nResoluti { sal_uLong nCurrentPos = m_rOStm.Tell(); m_rOStm.Seek( nStreamPos + 8 ); - m_rOStm << (sal_uInt32)nCurrentPos - mnStreamOfs; + m_rOStm.WriteUInt32( (sal_uInt32)nCurrentPos - mnStreamOfs ); m_rOStm.Seek( nCurrentPos ); - m_rOStm << (sal_uInt32)1; - m_rOStm << nResolutionUnit; + m_rOStm.WriteUInt32( (sal_uInt32)1 ); + m_rOStm.WriteUInt32( nResolutionUnit ); } // ------------------------------------------------------------------------ @@ -472,12 +472,12 @@ void TIFFWriter::ImplWriteTag( sal_uInt16 nTagID, sal_uInt16 nDataType, sal_uInt { mnTagCount++; - m_rOStm << nTagID; - m_rOStm << nDataType; - m_rOStm << nNumberOfItems; + m_rOStm.WriteUInt16( nTagID ); + m_rOStm.WriteUInt16( nDataType ); + m_rOStm.WriteUInt32( nNumberOfItems ); if ( nDataType == 3 ) nValue <<=16; // in Big Endian Mode WORDS needed to be shifted to a DWORD - m_rOStm << nValue; + m_rOStm.WriteUInt32( nValue ); } // ------------------------------------------------------------------------ @@ -488,13 +488,13 @@ inline void TIFFWriter::WriteBits( sal_uInt16 nCode, sal_uInt16 nCodeLen ) nOffset -= nCodeLen; while ( nOffset < 24 ) { - m_rOStm << (sal_uInt8)( dwShift >> 24 ); + m_rOStm.WriteUChar( (sal_uInt8)( dwShift >> 24 ) ); dwShift <<= 8; nOffset += 8; } if ( nCode == 257 && nOffset != 32 ) { - m_rOStm << (sal_uInt8)( dwShift >> 24 ); + m_rOStm.WriteUChar( (sal_uInt8)( dwShift >> 24 ) ); } } diff --git a/filter/source/graphicfilter/expm/expm.cxx b/filter/source/graphicfilter/expm/expm.cxx index 25c8e5e90088..df650d1ef40f 100644 --- a/filter/source/graphicfilter/expm/expm.cxx +++ b/filter/source/graphicfilter/expm/expm.cxx @@ -124,7 +124,7 @@ sal_Bool XPMWriter::WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilter { ImplWritePalette(); ImplWriteBody(); - m_rOStm << "\x22XPMENDEXT\x22\x0a};"; + m_rOStm.WriteCharPtr( "\x22XPMENDEXT\x22\x0a};" ); } m_rOStm.SetNumberFormatInt(nOStmOldModus); @@ -149,15 +149,15 @@ sal_Bool XPMWriter::ImplWriteHeader() mnHeight = mpAcc->Height(); if ( mnWidth && mnHeight && mnColors ) { - m_rOStm << "/* XPM */\x0astatic char * image[] = \x0a{\x0a\x22"; + m_rOStm.WriteCharPtr( "/* XPM */\x0astatic char * image[] = \x0a{\x0a\x22" ); ImplWriteNumber( mnWidth ); - m_rOStm << (sal_uInt8)32; + m_rOStm.WriteUChar( (sal_uInt8)32 ); ImplWriteNumber( mnHeight ); - m_rOStm << (sal_uInt8)32; + m_rOStm.WriteUChar( (sal_uInt8)32 ); ImplWriteNumber( mnColors ); - m_rOStm << (sal_uInt8)32; + m_rOStm.WriteUChar( (sal_uInt8)32 ); ImplWriteNumber( ( mnColors > 26 ) ? 2 : 1 ); - m_rOStm << "\x22,\x0a"; + m_rOStm.WriteCharPtr( "\x22,\x0a" ); } else mbStatus = sal_False; return mbStatus; @@ -173,16 +173,16 @@ void XPMWriter::ImplWritePalette() nTransIndex = mpAcc->GetBestPaletteIndex( BMP_COL_TRANS ); for ( sal_uInt16 i = 0; i < mnColors; i++ ) { - m_rOStm << "\x22"; + m_rOStm.WriteCharPtr( "\x22" ); ImplWritePixel( i ); - m_rOStm << (sal_uInt8)32; + m_rOStm.WriteUChar( (sal_uInt8)32 ); if ( nTransIndex != i ) { ImplWriteColor( i ); - m_rOStm << "\x22,\x0a"; + m_rOStm.WriteCharPtr( "\x22,\x0a" ); } else - m_rOStm << "c none\x22,\x0a"; + m_rOStm.WriteCharPtr( "c none\x22,\x0a" ); } } @@ -193,12 +193,12 @@ void XPMWriter::ImplWriteBody() for ( sal_uLong y = 0; y < mnHeight; y++ ) { ImplCallback( (sal_uInt16)( ( 100 * y ) / mnHeight ) ); // processing output in percent - m_rOStm << (sal_uInt8)0x22; + m_rOStm.WriteUChar( (sal_uInt8)0x22 ); for ( sal_uLong x = 0; x < mnWidth; x++ ) { ImplWritePixel( mpAcc->GetPixelIndex( y, x ) ); } - m_rOStm << "\x22,\x0a"; + m_rOStm.WriteCharPtr( "\x22,\x0a" ); } } @@ -208,7 +208,7 @@ void XPMWriter::ImplWriteBody() void XPMWriter::ImplWriteNumber(sal_Int32 nNumber) { const OString aNum(OString::number(nNumber)); - m_rOStm << aNum.getStr(); + m_rOStm.WriteCharPtr( aNum.getStr() ); } // ------------------------------------------------------------------------ @@ -218,11 +218,11 @@ void XPMWriter::ImplWritePixel( sal_uLong nCol ) const if ( mnColors > 26 ) { sal_uInt8 nDiff = (sal_uInt8) ( nCol / 26 ); - m_rOStm << (sal_uInt8)( nDiff + 'A' ); - m_rOStm << (sal_uInt8)( nCol - ( nDiff*26 ) + 'A' ); + m_rOStm.WriteUChar( (sal_uInt8)( nDiff + 'A' ) ); + m_rOStm.WriteUChar( (sal_uInt8)( nCol - ( nDiff*26 ) + 'A' ) ); } else - m_rOStm << (sal_uInt8)( nCol + 'A' ); + m_rOStm.WriteUChar( (sal_uInt8)( nCol + 'A' ) ); } // ------------------------------------------------------------------------ @@ -232,7 +232,7 @@ void XPMWriter::ImplWriteColor( sal_uInt16 nNumber ) sal_uLong nTmp; sal_uInt8 j; - m_rOStm << "c #"; // # indicates a following hex value + m_rOStm.WriteCharPtr( "c #" ); // # indicates a following hex value const BitmapColor& rColor = mpAcc->GetPaletteColor( nNumber ); nTmp = ( rColor.GetRed() << 16 ) | ( rColor.GetGreen() << 8 ) | rColor.GetBlue(); for ( signed char i = 20; i >= 0 ; i-=4 ) @@ -241,7 +241,7 @@ void XPMWriter::ImplWriteColor( sal_uInt16 nNumber ) j += 'A' - 10; else j += '0'; - m_rOStm << j; + m_rOStm.WriteUChar( j ); } } diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 7da240f92059..70cdef846230 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -362,9 +362,9 @@ void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_uInt32 sal_uInt32 nWPos = nSizeWMF ? 28 : 0; sal_uInt32 nTPos = nSizeTIFF ? 28 + nSizeWMF : 0; - aReplacement << nMagic << nPPos << nPSSize - << nWPos << nSizeWMF - << nTPos << nSizeTIFF; + aReplacement.WriteUInt32( nMagic ).WriteUInt32( nPPos ).WriteUInt32( nPSSize ) + .WriteUInt32( nWPos ).WriteUInt32( nSizeWMF ) + .WriteUInt32( nTPos ).WriteUInt32( nSizeTIFF ); if ( nSizeWMF ) { sal_uInt8* pBuf = new sal_uInt8[ nSizeWMF ]; diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index fb74fc4addb3..43ffd67d9644 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -2169,14 +2169,14 @@ void OS2METReader::ReadImageData(sal_uInt16 nDataID, sal_uInt16 nDataLen) return; } // write (Windows-)BITMAPINFOHEADER: - *(p->pBMP) << ((sal_uInt32)40) << p->nWidth << p->nHeight; - *(p->pBMP) << ((sal_uInt16)1) << p->nBitsPerPixel; - *(p->pBMP) << ((sal_uInt32)0) << ((sal_uInt32)0) << ((sal_uInt32)0) << ((sal_uInt32)0); - *(p->pBMP) << ((sal_uInt32)0) << ((sal_uInt32)0); + (p->pBMP)->WriteUInt32( (sal_uInt32)40 ).WriteUInt32( p->nWidth ).WriteUInt32( p->nHeight ); + (p->pBMP)->WriteUInt16( (sal_uInt16)1 ).WriteUInt16( p->nBitsPerPixel ); + (p->pBMP)->WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)0 ); + (p->pBMP)->WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)0 ); // write color table: if (p->nBitsPerPixel<=8) { sal_uInt16 i, nColTabSize=1<<(p->nBitsPerPixel); - for (i=0; i<nColTabSize; i++) *(p->pBMP) << GetPalette0RGB(i); + for (i=0; i<nColTabSize; i++) (p->pBMP)->WriteUInt32( GetPalette0RGB(i) ); } } // OK, now the map data is beeing pushed. Unfortunatly OS2 and BMP diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 0bd10ac6b0ca..782dcfcecaaf 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -99,7 +99,7 @@ using namespace ::com::sun::star; EscherExContainer::EscherExContainer( SvStream& rSt, const sal_uInt16 nRecType, const sal_uInt16 nInstance ) : rStrm ( rSt ) { - rStrm << (sal_uInt32)( ( 0xf | ( nInstance << 4 ) ) | ( nRecType << 16 ) ) << (sal_uInt32)0; + rStrm.WriteUInt32( (sal_uInt32)( ( 0xf | ( nInstance << 4 ) ) | ( nRecType << 16 ) ) ).WriteUInt32( (sal_uInt32)0 ); nContPos = rStrm.Tell(); } EscherExContainer::~EscherExContainer() @@ -109,7 +109,7 @@ EscherExContainer::~EscherExContainer() if ( nSize ) { rStrm.Seek( nContPos - 4 ); - rStrm << nSize; + rStrm.WriteUInt32( nSize ); rStrm.Seek( nPos ); } } @@ -117,7 +117,7 @@ EscherExContainer::~EscherExContainer() EscherExAtom::EscherExAtom( SvStream& rSt, const sal_uInt16 nRecType, const sal_uInt16 nInstance, const sal_uInt8 nVersion ) : rStrm ( rSt ) { - rStrm << (sal_uInt32)( ( nVersion | ( nInstance << 4 ) ) | ( nRecType << 16 ) ) << (sal_uInt32)0; + rStrm.WriteUInt32( (sal_uInt32)( ( nVersion | ( nInstance << 4 ) ) | ( nRecType << 16 ) ) ).WriteUInt32( (sal_uInt32)0 ); nContPos = rStrm.Tell(); } EscherExAtom::~EscherExAtom() @@ -127,7 +127,7 @@ EscherExAtom::~EscherExAtom() if ( nSize ) { rStrm.Seek( nContPos - 4 ); - rStrm << nSize; + rStrm.WriteUInt32( nSize ); rStrm.Seek( nPos ); } } @@ -300,7 +300,7 @@ extern "C" int SAL_CALL EscherPropSortFunc( const void* p1, const void* p2 ) void EscherPropertyContainer::Commit( SvStream& rSt, sal_uInt16 nVersion, sal_uInt16 nRecType ) { - rSt << (sal_uInt16)( ( nCountCount << 4 ) | ( nVersion & 0xf ) ) << nRecType << nCountSize; + rSt.WriteUInt16( (sal_uInt16)( ( nCountCount << 4 ) | ( nVersion & 0xf ) ) ).WriteUInt16( nRecType ).WriteUInt32( nCountSize ); if ( nSortCount ) { qsort( pSortStruct, nSortCount, sizeof( EscherPropSortStruct ), EscherPropSortFunc ); @@ -311,8 +311,8 @@ void EscherPropertyContainer::Commit( SvStream& rSt, sal_uInt16 nVersion, sal_uI sal_uInt32 nPropValue = pSortStruct[ i ].nPropValue; sal_uInt16 nPropId = pSortStruct[ i ].nPropId; - rSt << nPropId - << nPropValue; + rSt.WriteUInt16( nPropId ) + .WriteUInt32( nPropValue ); } if ( bHasComplexData ) { @@ -3005,18 +3005,18 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT sal_uInt16 nElementSize = 8; sal_uInt32 nStreamSize = nElementSize * nElements + 6; SvMemoryStream aOut( nStreamSize ); - aOut << nElements - << nElements - << nElementSize; + aOut.WriteUInt16( nElements ) + .WriteUInt16( nElements ) + .WriteUInt16( nElementSize ); std::vector< EnhancedCustomShapeEquation >::const_iterator aIter( aEquations.begin() ); std::vector< EnhancedCustomShapeEquation >::const_iterator aEnd ( aEquations.end() ); while( aIter != aEnd ) { - aOut << (sal_uInt16)aIter->nOperation - << (sal_Int16)aIter->nPara[ 0 ] - << (sal_Int16)aIter->nPara[ 1 ] - << (sal_Int16)aIter->nPara[ 2 ]; + aOut.WriteUInt16( (sal_uInt16)aIter->nOperation ) + .WriteInt16( (sal_Int16)aIter->nPara[ 0 ] ) + .WriteInt16( (sal_Int16)aIter->nPara[ 1 ] ) + .WriteInt16( (sal_Int16)aIter->nPara[ 2 ] ); ++aIter; } sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ]; @@ -3113,15 +3113,15 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT sal_uInt16 j, nElementSize = 8; sal_uInt32 nStreamSize = nElementSize * nElements + 6; SvMemoryStream aOut( nStreamSize ); - aOut << nElements - << nElements - << nElementSize; + aOut.WriteUInt16( nElements ) + .WriteUInt16( nElements ) + .WriteUInt16( nElementSize ); for( j = 0; j < nElements; j++ ) { sal_Int32 X = GetValueForEnhancedCustomShapeParameter( aGluePoints[ j ].First, aEquationOrder ); sal_Int32 Y = GetValueForEnhancedCustomShapeParameter( aGluePoints[ j ].Second, aEquationOrder ); - aOut << X - << Y; + aOut.WriteInt32( X ) + .WriteInt32( Y ); } sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ]; memcpy( pBuf, aOut.GetData(), nStreamSize ); @@ -3155,9 +3155,9 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT sal_uInt16 nElementSize = 2; sal_uInt32 nStreamSize = nElementSize * nElements + 6; SvMemoryStream aOut( nStreamSize ); - aOut << nElements - << nElements - << nElementSize; + aOut.WriteUInt16( nElements ) + .WriteUInt16( nElements ) + .WriteUInt16( nElementSize ); for ( j = 0; j < nElements; j++ ) { sal_uInt16 nVal = (sal_uInt16)aSegments[ j ].Count; @@ -3242,7 +3242,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT } break; } - aOut << nVal; + aOut.WriteUInt16( nVal ); } sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ]; memcpy( pBuf, aOut.GetData(), nStreamSize ); @@ -3287,9 +3287,9 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT sal_uInt16 nElementSize = 16; sal_uInt32 nStreamSize = nElementSize * nElements + 6; SvMemoryStream aOut( nStreamSize ); - aOut << nElements - << nElements - << nElementSize; + aOut.WriteUInt16( nElements ) + .WriteUInt16( nElements ) + .WriteUInt16( nElementSize ); for ( j = 0; j < nElements; j++ ) { sal_Int32 nLeft = GetValueForEnhancedCustomShapeParameter( aPathTextFrames[ j ].TopLeft.First, aEquationOrder ); @@ -3297,10 +3297,10 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT sal_Int32 nRight = GetValueForEnhancedCustomShapeParameter( aPathTextFrames[ j ].BottomRight.First, aEquationOrder ); sal_Int32 nBottom = GetValueForEnhancedCustomShapeParameter( aPathTextFrames[ j ].BottomRight.Second, aEquationOrder ); - aOut << nLeft - << nTop - << nRight - << nBottom; + aOut.WriteInt32( nLeft ) + .WriteInt32( nTop ) + .WriteInt32( nRight ) + .WriteInt32( nBottom ); } sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ]; memcpy( pBuf, aOut.GetData(), nStreamSize ); @@ -3530,9 +3530,9 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT sal_uInt16 k, j, nElementSize = 36; sal_uInt32 nStreamSize = nElementSize * nElements + 6; SvMemoryStream aOut( nStreamSize ); - aOut << nElements - << nElements - << nElementSize; + aOut.WriteUInt16( nElements ) + .WriteUInt16( nElements ) + .WriteUInt16( nElementSize ); for ( k = 0; k < nElements; k++ ) { @@ -3678,15 +3678,15 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT } } } - aOut << nFlags - << nXPosition - << nYPosition - << nXMap - << nYMap - << nXRangeMin - << nXRangeMax - << nYRangeMin - << nYRangeMax; + aOut.WriteUInt32( nFlags ) + .WriteInt32( nXPosition ) + .WriteInt32( nYPosition ) + .WriteInt32( nXMap ) + .WriteInt32( nYMap ) + .WriteInt32( nXRangeMin ) + .WriteInt32( nXRangeMax ) + .WriteInt32( nYRangeMin ) + .WriteInt32( nYRangeMax ); if ( nFlags & 8 ) nAdjustmentsWhichNeedsToBeConverted |= ( 1 << ( nYPosition - 0x100 ) ); @@ -3737,15 +3737,15 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT sal_uInt16 nElementSize = 8; sal_uInt32 nStreamSize = nElementSize * nElements + 6; SvMemoryStream aOut( nStreamSize ); - aOut << nElements - << nElements - << nElementSize; + aOut.WriteUInt16( nElements ) + .WriteUInt16( nElements ) + .WriteUInt16( nElementSize ); for( j = 0; j < nElements; j++ ) { sal_Int32 X = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].First, aEquationOrder, sal_True ); sal_Int32 Y = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].Second, aEquationOrder, sal_True ); - aOut << X - << Y; + aOut.WriteInt32( X ) + .WriteInt32( Y ); } sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ]; memcpy( pBuf, aOut.GetData(), nStreamSize ); @@ -4023,21 +4023,21 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject || pGraphicAttr->IsAdjusted() ) { SvMemoryStream aSt( sizeof( GraphicAttr ) ); - aSt << static_cast<sal_uInt16>(pGraphicAttr->GetDrawMode()) - << static_cast<sal_uInt32>(pGraphicAttr->GetMirrorFlags()) - << static_cast<sal_Int32>(pGraphicAttr->GetLeftCrop()) - << static_cast<sal_Int32>(pGraphicAttr->GetTopCrop()) - << static_cast<sal_Int32>(pGraphicAttr->GetRightCrop()) - << static_cast<sal_Int32>(pGraphicAttr->GetBottomCrop()) - << pGraphicAttr->GetRotation() - << pGraphicAttr->GetLuminance() - << pGraphicAttr->GetContrast() - << pGraphicAttr->GetChannelR() - << pGraphicAttr->GetChannelG() - << pGraphicAttr->GetChannelB() - << pGraphicAttr->GetGamma() - << (sal_Bool)( pGraphicAttr->IsInvert() == sal_True ) - << pGraphicAttr->GetTransparency(); + aSt.WriteUInt16( static_cast<sal_uInt16>(pGraphicAttr->GetDrawMode()) ) + .WriteUInt32( static_cast<sal_uInt32>(pGraphicAttr->GetMirrorFlags()) ) + .WriteInt32( static_cast<sal_Int32>(pGraphicAttr->GetLeftCrop()) ) + .WriteInt32( static_cast<sal_Int32>(pGraphicAttr->GetTopCrop()) ) + .WriteInt32( static_cast<sal_Int32>(pGraphicAttr->GetRightCrop()) ) + .WriteInt32( static_cast<sal_Int32>(pGraphicAttr->GetBottomCrop()) ) + .WriteUInt16( pGraphicAttr->GetRotation() ) + .WriteInt16( pGraphicAttr->GetLuminance() ) + .WriteInt16( pGraphicAttr->GetContrast() ) + .WriteInt16( pGraphicAttr->GetChannelR() ) + .WriteInt16( pGraphicAttr->GetChannelG() ) + .WriteInt16( pGraphicAttr->GetChannelB() ) + << pGraphicAttr->GetGamma(); + aSt.WriteUChar( (sal_Bool)( pGraphicAttr->IsInvert() == sal_True ) ) + .WriteUChar( pGraphicAttr->GetTransparency() ); mnIdentifier[ 1 ] = rtl_crc32( 0, aSt.GetData(), aSt.Tell() ); } else @@ -4064,26 +4064,26 @@ void EscherBlibEntry::WriteBlibEntry( SvStream& rSt, sal_Bool bWritePictureOffse { sal_uInt32 nPictureOffset = ( bWritePictureOffset ) ? mnPictureOffset : 0; - rSt << (sal_uInt32)( ( ESCHER_BSE << 16 ) | ( ( (sal_uInt16)meBlibType << 4 ) | 2 ) ) - << (sal_uInt32)( 36 + nResize ) - << (sal_uInt8)meBlibType; + rSt.WriteUInt32( (sal_uInt32)( ( ESCHER_BSE << 16 ) | ( ( (sal_uInt16)meBlibType << 4 ) | 2 ) ) ) + .WriteUInt32( (sal_uInt32)( 36 + nResize ) ) + .WriteUChar( (sal_uInt8)meBlibType ); switch ( meBlibType ) { case EMF : case WMF : // converting EMF/WMF on OS2 to Pict - rSt << (sal_uInt8)PICT; + rSt.WriteUChar( (sal_uInt8)PICT ); break; default: - rSt << (sal_uInt8)meBlibType; + rSt.WriteUChar( (sal_uInt8)meBlibType ); }; rSt.Write( &mnIdentifier[ 0 ], 16 ); - rSt << (sal_uInt16)0 - << (sal_uInt32)( mnSize + mnSizeExtra ) - << mnRefCount - << nPictureOffset - << (sal_uInt32)0; + rSt.WriteUInt16( (sal_uInt16)0 ) + .WriteUInt32( (sal_uInt32)( mnSize + mnSizeExtra ) ) + .WriteUInt32( mnRefCount ) + .WriteUInt32( nPictureOffset ) + .WriteUInt32( (sal_uInt32)0 ); } EscherBlibEntry::~EscherBlibEntry() @@ -4165,8 +4165,8 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM sal_uInt32 nSize = GetBlibStoreContainerSize( pMergePicStreamBSE ); if ( nSize ) { - rSt << (sal_uInt32)( ( ESCHER_BstoreContainer << 16 ) | 0x1f ) - << (sal_uInt32)( nSize - 8 ); + rSt.WriteUInt32( (sal_uInt32)( ( ESCHER_BstoreContainer << 16 ) | 0x1f ) ) + .WriteUInt32( (sal_uInt32)( nSize - 8 ) ); if ( pMergePicStreamBSE ) { @@ -4187,16 +4187,16 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM sal_uInt16 n16; // record version and instance *pMergePicStreamBSE >> n16; - rSt << n16; + rSt.WriteUInt16( n16 ); // record type *pMergePicStreamBSE >> n16; - rSt << sal_uInt16( ESCHER_BlipFirst + nBlibType ); + rSt.WriteUInt16( sal_uInt16( ESCHER_BlipFirst + nBlibType ) ); DBG_ASSERT( n16 == ESCHER_BlipFirst + nBlibType , "EscherGraphicProvider::WriteBlibStoreContainer: BLIP record types differ" ); sal_uInt32 n32; // record size *pMergePicStreamBSE >> n32; nBlipSize -= 8; - rSt << nBlipSize; + rSt.WriteUInt32( nBlipSize ); DBG_ASSERT( nBlipSize == n32, "EscherGraphicProvider::WriteBlibStoreContainer: BLIP sizes differ" ); // record while ( nBlipSize ) @@ -4356,17 +4356,17 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin if ( mnFlags & _E_GRAPH_PROV_USE_INSTANCES ) { - rPicOutStrm << (sal_uInt32)( 0x7f90000 | (sal_uInt16)( mnBlibEntrys << 4 ) ) - << (sal_uInt32)0; + rPicOutStrm.WriteUInt32( (sal_uInt32)( 0x7f90000 | (sal_uInt16)( mnBlibEntrys << 4 ) ) ) + .WriteUInt32( (sal_uInt32)0 ); nAtomSize = rPicOutStrm.Tell(); if ( eBlibType == PNG ) - rPicOutStrm << (sal_uInt16)0x0606; + rPicOutStrm.WriteUInt16( (sal_uInt16)0x0606 ); else if ( eBlibType == WMF ) - rPicOutStrm << (sal_uInt16)0x0403; + rPicOutStrm.WriteUInt16( (sal_uInt16)0x0403 ); else if ( eBlibType == EMF ) - rPicOutStrm << (sal_uInt16)0x0402; + rPicOutStrm.WriteUInt16( (sal_uInt16)0x0402 ); else if ( eBlibType == PEG ) - rPicOutStrm << (sal_uInt16)0x0505; + rPicOutStrm.WriteUInt16( (sal_uInt16)0x0505 ); } // fdo#69607 do not compress WMF files if we are in OOXML export if ( ( eBlibType == PEG ) || ( eBlibType == PNG ) || @@ -4375,9 +4375,9 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin nExtra = 17; p_EscherBlibEntry->mnSizeExtra = nExtra + 8; nInstance = ( eBlibType == PNG ) ? 0xf01e6e00 : 0xf01d46a0; - rPicOutStrm << nInstance << (sal_uInt32)( p_EscherBlibEntry->mnSize + nExtra ); + rPicOutStrm.WriteUInt32( nInstance ).WriteUInt32( (sal_uInt32)( p_EscherBlibEntry->mnSize + nExtra ) ); rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 ); - rPicOutStrm << (sal_uInt8)0xff; + rPicOutStrm.WriteUChar( (sal_uInt8)0xff ); rPicOutStrm.Write( pGraphicAry, p_EscherBlibEntry->mnSize ); } else @@ -4395,7 +4395,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin nExtra = eBlibType == WMF ? 0x42 : 0x32; // !EMF -> no change p_EscherBlibEntry->mnSizeExtra = nExtra + 8; nInstance = ( eBlibType == WMF ) ? 0xf01b2170 : 0xf01a3d40; // !EMF -> no change - rPicOutStrm << nInstance << (sal_uInt32)( p_EscherBlibEntry->mnSize + nExtra ); + rPicOutStrm.WriteUInt32( nInstance ).WriteUInt32( (sal_uInt32)( p_EscherBlibEntry->mnSize + nExtra ) ); if ( eBlibType == WMF ) // !EMF -> no change rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 ); rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 ); @@ -4425,15 +4425,15 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin nWidth = aPrefSize.Width() * 360; nHeight = aPrefSize.Height() * 360; } - rPicOutStrm << nUncompressedSize // WMFSize without FileHeader - << (sal_Int32)0 // since we can't find out anymore what the original size of - << (sal_Int32)0 // the WMF (without Fileheader) was we write 10cm / x - << nPrefWidth - << nPrefHeight - << nWidth - << nHeight - << p_EscherBlibEntry->mnSize - << (sal_uInt16)0xfe00; // compression Flags + rPicOutStrm.WriteUInt32( nUncompressedSize ) // WMFSize without FileHeader + .WriteInt32( (sal_Int32)0 ) // since we can't find out anymore what the original size of + .WriteInt32( (sal_Int32)0 ) // the WMF (without Fileheader) was we write 10cm / x + .WriteUInt32( nPrefWidth ) + .WriteUInt32( nPrefHeight ) + .WriteUInt32( nWidth ) + .WriteUInt32( nHeight ) + .WriteUInt32( p_EscherBlibEntry->mnSize ) + .WriteUInt16( (sal_uInt16)0xfe00 ); // compression Flags rPicOutStrm.Write( pGraphicAry, p_EscherBlibEntry->mnSize ); } } @@ -4441,7 +4441,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin { sal_uInt32 nPos = rPicOutStrm.Tell(); rPicOutStrm.Seek( nAtomSize - 4 ); - rPicOutStrm << (sal_uInt32)( nPos - nAtomSize ); + rPicOutStrm.WriteUInt32( (sal_uInt32)( nPos - nAtomSize ) ); rPicOutStrm.Seek( nPos ); } nBlibId = ImplInsertBlib( p_EscherBlibEntry ), p_EscherBlibEntry = NULL; @@ -4764,9 +4764,9 @@ void EscherSolverContainer::WriteSolver( SvStream& rStrm ) if ( nCount ) { sal_uInt32 nRecHdPos, nCurrentPos, nSize; - rStrm << (sal_uInt16)( ( nCount << 4 ) | 0xf ) // open an ESCHER_SolverContainer - << (sal_uInt16)ESCHER_SolverContainer // - << (sal_uInt32)0; // + rStrm .WriteUInt16( (sal_uInt16)( ( nCount << 4 ) | 0xf ) ) // open an ESCHER_SolverContainer + .WriteUInt16( (sal_uInt16)ESCHER_SolverContainer ) // + .WriteUInt32( (sal_uInt32)0 ); // nRecHdPos = rStrm.Tell() - 4; @@ -4787,14 +4787,14 @@ void EscherSolverContainer::WriteSolver( SvStream& rStrm ) if ( aConnectorRule.nShapeB ) aConnectorRule.ncptiB = pPtr->GetConnectorRule( sal_False ); } - rStrm << (sal_uInt32)( ( ESCHER_ConnectorRule << 16 ) | 1 ) // atom hd - << (sal_uInt32)24 // - << aConnectorRule.nRuleId - << aConnectorRule.nShapeA - << aConnectorRule.nShapeB - << aConnectorRule.nShapeC - << aConnectorRule.ncptiA - << aConnectorRule.ncptiB; + rStrm .WriteUInt32( (sal_uInt32)( ( ESCHER_ConnectorRule << 16 ) | 1 ) ) // atom hd + .WriteUInt32( (sal_uInt32)24 ) // + .WriteUInt32( aConnectorRule.nRuleId ) + .WriteUInt32( aConnectorRule.nShapeA ) + .WriteUInt32( aConnectorRule.nShapeB ) + .WriteUInt32( aConnectorRule.nShapeC ) + .WriteUInt32( aConnectorRule.ncptiA ) + .WriteUInt32( aConnectorRule.ncptiB ); aConnectorRule.nRuleId += 2; } @@ -4802,7 +4802,7 @@ void EscherSolverContainer::WriteSolver( SvStream& rStrm ) nCurrentPos = rStrm.Tell(); // close the ESCHER_SolverContainer nSize = ( nCurrentPos - nRecHdPos ) - 4;// rStrm.Seek( nRecHdPos ); // - rStrm << nSize; // + rStrm.WriteUInt32( nSize ); // rStrm.Seek( nCurrentPos ); // } } @@ -4896,7 +4896,7 @@ void EscherExGlobal::WriteDggAtom( SvStream& rStrm ) const sal_uInt32 nDggSize = GetDggAtomSize(); // write the DGG record header (do not include the 8 bytes of the header in the data size) - rStrm << static_cast< sal_uInt32 >( ESCHER_Dgg << 16 ) << static_cast< sal_uInt32 >( nDggSize - 8 ); + rStrm.WriteUInt32( static_cast< sal_uInt32 >( ESCHER_Dgg << 16 ) ).WriteUInt32( static_cast< sal_uInt32 >( nDggSize - 8 ) ); // claculate and write the fixed DGG data sal_uInt32 nShapeCount = 0; @@ -4909,11 +4909,11 @@ void EscherExGlobal::WriteDggAtom( SvStream& rStrm ) const // the non-existing cluster with index #0 is counted too sal_uInt32 nClusterCount = static_cast< sal_uInt32 >( maClusterTable.size() + 1 ); sal_uInt32 nDrawingCount = static_cast< sal_uInt32 >( maDrawingInfos.size() ); - rStrm << nLastShapeId << nClusterCount << nShapeCount << nDrawingCount; + rStrm.WriteUInt32( nLastShapeId ).WriteUInt32( nClusterCount ).WriteUInt32( nShapeCount ).WriteUInt32( nDrawingCount ); // write the cluster table for( ClusterTable::const_iterator aIt = maClusterTable.begin(), aEnd = maClusterTable.end(); aIt != aEnd; ++aIt ) - rStrm << aIt->mnDrawingId << aIt->mnNextShapeId; + rStrm.WriteUInt32( aIt->mnDrawingId ).WriteUInt32( aIt->mnNextShapeId ); } SvStream* EscherExGlobal::QueryPictureStream() @@ -5041,7 +5041,7 @@ void EscherEx::InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom ) if ( (nCurPos < nEndOfRecord) || ((nCurPos == nEndOfRecord) && (bContainer || bExpandEndOfAtom)) ) { mpOutStrm->SeekRel( -4 ); - *mpOutStrm << (sal_uInt32)( nSize + nBytes ); + mpOutStrm->WriteUInt32( (sal_uInt32)( nSize + nBytes ) ); if ( !bContainer ) mpOutStrm->SeekRel( nSize ); } @@ -5111,7 +5111,7 @@ sal_Bool EscherEx::InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue ) sal_Bool bRetValue = SeekToPersistOffset( nKey ); if ( bRetValue ) { - *mpOutStrm << nValue; + mpOutStrm->WriteUInt32( nValue ); mpOutStrm->Seek( nOldPos ); } return bRetValue; @@ -5119,7 +5119,7 @@ sal_Bool EscherEx::InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue ) void EscherEx::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance ) { - *mpOutStrm << (sal_uInt16)( ( nRecInstance << 4 ) | 0xf ) << nEscherContainer << (sal_uInt32)0; + mpOutStrm->WriteUInt16( (sal_uInt16)( ( nRecInstance << 4 ) | 0xf ) ).WriteUInt16( nEscherContainer ).WriteUInt32( (sal_uInt32)0 ); mOffsets.push_back( mpOutStrm->Tell() - 4 ); mRecTypes.push_back( nEscherContainer ); switch( nEscherContainer ) @@ -5147,8 +5147,8 @@ void EscherEx::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance ) mnCurrentDg = mxGlobal->GenerateDrawingId(); AddAtom( 8, ESCHER_Dg, 0, mnCurrentDg ); PtReplaceOrInsert( ESCHER_Persist_Dg | mnCurrentDg, mpOutStrm->Tell() ); - *mpOutStrm << (sal_uInt32)0 // The number of shapes in this drawing - << (sal_uInt32)0; // The last MSOSPID given to an SP in this DG + mpOutStrm->WriteUInt32( (sal_uInt32)0 ) // The number of shapes in this drawing + .WriteUInt32( (sal_uInt32)0 ); // The last MSOSPID given to an SP in this DG } } } @@ -5178,7 +5178,7 @@ void EscherEx::CloseContainer() sal_uInt32 nSize, nPos = mpOutStrm->Tell(); nSize = ( nPos - mOffsets.back() ) - 4; mpOutStrm->Seek( mOffsets.back() ); - *mpOutStrm << nSize; + mpOutStrm->WriteUInt32( nSize ); switch( mRecTypes.back() ) { @@ -5188,7 +5188,7 @@ void EscherEx::CloseContainer() { mbEscherDg = sal_False; if ( DoSeek( ESCHER_Persist_Dg | mnCurrentDg ) ) - *mpOutStrm << mxGlobal->GetDrawingShapeCount( mnCurrentDg ) << mxGlobal->GetLastShapeId( mnCurrentDg ); + mpOutStrm->WriteUInt32( mxGlobal->GetDrawingShapeCount( mnCurrentDg ) ).WriteUInt32( mxGlobal->GetLastShapeId( mnCurrentDg ) ); } } break; @@ -5214,7 +5214,7 @@ void EscherEx::CloseContainer() void EscherEx::BeginAtom() { mnCountOfs = mpOutStrm->Tell(); - *mpOutStrm << (sal_uInt32)0 << (sal_uInt32)0; // record header wird spaeter geschrieben + mpOutStrm->WriteUInt32( (sal_uInt32)0 ).WriteUInt32( (sal_uInt32)0 ); // record header wird spaeter geschrieben } void EscherEx::EndAtom( sal_uInt16 nRecType, int nRecVersion, int nRecInstance ) @@ -5222,31 +5222,31 @@ void EscherEx::EndAtom( sal_uInt16 nRecType, int nRecVersion, int nRecInstance ) sal_uInt32 nOldPos = mpOutStrm->Tell(); mpOutStrm->Seek( mnCountOfs ); sal_uInt32 nSize = nOldPos - mnCountOfs; - *mpOutStrm << (sal_uInt16)( ( nRecInstance << 4 ) | ( nRecVersion & 0xf ) ) << nRecType << (sal_uInt32)( nSize - 8 ); + mpOutStrm->WriteUInt16( (sal_uInt16)( ( nRecInstance << 4 ) | ( nRecVersion & 0xf ) ) ).WriteUInt16( nRecType ).WriteUInt32( (sal_uInt32)( nSize - 8 ) ); mpOutStrm->Seek( nOldPos ); } void EscherEx::AddAtom( sal_uInt32 nAtomSize, sal_uInt16 nRecType, int nRecVersion, int nRecInstance ) { - *mpOutStrm << (sal_uInt16)( ( nRecInstance << 4 ) | ( nRecVersion & 0xf ) ) << nRecType << nAtomSize; + mpOutStrm->WriteUInt16( (sal_uInt16)( ( nRecInstance << 4 ) | ( nRecVersion & 0xf ) ) ).WriteUInt16( nRecType ).WriteUInt32( nAtomSize ); } void EscherEx::AddChildAnchor( const Rectangle& rRect ) { AddAtom( 16, ESCHER_ChildAnchor ); - *mpOutStrm << (sal_Int32)rRect.Left() - << (sal_Int32)rRect.Top() - << (sal_Int32)rRect.Right() - << (sal_Int32)rRect.Bottom(); + mpOutStrm ->WriteInt32( (sal_Int32)rRect.Left() ) + .WriteInt32( (sal_Int32)rRect.Top() ) + .WriteInt32( (sal_Int32)rRect.Right() ) + .WriteInt32( (sal_Int32)rRect.Bottom() ); } void EscherEx::AddClientAnchor( const Rectangle& rRect ) { AddAtom( 8, ESCHER_ClientAnchor ); - *mpOutStrm << (sal_Int16)rRect.Top() - << (sal_Int16)rRect.Left() - << (sal_Int16)( rRect.GetWidth() + rRect.Left() ) - << (sal_Int16)( rRect.GetHeight() + rRect.Top() ); + mpOutStrm->WriteInt16( (sal_Int16)rRect.Top() ) + .WriteInt16( (sal_Int16)rRect.Left() ) + .WriteInt16( (sal_Int16)( rRect.GetWidth() + rRect.Left() ) ) + .WriteInt16( (sal_Int16)( rRect.GetHeight() + rRect.Top() ) ); } EscherExHostAppData* EscherEx::EnterAdditionalTextGroup() @@ -5265,10 +5265,10 @@ sal_uInt32 EscherEx::EnterGroup( const OUString& rShapeName, const Rectangle* pB AddAtom( 16, ESCHER_Spgr, 1 ); PtReplaceOrInsert( ESCHER_Persist_Grouping_Snap | mnGroupLevel, mpOutStrm->Tell() ); - *mpOutStrm << (sal_Int32)aRect.Left() // Bounding box for the grouped shapes to which they will be attached - << (sal_Int32)aRect.Top() - << (sal_Int32)aRect.Right() - << (sal_Int32)aRect.Bottom(); + mpOutStrm ->WriteInt32( (sal_Int32)aRect.Left() ) // Bounding box for the grouped shapes to which they will be attached + .WriteInt32( (sal_Int32)aRect.Top() ) + .WriteInt32( (sal_Int32)aRect.Right() ) + .WriteInt32( (sal_Int32)aRect.Bottom() ); sal_uInt32 nShapeId = GenerateShapeId(); if ( !mnGroupLevel ) @@ -5315,10 +5315,10 @@ sal_Bool EscherEx::SetGroupSnapRect( sal_uInt32 nGroupLevel, const Rectangle& rR sal_uInt32 nCurrentPos = mpOutStrm->Tell(); if ( DoSeek( ESCHER_Persist_Grouping_Snap | ( nGroupLevel - 1 ) ) ) { - *mpOutStrm << (sal_Int32)rRect.Left() // Bounding box for the grouped shapes to which they will be attached - << (sal_Int32)rRect.Top() - << (sal_Int32)rRect.Right() - << (sal_Int32)rRect.Bottom(); + mpOutStrm ->WriteInt32( (sal_Int32)rRect.Left() ) // Bounding box for the grouped shapes to which they will be attached + .WriteInt32( (sal_Int32)rRect.Top() ) + .WriteInt32( (sal_Int32)rRect.Right() ) + .WriteInt32( (sal_Int32)rRect.Bottom() ); mpOutStrm->Seek( nCurrentPos ); } } @@ -5333,7 +5333,7 @@ sal_Bool EscherEx::SetGroupLogicRect( sal_uInt32 nGroupLevel, const Rectangle& r sal_uInt32 nCurrentPos = mpOutStrm->Tell(); if ( DoSeek( ESCHER_Persist_Grouping_Logic | ( nGroupLevel - 1 ) ) ) { - *mpOutStrm << (sal_Int16)rRect.Top() << (sal_Int16)rRect.Left() << (sal_Int16)rRect.Right() << (sal_Int16)rRect.Bottom(); + mpOutStrm->WriteInt16( (sal_Int16)rRect.Top() ).WriteInt16( (sal_Int16)rRect.Left() ).WriteInt16( (sal_Int16)rRect.Right() ).WriteInt16( (sal_Int16)rRect.Bottom() ); mpOutStrm->Seek( nCurrentPos ); } } @@ -5360,7 +5360,7 @@ void EscherEx::AddShape( sal_uInt32 nShpInstance, sal_uInt32 nFlags, sal_uInt32 if ( mnGroupLevel > 1 ) nFlags |= 2; // this not a topmost shape } - *mpOutStrm << nShapeID << nFlags; + mpOutStrm->WriteUInt32( nShapeID ).WriteUInt32( nFlags ); } void EscherEx::Commit( EscherPropertyContainer& rProps, const Rectangle& ) diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 42c4b4ef4a69..7ec4f1d71867 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -152,17 +152,17 @@ static sal_uInt32 nMSOleObjCntr = 0; void Impl_OlePres::Write( SvStream & rStm ) { WriteClipboardFormat( rStm, FORMAT_GDIMETAFILE ); - rStm << (sal_Int32)(nJobLen +4); // a TargetDevice that's always empty + rStm.WriteInt32( (sal_Int32)(nJobLen +4) ); // a TargetDevice that's always empty if( nJobLen ) rStm.Write( pJob, nJobLen ); - rStm << (sal_uInt32)nAspect; - rStm << (sal_Int32)-1; //L-Index always -1 - rStm << (sal_Int32)nAdvFlags; - rStm << (sal_Int32)0; //Compression - rStm << (sal_Int32)aSize.Width(); - rStm << (sal_Int32)aSize.Height(); + rStm.WriteUInt32( (sal_uInt32)nAspect ); + rStm.WriteInt32( (sal_Int32)-1 ); //L-Index always -1 + rStm.WriteInt32( (sal_Int32)nAdvFlags ); + rStm.WriteInt32( (sal_Int32)0 ); //Compression + rStm.WriteInt32( (sal_Int32)aSize.Width() ); + rStm.WriteInt32( (sal_Int32)aSize.Height() ); sal_uLong nPos = rStm.Tell(); - rStm << (sal_Int32)0; + rStm.WriteInt32( (sal_Int32)0 ); if( GetFormat() == FORMAT_GDIMETAFILE && pMtf ) { @@ -194,7 +194,7 @@ void Impl_OlePres::Write( SvStream & rStm ) } sal_uLong nEndPos = rStm.Tell(); rStm.Seek( nPos ); - rStm << (sal_uInt32)(nEndPos - nPos - 4); + rStm.WriteUInt32( (sal_uInt32)(nEndPos - nPos - 4) ); rStm.Seek( nEndPos ); } @@ -6648,7 +6648,7 @@ sal_Bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen, rStm.Read( pData, nDataLen ); // write to ole10 stream - *xOle10Stm << nDataLen; + xOle10Stm->WriteUInt32( nDataLen ); xOle10Stm->Write( pData, nDataLen ); xOle10Stm = SotStorageStreamRef(); diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 750316a9c0dd..3d047a03a9d2 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -2025,8 +2025,8 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt rStCtrl.Seek( pPersistPtr[ nPersistPtr ] ); rStCtrl >> *pHd; - *xOriginal << nIDoNotKnow1 - << nIDoNotKnow2; + xOriginal->WriteUInt32( nIDoNotKnow1 ) + .WriteUInt32( nIDoNotKnow2 ); sal_uInt32 nToCopy, nBufSize; nToCopy = pHd->nRecLen; |