diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-25 20:19:30 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-09-26 15:27:17 +0200 |
commit | 5cefde06ea9f4347b5d2747e0d2825c3c710aa83 (patch) | |
tree | 7f24ac5f1fe1749ea8c0135c73de80745b1c7508 /vcl | |
parent | 04fd62096fca2c0b917ac6172104399e65933585 (diff) |
remove unnecessary casts in calls to SvStream.WriteUInt32
left over from our conversion of the SvStream output operators
to more specific methods
Change-Id: I1d848f19f82783e6eabf2da37dbde78fe36ea1e0
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/wmf/emfwr.cxx | 54 | ||||
-rw-r--r-- | vcl/source/filter/wmf/enhwmf.cxx | 16 | ||||
-rw-r--r-- | vcl/source/filter/wmf/wmfwr.cxx | 18 | ||||
-rw-r--r-- | vcl/source/gdi/animate.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/dibtools.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 2 |
6 files changed, 50 insertions, 50 deletions
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 923593a37ffe..369be8b4b5d2 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -167,7 +167,7 @@ void EMFWriter::ImplEndCommentRecord() { sal_Int32 nActPos = m_rStm.Tell(); m_rStm.Seek( mnRecordPos + 8 ); - m_rStm.WriteUInt32( (sal_uInt32)( nActPos - mnRecordPos - 0xc ) ); + m_rStm.WriteUInt32( ( nActPos - mnRecordPos - 0xc ) ); m_rStm.Seek( nActPos ); } ImplEndRecord(); @@ -196,8 +196,8 @@ void EMFWriter::ImplEndPlusRecord() sal_Int32 nActPos = m_rStm.Tell(); sal_Int32 nSize = nActPos - mnRecordPlusPos; m_rStm.Seek( mnRecordPlusPos + 4 ); - m_rStm.WriteUInt32( (sal_uInt32)( nSize ) ) // Size - .WriteUInt32( (sal_uInt32) ( nSize - 0xc ) ); // Data Size + m_rStm.WriteUInt32( ( nSize ) ) // Size + .WriteUInt32( ( nSize - 0xc ) ); // Data Size m_rStm.Seek( nActPos ); mbRecordPlusOpen = false; } @@ -276,7 +276,7 @@ void EMFWriter::ImplWritePlusFillPolygonRecord( const Polygon& rPoly, const sal_ { ImplBeginPlusRecord( EmfPlusFillPolygon, 0xC000 ); // Sets the color as well ImplWritePlusColor( maVDev.GetFillColor(), nTrans ); - m_rStm.WriteUInt32( (sal_uInt32) rPoly.GetSize() ); + m_rStm.WriteUInt32( rPoly.GetSize() ); for( sal_uInt16 i = 0; i < rPoly.GetSize(); i++ ) ImplWritePlusPoint( rPoly[ i ] ); ImplEndPlusRecord(); @@ -336,7 +336,7 @@ bool EMFWriter::WriteEMF(const GDIMetaFile& rMtf) ImplWriteRasterOp( ROP_OVERPAINT ); ImplBeginRecord( WIN_EMR_SETBKMODE ); - m_rStm.WriteUInt32( (sal_uInt32) 1 ); // TRANSPARENT + m_rStm.WriteUInt32( 1 ); // TRANSPARENT ImplEndRecord(); // write emf data @@ -345,22 +345,22 @@ bool EMFWriter::WriteEMF(const GDIMetaFile& rMtf) ImplWritePlusEOF(); ImplBeginRecord( WIN_EMR_EOF ); - m_rStm.WriteUInt32( (sal_uInt32)0 ) // nPalEntries - .WriteUInt32( (sal_uInt32)0x10 ) // offPalEntries - .WriteUInt32( (sal_uInt32)0x14 ); // nSizeLast + m_rStm.WriteUInt32( 0 ) // nPalEntries + .WriteUInt32( 0x10 ) // offPalEntries + .WriteUInt32( 0x14 ); // nSizeLast ImplEndRecord(); // write header const sal_uLong nEndPos = m_rStm.Tell(); m_rStm.Seek( nHeaderPos ); - m_rStm.WriteUInt32( (sal_uInt32) 0x00000001 ).WriteUInt32( (sal_uInt32) 108 ) //use [MS-EMF 2.2.11] HeaderExtension2 Object + m_rStm.WriteUInt32( 0x00000001 ).WriteUInt32( 108 ) //use [MS-EMF 2.2.11] HeaderExtension2 Object .WriteInt32( 0 ).WriteInt32( 0 ).WriteInt32( ( aMtfSizePix.Width() - 1 ) ).WriteInt32( ( aMtfSizePix.Height() - 1 ) ) .WriteInt32( 0 ).WriteInt32( 0 ).WriteInt32( ( aMtfSizeLog.Width() - 1 ) ).WriteInt32( ( aMtfSizeLog.Height() - 1 ) ) - .WriteUInt32( (sal_uInt32) 0x464d4520 ).WriteUInt32( (sal_uInt32) 0x10000 ).WriteUInt32( (sal_uInt32) ( nEndPos - nHeaderPos ) ) - .WriteUInt32( (sal_uInt32) mnRecordCount ).WriteUInt16( ( mnHandleCount + 1 ) ).WriteUInt16( 0 ).WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ) + .WriteUInt32( 0x464d4520 ).WriteUInt32( 0x10000 ).WriteUInt32( ( nEndPos - nHeaderPos ) ) + .WriteUInt32( mnRecordCount ).WriteUInt16( ( mnHandleCount + 1 ) ).WriteUInt16( 0 ).WriteUInt32( 0 ).WriteUInt32( 0 ).WriteUInt32( 0 ) .WriteInt32( aMtfSizePix.Width() ).WriteInt32( aMtfSizePix.Height() ) .WriteInt32( ( aMtfSizeLog.Width() / 100 ) ).WriteInt32( ( aMtfSizeLog.Height() / 100 ) ) - .WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ) + .WriteUInt32( 0 ).WriteUInt32( 0 ).WriteUInt32( 0 ) .WriteInt32( ( aMtfSizeLog.Width() * 10 ) ).WriteInt32( ( aMtfSizeLog.Height() * 10 ) ); //use [MS-EMF 2.2.11] HeaderExtension2 Object m_rStm.Seek( nEndPos ); @@ -420,7 +420,7 @@ void EMFWriter::ImplEndRecord() nFillBytes += 3; // each record has to be dword aligned nFillBytes ^= 3; nFillBytes &= 3; - m_rStm.WriteUInt32( (sal_uInt32)( ( nActPos - mnRecordPos ) + nFillBytes ) ); + m_rStm.WriteUInt32( ( ( nActPos - mnRecordPos ) + nFillBytes ) ); m_rStm.Seek( nActPos ); while( nFillBytes-- ) m_rStm.WriteUChar( 0 ); @@ -567,13 +567,13 @@ void EMFWriter::ImplCheckTextAttr() m_rStm.WriteUInt16( 0 ); // dummy elfVersion, elfStyleSize, elfMatch, elfReserved - m_rStm.WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ) ; + m_rStm.WriteUInt32( 0 ).WriteUInt32( 0 ).WriteUInt32( 0 ).WriteUInt32( 0 ) ; // dummy elfVendorId - m_rStm.WriteUInt32( (sal_uInt32) 0 ); + m_rStm.WriteUInt32( 0 ); // dummy elfCulture - m_rStm.WriteUInt32( (sal_uInt32) 0 ); + m_rStm.WriteUInt32( 0 ); // dummy elfPanose m_rStm.WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ); @@ -678,7 +678,7 @@ void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, bool bClose ) ImplBeginRecord( bClose ? WIN_EMR_POLYGON : WIN_EMR_POLYLINE ); ImplWriteRect( rPoly.GetBoundRect() ); - m_rStm.WriteUInt32( (sal_uInt32) rPoly.GetSize() ); + m_rStm.WriteUInt32( rPoly.GetSize() ); for( sal_uInt16 i = 0; i < rPoly.GetSize(); i++ ) ImplWritePoint( rPoly[ i ] ); @@ -718,10 +718,10 @@ void EMFWriter::ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly ) ImplBeginRecord( WIN_EMR_POLYPOLYGON ); ImplWriteRect( rPolyPoly.GetBoundRect() ); - m_rStm.WriteUInt32( (sal_uInt32)nPolyCount ).WriteUInt32( nTotalPoints ); + m_rStm.WriteUInt32( nPolyCount ).WriteUInt32( nTotalPoints ); for( i = 0; i < nPolyCount; i++ ) - m_rStm.WriteUInt32( (sal_uInt32)rPolyPoly[ i ].GetSize() ); + m_rStm.WriteUInt32( rPolyPoly[ i ].GetSize() ); for( i = 0; i < nPolyCount; i++ ) { @@ -775,7 +775,7 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, bool bClosed ) for ( o = 0; o < nBezPoints; o++ ) aNewPoly[ o + 1 ] = rPoly[ n + o ]; ImplWriteRect( aNewPoly.GetBoundRect() ); - m_rStm.WriteUInt32( (sal_uInt32)nBezPoints ); + m_rStm.WriteUInt32( nBezPoints ); for( o = 1; o < aNewPoly.GetSize(); o++ ) ImplWritePoint( aNewPoly[ o ] ); ImplEndRecord(); @@ -795,7 +795,7 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, bool bClosed ) for ( o = 1; o <= nPoints; o++ ) aNewPoly[ o ] = rPoly[ n - 1 + o ]; ImplWriteRect( aNewPoly.GetBoundRect() ); - m_rStm.WriteUInt32( (sal_uInt32)( nPoints ) ); + m_rStm.WriteUInt32( ( nPoints ) ); for( o = 1; o < aNewPoly.GetSize(); o++ ) ImplWritePoint( aNewPoly[ o ] ); ImplEndRecord(); @@ -839,7 +839,7 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const sal_uLong nOffPos = m_rStm.Tell(); m_rStm.SeekRel( 16 ); - m_rStm.WriteUInt32( (sal_uInt32) 0 ).WriteInt32( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP ); + m_rStm.WriteUInt32( 0 ).WriteInt32( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP ); ImplWriteSize( rSz ); WriteDIB(rBmp, aMemStm, true, false); @@ -862,8 +862,8 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const sal_uLong nEndPos = m_rStm.Tell(); m_rStm.Seek( nOffPos ); - m_rStm.WriteUInt32( (sal_uInt32) 80 ).WriteUInt32( (sal_uInt32)( nHeaderSize + ( nPalCount << 2 ) ) ); - m_rStm.WriteUInt32( (sal_uInt32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) ).WriteUInt32( nImageSize ); + m_rStm.WriteUInt32( 80 ).WriteUInt32( ( nHeaderSize + ( nPalCount << 2 ) ) ); + m_rStm.WriteUInt32( ( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) ).WriteUInt32( nImageSize ); m_rStm.Seek( nEndPos ); ImplEndRecord(); @@ -910,12 +910,12 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const OUString& rText, c ImplBeginRecord( WIN_EMR_EXTTEXTOUTW ); ImplWriteRect( Rectangle( rPos, Size( nNormWidth, maVDev.GetTextHeight() ) ) ); - m_rStm.WriteUInt32( (sal_uInt32)1 ); + m_rStm.WriteUInt32( 1 ); m_rStm.WriteInt32( 0 ).WriteInt32( 0 ); ImplWritePoint( rPos ); - m_rStm.WriteUInt32( (sal_uInt32) nLen ).WriteUInt32( (sal_uInt32) 76 ).WriteUInt32( (sal_uInt32) 2 ); + m_rStm.WriteUInt32( nLen ).WriteUInt32( 76 ).WriteUInt32( 2 ); m_rStm.WriteInt32( 0 ).WriteInt32( 0 ).WriteInt32( 0 ).WriteInt32( 0 ); - m_rStm.WriteUInt32( (sal_uInt32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) ) ); + m_rStm.WriteUInt32( ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) ) ); // write text for( i = 0; i < nLen; i++ ) diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index aced348b7bea..010a35efb54e 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -1193,10 +1193,10 @@ bool EnhWMFReader::ReadEnhWMF() aTmp.ObjectOwnsMemory( true ); aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) - .WriteUInt32( (sal_uInt32)cbBitsSrc ) + .WriteUInt32( cbBitsSrc ) .WriteUInt16( 0 ) .WriteUInt16( 0 ) - .WriteUInt32( (sal_uInt32)cbBmiSrc + 14 ); + .WriteUInt32( cbBmiSrc + 14 ); pWMF->Seek( nStart + offBmiSrc ); pWMF->Read( pBuf + 14, cbBmiSrc ); pWMF->Seek( nStart + offBitsSrc ); @@ -1257,10 +1257,10 @@ bool EnhWMFReader::ReadEnhWMF() aTmp.ObjectOwnsMemory( true ); aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) - .WriteUInt32( (sal_uInt32)cbBitsSrc ) + .WriteUInt32( cbBitsSrc ) .WriteUInt16( 0 ) .WriteUInt16( 0 ) - .WriteUInt32( (sal_uInt32)cbBmiSrc + 14 ); + .WriteUInt32( cbBmiSrc + 14 ); pWMF->Seek( nStart + offBmiSrc ); pWMF->Read( pBuf + 14, cbBmiSrc ); pWMF->Seek( nStart + offBitsSrc ); @@ -1327,10 +1327,10 @@ bool EnhWMFReader::ReadEnhWMF() aTmp.ObjectOwnsMemory( true ); aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) - .WriteUInt32( (sal_uInt32)cbBitsSrc ) + .WriteUInt32( cbBitsSrc ) .WriteUInt16( 0 ) .WriteUInt16( 0 ) - .WriteUInt32( (sal_uInt32)cbBmiSrc + 14 ); + .WriteUInt32( cbBmiSrc + 14 ); pWMF->Seek( nStart + offBmiSrc ); pWMF->Read( pBuf + 14, cbBmiSrc ); pWMF->Seek( nStart + offBitsSrc ); @@ -1567,10 +1567,10 @@ bool EnhWMFReader::ReadEnhWMF() aTmp.ObjectOwnsMemory( true ); aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) - .WriteUInt32( (sal_uInt32)cbBits ) + .WriteUInt32( cbBits ) .WriteUInt16( 0 ) .WriteUInt16( 0 ) - .WriteUInt32( (sal_uInt32)cbBmi + 14 ); + .WriteUInt32( cbBmi + 14 ); pWMF->Seek( nStart + offBmi ); pWMF->Read( pBuf + 14, cbBmi ); pWMF->Seek( nStart + offBits ); diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index fb0d4b9950a4..8538d932a63d 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -427,9 +427,9 @@ void WMFWriter::WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const sal_In pWMF->WriteUInt16( W_MFCOMMENT ) .WriteUInt16( ( nLen + 14 ) ) // we will always have a fourteen byte escape header: .WriteUInt16( 0x4f4f ) // OO - .WriteUInt32( (sal_uInt32)0xa2c2a ) // evil magic number - .WriteUInt32( (sal_uInt32)nCheckSum ) // crc32 checksum about nEsc & pData - .WriteUInt32( (sal_uInt32)nEsc ); // escape number + .WriteUInt32( 0xa2c2a ) // evil magic number + .WriteUInt32( nCheckSum ) // crc32 checksum about nEsc & pData + .WriteUInt32( nEsc ); // escape number pWMF->Write( pData, nLen ); if ( nLen & 1 ) pWMF->WriteUChar( 0 ); // pad byte @@ -1664,9 +1664,9 @@ void WMFWriter::WriteHeader( const GDIMetaFile &, bool bPlaceable ) pWMF->WriteUInt16( 0x0001 ) // type: file .WriteUInt16( 0x0009 ) // header length in words .WriteUInt16( 0x0300 ) // Version as BCD number - .WriteUInt32( (sal_uInt32) 0x00000000 ) // file length (without 1st header), is later corrected by UpdateHeader() + .WriteUInt32( 0x00000000 ) // file length (without 1st header), is later corrected by UpdateHeader() .WriteUInt16( MAXOBJECTHANDLES ) // maxmimum number of simultaneous objects - .WriteUInt32( (sal_uInt32) 0x00000000 ) // maximum record length, is later corrected by UpdateHeader() + .WriteUInt32( 0x00000000 ) // maximum record length, is later corrected by UpdateHeader() .WriteUInt16( 0x0000 ); // reserved } @@ -1893,11 +1893,11 @@ void WMFWriter::WriteEMFRecord( SvMemoryStream& rStream, sal_uInt32 nCurSize, sa WriteRecordHeader( 0, W_META_ESCAPE ); pWMF->WriteUInt16( W_MFCOMMENT ) // same as META_ESCAPE_ENHANCED_METAFILE .WriteUInt16( ( nCurSize + 34 ) ) // we will always have a 34 byte escape header: - .WriteUInt32( (sal_uInt32) 0x43464D57 ) // WMFC - .WriteUInt32( (sal_uInt32) 0x00000001 ) // Comment type - .WriteUInt32( (sal_uInt32) 0x00010000 ) // version + .WriteUInt32( 0x43464D57 ) // WMFC + .WriteUInt32( 0x00000001 ) // Comment type + .WriteUInt32( 0x00010000 ) // version .WriteUInt16( nCheckSum ) // check sum - .WriteUInt32( (sal_uInt32) 0 ) // flags = 0 + .WriteUInt32( 0 ) // flags = 0 .WriteUInt32( nRecCounts ) // total number of records .WriteUInt32( nCurSize ) // size of this record's data .WriteUInt32( nRemainingSize ) // remaining size of data in following records, missing in MSDN documentation diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 86f66d73c837..308f1fecd48d 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -708,7 +708,7 @@ SvStream& WriteAnimation( SvStream& rOStm, const Animation& rAnimation ) WriteDIBBitmapEx(rAnimation.GetBitmapEx(), rOStm); // Write identifier ( SDANIMA1 ) - rOStm.WriteUInt32( (sal_uInt32) 0x5344414e ).WriteUInt32( (sal_uInt32) 0x494d4931 ); + rOStm.WriteUInt32( 0x5344414e ).WriteUInt32( 0x494d4931 ); for( sal_uInt16 i = 0; i < nCount; i++ ) { @@ -723,7 +723,7 @@ SvStream& WriteAnimation( SvStream& rOStm, const Animation& rAnimation ) rOStm.WriteUInt16( ( ( ANIMATION_TIMEOUT_ON_CLICK == rAnimBmp.nWait ) ? 65535 : rAnimBmp.nWait ) ); rOStm.WriteUInt16( rAnimBmp.eDisposal ); rOStm.WriteUChar( rAnimBmp.bUserInput ); - rOStm.WriteUInt32( (sal_uInt32) rAnimation.mnLoopCount ); + rOStm.WriteUInt32( rAnimation.mnLoopCount ); rOStm.WriteUInt32( nDummy32 ); // Unused rOStm.WriteUInt32( nDummy32 ); // Unused rOStm.WriteUInt32( nDummy32 ); // Unused diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index 92a91b65c53e..a37d5c21e3a0 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -1364,7 +1364,7 @@ bool ImplWriteDIBFileHeader(SvStream& rOStm, BitmapReadAccess& rAcc, bool bUseDI const sal_uInt32 nOffset(14 + (bUseDIBV5 ? DIBV5HEADERSIZE : DIBINFOHEADERSIZE) + nPalCount * 4UL); rOStm.WriteUInt16( 0x4D42 ); // 'MB' from BITMAPFILEHEADER - rOStm.WriteUInt32( (sal_uInt32)(nOffset + (rAcc.Height() * rAcc.GetScanlineSize())) ); + rOStm.WriteUInt32( (nOffset + (rAcc.Height() * rAcc.GetScanlineSize())) ); rOStm.WriteUInt16( 0 ); rOStm.WriteUInt16( 0 ); rOStm.WriteUInt32( nOffset ); @@ -1590,8 +1590,8 @@ bool WriteDIBBitmapEx( { if(ImplWriteDIB(rSource.GetBitmap(), 0, rOStm, true, true)) { - rOStm.WriteUInt32( (sal_uInt32)0x25091962 ); - rOStm.WriteUInt32( (sal_uInt32)0xACB20201 ); + rOStm.WriteUInt32( 0x25091962 ); + rOStm.WriteUInt32( 0xACB20201 ); rOStm.WriteUChar( rSource.eTransparent ); if(TRANSPARENT_BITMAP == rSource.eTransparent) diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index c8b842d93b6a..6d3d8a08a62c 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2859,7 +2859,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm ) rOStm.WriteUInt32( nStmCompressMode ); WriteMapMode( rOStm, aPrefMapMode ); WritePair( rOStm, aPrefSize ); - rOStm.WriteUInt32( (sal_uInt32) GetActionSize() ); + rOStm.WriteUInt32( GetActionSize() ); delete pCompat; |