diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-25 17:56:24 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-09-26 15:26:48 +0200 |
commit | 5501c8d2220ee3cab703d09d348e99ba3e017dba (patch) | |
tree | ce59b08fa7ad1192f3038266db1be0d64a05c0c3 /vcl/source/filter | |
parent | dedfa972bc19f21e6fab7c38a64ae9543142f416 (diff) |
remove unnecessary casts in calls to SvStream.WriteUInt16
left over from our conversion of the SvStream output operators
to more specific methods
Change-Id: I482ca7abb84613971e7e8f839f7aa67a65cd71ff
Diffstat (limited to 'vcl/source/filter')
-rw-r--r-- | vcl/source/filter/wmf/emfwr.cxx | 18 | ||||
-rw-r--r-- | vcl/source/filter/wmf/enhwmf.cxx | 16 | ||||
-rw-r--r-- | vcl/source/filter/wmf/wmfwr.cxx | 38 |
3 files changed, 36 insertions, 36 deletions
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index ee0780879ab6..3a0972cea067 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -182,7 +182,7 @@ void EMFWriter::ImplBeginPlusRecord( sal_uInt16 nType, sal_uInt16 nFlags ) mbRecordPlusOpen = true; mnRecordPlusPos = m_rStm.Tell(); - m_rStm.WriteUInt16( (sal_uInt16) nType ).WriteUInt16( (sal_uInt16) nFlags ); + m_rStm.WriteUInt16( nType ).WriteUInt16( nFlags ); m_rStm.SeekRel( 8 ); } } @@ -266,7 +266,7 @@ void EMFWriter::ImplWritePlusPoint( const Point& rPoint ) { // Convert to pixels const Point aPoint(maVDev.LogicToPixel( rPoint, maDestMapMode )); - m_rStm.WriteUInt16( (sal_uInt16) aPoint.X() ).WriteUInt16( (sal_uInt16) aPoint.Y() ); + m_rStm.WriteUInt16( aPoint.X() ).WriteUInt16( aPoint.Y() ); } void EMFWriter::ImplWritePlusFillPolygonRecord( const Polygon& rPoly, const sal_uInt32& nTrans ) @@ -357,7 +357,7 @@ bool EMFWriter::WriteEMF(const GDIMetaFile& rMtf) .WriteInt32( (sal_Int32) 0 ).WriteInt32( (sal_Int32) 0 ).WriteInt32( (sal_Int32) ( aMtfSizePix.Width() - 1 ) ).WriteInt32( (sal_Int32) ( aMtfSizePix.Height() - 1 ) ) .WriteInt32( (sal_Int32) 0 ).WriteInt32( (sal_Int32) 0 ).WriteInt32( (sal_Int32) ( aMtfSizeLog.Width() - 1 ) ).WriteInt32( (sal_Int32) ( aMtfSizeLog.Height() - 1 ) ) .WriteUInt32( (sal_uInt32) 0x464d4520 ).WriteUInt32( (sal_uInt32) 0x10000 ).WriteUInt32( (sal_uInt32) ( nEndPos - nHeaderPos ) ) - .WriteUInt32( (sal_uInt32) mnRecordCount ).WriteUInt16( (sal_uInt16) ( mnHandleCount + 1 ) ).WriteUInt16( (sal_uInt16) 0 ).WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ) + .WriteUInt32( (sal_uInt32) mnRecordCount ).WriteUInt16( ( mnHandleCount + 1 ) ).WriteUInt16( 0 ).WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ) .WriteInt32( (sal_Int32) aMtfSizePix.Width() ).WriteInt32( (sal_Int32) aMtfSizePix.Height() ) .WriteInt32( (sal_Int32) ( aMtfSizeLog.Width() / 100 ) ).WriteInt32( (sal_Int32) ( aMtfSizeLog.Height() / 100 ) ) .WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ).WriteUInt32( (sal_uInt32) 0 ) @@ -556,15 +556,15 @@ void EMFWriter::ImplCheckTextAttr() m_rStm.WriteUChar( nPitchAndFamily ); for( i = 0; i < 32; i++ ) - m_rStm.WriteUInt16( (sal_Unicode) ( ( i < aFontName.getLength() ) ? aFontName[ i ] : 0 ) ); + m_rStm.WriteUInt16( ( ( i < aFontName.getLength() ) ? aFontName[ i ] : 0 ) ); // dummy elfFullName for( i = 0; i < 64; i++ ) - m_rStm.WriteUInt16( (sal_Unicode) 0 ); + m_rStm.WriteUInt16( 0 ); // dummy elfStyle for( i = 0; i < 32; i++ ) - m_rStm.WriteUInt16( (sal_Unicode) 0 ); + 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 ) ; @@ -579,7 +579,7 @@ void EMFWriter::ImplCheckTextAttr() m_rStm.WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ); // fill record to get a record size divideable by 4 - m_rStm.WriteUInt16( (sal_uInt16) 0 ); + m_rStm.WriteUInt16( 0 ); ImplEndRecord(); @@ -919,11 +919,11 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const OUString& rText, c // write text for( i = 0; i < nLen; i++ ) - m_rStm.WriteUInt16( (sal_Unicode)rText[ i ] ); + m_rStm.WriteUInt16( rText[ i ] ); // padding word if( nLen & 1 ) - m_rStm.WriteUInt16( (sal_uInt16) 0 ); + m_rStm.WriteUInt16( 0 ); // write DX array ImplWriteExtent( pDX[ 0 ] ); diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index 9389fdc63f66..aced348b7bea 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -1194,8 +1194,8 @@ bool EnhWMFReader::ReadEnhWMF() aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) .WriteUInt32( (sal_uInt32)cbBitsSrc ) - .WriteUInt16( (sal_uInt16)0 ) - .WriteUInt16( (sal_uInt16)0 ) + .WriteUInt16( 0 ) + .WriteUInt16( 0 ) .WriteUInt32( (sal_uInt32)cbBmiSrc + 14 ); pWMF->Seek( nStart + offBmiSrc ); pWMF->Read( pBuf + 14, cbBmiSrc ); @@ -1258,8 +1258,8 @@ bool EnhWMFReader::ReadEnhWMF() aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) .WriteUInt32( (sal_uInt32)cbBitsSrc ) - .WriteUInt16( (sal_uInt16)0 ) - .WriteUInt16( (sal_uInt16)0 ) + .WriteUInt16( 0 ) + .WriteUInt16( 0 ) .WriteUInt32( (sal_uInt32)cbBmiSrc + 14 ); pWMF->Seek( nStart + offBmiSrc ); pWMF->Read( pBuf + 14, cbBmiSrc ); @@ -1328,8 +1328,8 @@ bool EnhWMFReader::ReadEnhWMF() aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) .WriteUInt32( (sal_uInt32)cbBitsSrc ) - .WriteUInt16( (sal_uInt16)0 ) - .WriteUInt16( (sal_uInt16)0 ) + .WriteUInt16( 0 ) + .WriteUInt16( 0 ) .WriteUInt32( (sal_uInt32)cbBmiSrc + 14 ); pWMF->Seek( nStart + offBmiSrc ); pWMF->Read( pBuf + 14, cbBmiSrc ); @@ -1568,8 +1568,8 @@ bool EnhWMFReader::ReadEnhWMF() aTmp.WriteUChar( 'B' ) .WriteUChar( 'M' ) .WriteUInt32( (sal_uInt32)cbBits ) - .WriteUInt16( (sal_uInt16)0 ) - .WriteUInt16( (sal_uInt16)0 ) + .WriteUInt16( 0 ) + .WriteUInt16( 0 ) .WriteUInt32( (sal_uInt32)cbBmi + 14 ); pWMF->Seek( nStart + offBmi ); pWMF->Read( pBuf + 14, cbBmi ); diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index b93eeca47b86..1fa62da67618 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -294,12 +294,12 @@ void WMFWriter::WMFRecord_CreateBrushIndirect(const Color& rColor) WriteRecordHeader(0x00000007,W_META_CREATEBRUSHINDIRECT); if( rColor==Color(COL_TRANSPARENT) ) - pWMF->WriteUInt16( (sal_uInt16) W_BS_HOLLOW ); + pWMF->WriteUInt16( W_BS_HOLLOW ); else - pWMF->WriteUInt16( (sal_uInt16) W_BS_SOLID ); + pWMF->WriteUInt16( W_BS_SOLID ); WriteColor( rColor ); - pWMF->WriteUInt16( (sal_uInt16) 0 ); + pWMF->WriteUInt16( 0 ); } void WMFWriter::WMFRecord_CreateFontIndirect(const vcl::Font & rFont) @@ -424,9 +424,9 @@ void WMFWriter::WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const sal_In nCheckSum = rtl_crc32( nCheckSum, pData, nLen ); WriteRecordHeader( 3 + 9 + ( ( nLen + 1 ) >> 1 ), W_META_ESCAPE ); - pWMF->WriteUInt16( (sal_uInt16)W_MFCOMMENT ) - .WriteUInt16( (sal_uInt16)( nLen + 14 ) ) // we will always have a fourteen byte escape header: - .WriteUInt16( (sal_uInt16)0x4f4f ) // OO + 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 @@ -558,7 +558,7 @@ void WMFWriter::TrueExtTextOut( const Point& rPoint, const OUString& rString, WriteRecordHeader( 0, W_META_EXTTEXTOUT ); WritePointYX( rPoint ); sal_uInt16 nNewTextLen = static_cast<sal_uInt16>(rByteString.getLength()); - pWMF->WriteUInt16( nNewTextLen ).WriteUInt16( (sal_uInt16)0 ); + pWMF->WriteUInt16( nNewTextLen ).WriteUInt16( 0 ); write_uInt8s_FromOString(*pWMF, rByteString, nNewTextLen); if ( nNewTextLen & 1 ) pWMF->WriteUChar( 0 ); @@ -581,7 +581,7 @@ void WMFWriter::TrueExtTextOut( const Point& rPoint, const OUString& rString, OString aTemp(&nUniChar, 1, aSrcFont.GetCharSet()); j = aTemp.getLength(); while ( --j > 0 ) - pWMF->WriteUInt16( (sal_uInt16)0 ); + pWMF->WriteUInt16( 0 ); } } pConvertedDXAry.reset(); @@ -655,7 +655,7 @@ void WMFWriter::WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly) } WriteRecordHeader(0,W_META_POLYPOLYGON); pWMF->WriteUInt16( nCount ); - for (i=0; i<nCount; i++) pWMF->WriteUInt16( (sal_uInt16)(aSimplePolyPoly.GetObject(i).GetSize()) ); + for (i=0; i<nCount; i++) pWMF->WriteUInt16( (aSimplePolyPoly.GetObject(i).GetSize()) ); for (i=0; i<nCount; i++) { pPoly=&(aSimplePolyPoly.GetObject(i)); nSize=pPoly->GetSize(); @@ -697,14 +697,14 @@ void WMFWriter::WMFRecord_SelectObject(sal_uInt16 nObjectHandle) void WMFWriter::WMFRecord_SetBkMode(bool bTransparent) { WriteRecordHeader(0x00000004,W_META_SETBKMODE); - if (bTransparent) pWMF->WriteUInt16( (sal_uInt16)W_TRANSPARENT ); - else pWMF->WriteUInt16( (sal_uInt16)W_OPAQUE ); + if (bTransparent) pWMF->WriteUInt16( W_TRANSPARENT ); + else pWMF->WriteUInt16( W_OPAQUE ); } void WMFWriter::WMFRecord_SetStretchBltMode() { WriteRecordHeader( 0x00000004, W_META_SETSTRETCHBLTMODE ); - pWMF->WriteUInt16( (sal_uInt16) 3 ); // STRETCH_DELETESCANS + pWMF->WriteUInt16( 3 ); // STRETCH_DELETESCANS } void WMFWriter::WMFRecord_SetPixel(const Point & rPoint, const Color & rColor) @@ -1661,13 +1661,13 @@ void WMFWriter::WriteHeader( const GDIMetaFile &, bool bPlaceable ) } nMetafileHeaderPos=pWMF->Tell(); - pWMF->WriteUInt16( (sal_uInt16)0x0001 ) // type: file - .WriteUInt16( (sal_uInt16)0x0009 ) // header length in words - .WriteUInt16( (sal_uInt16)0x0300 ) // Version as BCD number + 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() - .WriteUInt16( (sal_uInt16)MAXOBJECTHANDLES ) // maxmimum number of simultaneous objects + .WriteUInt16( MAXOBJECTHANDLES ) // maxmimum number of simultaneous objects .WriteUInt32( (sal_uInt32) 0x00000000 ) // maximum record length, is later corrected by UpdateHeader() - .WriteUInt16( (sal_uInt16)0x0000 ); // reserved + .WriteUInt16( 0x0000 ); // reserved } void WMFWriter::UpdateHeader() @@ -1891,8 +1891,8 @@ void WMFWriter::WriteEMFRecord( SvMemoryStream& rStream, sal_uInt32 nCurSize, sa { // according to http://msdn.microsoft.com/en-us/library/dd366152%28PROT.13%29.aspx WriteRecordHeader( 0, W_META_ESCAPE ); - pWMF->WriteUInt16( (sal_uInt16)W_MFCOMMENT ) // same as META_ESCAPE_ENHANCED_METAFILE - .WriteUInt16( (sal_uInt16)( nCurSize + 34 ) ) // we will always have a 34 byte escape header: + 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 |