diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2011-06-10 23:30:54 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2011-06-10 23:30:54 +0200 |
commit | 40ab8148a5fda402875e92ec76b949970b072340 (patch) | |
tree | d1b988132322a9dce4157ab71e12db4faf68a0c4 | |
parent | bcca44ddb4b046ce133896be1b47efcee70bd163 (diff) |
Some cppcheck cleaning
-rw-r--r-- | filter/source/graphicfilter/eos2met/eos2met.cxx | 3 | ||||
-rw-r--r-- | filter/source/graphicfilter/epict/epict.cxx | 8 | ||||
-rw-r--r-- | filter/source/graphicfilter/eps/eps.cxx | 4 | ||||
-rw-r--r-- | filter/source/graphicfilter/expm/expm.cxx | 4 | ||||
-rw-r--r-- | filter/source/graphicfilter/icgm/bitmap.cxx | 6 | ||||
-rw-r--r-- | filter/source/graphicfilter/idxf/dxf2mtf.cxx | 6 | ||||
-rw-r--r-- | filter/source/graphicfilter/ios2met/ios2met.cxx | 6 |
7 files changed, 18 insertions, 19 deletions
diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx index aeebfa9e6..fedd4c2bc 100644 --- a/filter/source/graphicfilter/eos2met/eos2met.cxx +++ b/filter/source/graphicfilter/eos2met/eos2met.cxx @@ -1463,7 +1463,6 @@ void METWriter::METSetChrCellSize(Size aSize) void METWriter::METSetChrAngle(short nAngle) { - double fa; long nax,nay; if (nMETChrAngle==nAngle) return; @@ -1476,7 +1475,7 @@ void METWriter::METSetChrAngle(short nAngle) } else { - fa=((double)nAngle)/1800.0*3.14159265359; + double fa=((double)nAngle)/1800.0*3.14159265359; nax=(long)(256.0*cos(fa)+0.5); nay=(long)(256.0*sin(fa)+0.5); } diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx index dfdceb332..e343bc21f 100644 --- a/filter/source/graphicfilter/epict/epict.cxx +++ b/filter/source/graphicfilter/epict/epict.cxx @@ -138,8 +138,8 @@ private: void WritePolygon(const Polygon & rPoly); void WriteArcAngles(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt); - void ConvertLinePattern(PictPattern & rPat, sal_Bool bVisible); - void ConvertFillPattern(PictPattern & rPat, sal_Bool bVisible); + void ConvertLinePattern(PictPattern & rPat, sal_Bool bVisible) const; + void ConvertFillPattern(PictPattern & rPat, sal_Bool bVisible) const; void WriteOpcode_TxFace(const Font & rFont); void WriteOpcode_TxMode(RasterOp eMode); @@ -443,7 +443,7 @@ void PictWriter::WriteArcAngles(const Rectangle & rRect, const Point & rStartPt, } -void PictWriter::ConvertLinePattern(PictPattern & rPat, sal_Bool bVisible) +void PictWriter::ConvertLinePattern(PictPattern & rPat, sal_Bool bVisible) const { if( bVisible ) { @@ -457,7 +457,7 @@ void PictWriter::ConvertLinePattern(PictPattern & rPat, sal_Bool bVisible) } } -void PictWriter::ConvertFillPattern(PictPattern & rPat, sal_Bool bVisible) +void PictWriter::ConvertFillPattern(PictPattern & rPat, sal_Bool bVisible) const { if( bVisible ) { diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index d587cb0c2..8ff0ca714 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -1566,10 +1566,10 @@ void PSWriter::ImplRectFill( const Rectangle & rRect ) void PSWriter::ImplAddPath( const Polygon & rPolygon ) { - sal_uInt16 i = 1; sal_uInt16 nPointCount = rPolygon.GetSize(); if ( nPointCount > 1 ) { + sal_uInt16 i = 1; ImplMoveTo( rPolygon.GetPoint( 0 ) ); while ( i < nPointCount ) { @@ -2482,9 +2482,9 @@ void PSWriter::ImplWriteDouble( double fNumber, sal_uLong nMode ) for ( sal_Int32 n = 0; n < nLength; n++ ) *mpPS << aNumber1.GetChar( (sal_uInt16)n ); - int zCount = 0; if ( nATemp ) { + int zCount = 0; *mpPS << (sal_uInt8)'.'; mnCursorPos++; const ByteString aNumber2( ByteString::CreateFromInt32( nATemp ) ); diff --git a/filter/source/graphicfilter/expm/expm.cxx b/filter/source/graphicfilter/expm/expm.cxx index 3185a56be..856dfcc68 100644 --- a/filter/source/graphicfilter/expm/expm.cxx +++ b/filter/source/graphicfilter/expm/expm.cxx @@ -56,7 +56,7 @@ private: void ImplWriteColor( sal_uInt16 ); void ImplWriteBody(); void ImplWriteNumber( sal_Int32 ); - void ImplWritePixel( sal_uLong ); + void ImplWritePixel( sal_uLong ) const; public: XPMWriter(SvStream& rOStm); @@ -226,7 +226,7 @@ void XPMWriter::ImplWriteNumber( sal_Int32 nNumber ) // ------------------------------------------------------------------------ -void XPMWriter::ImplWritePixel( sal_uLong nCol ) +void XPMWriter::ImplWritePixel( sal_uLong nCol ) const { if ( mnColors > 26 ) { diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx index 102957afb..d42feaf10 100644 --- a/filter/source/graphicfilter/icgm/bitmap.cxx +++ b/filter/source/graphicfilter/icgm/bitmap.cxx @@ -52,7 +52,6 @@ CGMBitmap::~CGMBitmap() void CGMBitmap::ImplGetBitmap( CGMBitmapDescriptor& rDesc ) { rDesc.mbStatus = sal_True; - long nx, ny, nxC, nxCount, nyCount; if ( ImplGetDimensions( rDesc ) && rDesc.mpBuf ) { @@ -63,8 +62,9 @@ void CGMBitmap::ImplGetBitmap( CGMBitmapDescriptor& rDesc ) // the picture may either be read from left to right or right to left, from top to bottom ... - nxCount = rDesc.mnX + 1; // +1 because we are using prefix decreasing - nyCount = rDesc.mnY + 1; + long nxCount = rDesc.mnX + 1; // +1 because we are using prefix decreasing + long nyCount = rDesc.mnY + 1; + long nx, ny, nxC; switch ( rDesc.mnDstBitsPerPixel ) { diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx index 4afc724dd..37ead415e 100644 --- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx +++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx @@ -289,7 +289,7 @@ void DXF2GDIMetaFile::DrawPointEntity(const DXFPointEntity & rE, const DXFTransf void DXF2GDIMetaFile::DrawCircleEntity(const DXFCircleEntity & rE, const DXFTransform & rTransform) { - double frx,fry,fAng; + double frx,fry; sal_uInt16 nPoints,i; DXFVector aC; @@ -301,6 +301,7 @@ void DXF2GDIMetaFile::DrawCircleEntity(const DXFCircleEntity & rE, const DXFTran (long)(aC.fx+frx+0.5),(long)(aC.fy+fry+0.5))); } else { + double fAng; nPoints=OptPointsPerCircle; Polygon aPoly(nPoints); for (i=0; i<nPoints; i++) { @@ -330,7 +331,7 @@ void DXF2GDIMetaFile::DrawCircleEntity(const DXFCircleEntity & rE, const DXFTran void DXF2GDIMetaFile::DrawArcEntity(const DXFArcEntity & rE, const DXFTransform & rTransform) { - double frx,fry,fA1,fdA,fAng; + double frx,fry,fA1,fdA; sal_uInt16 nPoints,i; DXFVector aC; Point aPS,aPE; @@ -363,6 +364,7 @@ void DXF2GDIMetaFile::DrawArcEntity(const DXFArcEntity & rE, const DXFTransform ); } else { + double fAng; nPoints=(sal_uInt16)(fdA/360.0*(double)OptPointsPerCircle+0.5); if (nPoints<2) nPoints=2; Polygon aPoly(nPoints); diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index 6e99e4a1e..0382cf1c1 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -774,10 +774,9 @@ sal_uLong OS2METReader::ReadLittleEndian3BytesLong() long OS2METReader::ReadCoord(sal_Bool b32) { long l; - short s; if (b32) *pOS2MET >> l; - else { *pOS2MET >> s; l=(long)s; } + else { short s;*pOS2MET >> s; l=(long)s; } return l; } @@ -1927,7 +1926,6 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) case GOrdSStLWd : { sal_uInt8 nFlags; - long nWd; *pOS2MET >> nFlags; if ( nFlags & 0x80 ) @@ -1935,7 +1933,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) else { pOS2MET->SeekRel( 1 ); - nWd = ReadCoord( bCoord32 ); + long nWd = ReadCoord( bCoord32 ); if ( nWd < 0 ) nWd = -nWd; aAttr.nStrLinWidth = (sal_uInt16)nWd; |