diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-10-12 21:44:46 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-13 06:22:33 +0000 |
commit | ed7361ef0bdb6bee4f47a8421221eb7824f02e38 (patch) | |
tree | b745a27d916bb923f01857148e16485ac319f288 /svtools | |
parent | 239c75ed63fb31cfef9cee13d8d58c4fe9e7a906 (diff) |
cppcheck:variableScope
Change-Id: I7cbd5a9e9bb5417f754d4e2445df309140fd40af
Reviewed-on: https://gerrit.libreoffice.org/19329
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/ruler.cxx | 3 | ||||
-rw-r--r-- | svtools/source/graphic/grfmgr2.cxx | 18 | ||||
-rw-r--r-- | svtools/source/svrtf/svparser.cxx | 4 |
3 files changed, 13 insertions, 12 deletions
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index c428286b1414..7a6eeefbfb66 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -484,8 +484,6 @@ void Ruler::ImplDrawTicks(vcl::RenderContext& rRenderContext, long nMin, long nM long nTickWidth; bool bNoTicks = false; - double nAcceptanceDelta = 0.0001; - Size aPixSize = rRenderContext.LogicToPixel(Size(nTick4, nTick4), maMapMode); if (mnUnitIndex == RULER_UNIT_CHAR) @@ -627,6 +625,7 @@ void Ruler::ImplDrawTicks(vcl::RenderContext& rRenderContext, long nMin, long nM // Tick4 - Output (Text) double aStep = (nTick / nTick4); double aRest = std::abs(aStep - std::floor(aStep)); + double nAcceptanceDelta = 0.0001; if (aRest < nAcceptanceDelta) { diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 7bd27f5863cd..c6eae94a354b 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -328,7 +328,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib const long aBitmapWidth = rBmpEx.GetSizePixel().Width(); const long aBitmapHeight = rBmpEx.GetSizePixel().Height(); - long nX, nY, nTmpX, nTmpY, nTmpFX, nTmpFY, nTmp; + long nTmpX, nTmpY, nTmpFX, nTmpFY, nTmp; double fTmp; bool bHMirr( rAttributes.GetMirrorFlags() & BmpMirrorFlags::Horizontal ); @@ -646,12 +646,12 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib { Scanline pLine0, pLine1, pLineW; - for( nY = 0; nY < aTargetHeight; nY++ ) + for( long nY = 0; nY < aTargetHeight; nY++ ) { nSinY = pSinY[ nY ], nCosY = pCosY[ nY ]; pLineW = pWriteAccess->GetScanline( nY ); - for( nX = 0; nX < aTargetWidth; nX++ ) + for( long nX = 0; nX < aTargetWidth; nX++ ) { nUnRotX = ( pCosX[ nX ] - nSinY ) >> 8; nUnRotY = ( pSinX[ nX ] + nCosY ) >> 8; @@ -743,11 +743,11 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib const BitmapColor aTrans( pWriteAccess->GetBestMatchingColor( Color( COL_WHITE ) ) ); BitmapColor aAlphaVal( 0 ); - for( nY = 0; nY < aTargetHeight; nY++ ) + for( long nY = 0; nY < aTargetHeight; nY++ ) { nSinY = pSinY[ nY ], nCosY = pCosY[ nY ]; - for( nX = 0; nX < aTargetWidth; nX++ ) + for( long nX = 0; nX < aTargetWidth; nX++ ) { nUnRotX = ( pCosX[ nX ] - nSinY ) >> 8; nUnRotY = ( pSinX[ nX ] + nCosY ) >> 8; @@ -806,20 +806,20 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib aTestB = pMAcc->GetBestMatchingColor( Color( COL_BLACK ) ); // create new horizontal mapping table - for( nX = 0UL; nX < aUnrotatedWidth; nX++ ) + for( long nX = 0UL; nX < aUnrotatedWidth; nX++ ) pMapLX[ nX ] = FRound( (double) pMapIX[ nX ] + pMapFX[ nX ] / 1048576.0 ); // create new vertical mapping table - for( nY = 0UL; nY < aUnrotatedHeight; nY++ ) + for( long nY = 0UL; nY < aUnrotatedHeight; nY++ ) pMapLY[ nY ] = FRound( (double) pMapIY[ nY ] + pMapFY[ nY ] / 1048576.0 ); // do mask rotation - for( nY = 0; nY < aTargetHeight; nY++ ) + for( long nY = 0; nY < aTargetHeight; nY++ ) { nSinY = pSinY[ nY ]; nCosY = pCosY[ nY ]; - for( nX = 0; nX < aTargetWidth; nX++ ) + for( long nX = 0; nX < aTargetWidth; nX++ ) { nUnRotX = ( pCosX[ nX ] - nSinY ) >> 8; nUnRotY = ( pSinX[ nX ] + nCosY ) >> 8; diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx index 241688d79828..6aa1e30224dc 100644 --- a/svtools/source/svrtf/svparser.cxx +++ b/svtools/source/svrtf/svparser.cxx @@ -159,7 +159,7 @@ sal_Unicode SvParser::GetNextChar() bool bErr; if( bSwitchToUCS2 && 0 == rInput.Tell() ) { - unsigned char c1, c2; + unsigned char c1; bool bSeekBack = true; rInput.ReadUChar( c1 ); @@ -168,6 +168,7 @@ sal_Unicode SvParser::GetNextChar() { if( 0xff == c1 || 0xfe == c1 ) { + unsigned char c2; rInput.ReadUChar( c2 ); bErr = rInput.IsEof() || rInput.GetError(); if( !bErr ) @@ -188,6 +189,7 @@ sal_Unicode SvParser::GetNextChar() } else if( 0xef == c1 || 0xbb == c1 ) // check for UTF-8 BOM { + unsigned char c2; rInput.ReadUChar( c2 ); bErr = rInput.IsEof() || rInput.GetError(); if( !bErr ) |