diff options
author | Kayo Hamid <kayo.hamid@gekkolinux.com.br> | 2011-04-22 11:34:11 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-04-22 11:34:11 +0200 |
commit | 76ffa2189837398beb09f65438d3180f7e32c6fc (patch) | |
tree | f88e218bc91056896805c8bd4d718d62446ffac9 | |
parent | 9ab9d69c7da783d0c528ce58f9c8af54990eae6c (diff) |
cppcheck variableScope
-rw-r--r-- | svl/source/numbers/zformat.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/ruler.cxx | 6 | ||||
-rw-r--r-- | svtools/source/control/toolbarmenu.cxx | 2 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/sgvmain.cxx | 3 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/sgvspln.cxx | 16 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/sgvtext.cxx | 2 | ||||
-rw-r--r-- | svtools/source/filter.vcl/igif/gifread.cxx | 4 | ||||
-rw-r--r-- | tools/source/inet/inetstrm.cxx | 2 |
8 files changed, 17 insertions, 20 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 238717bca163..421cc8769f16 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -3548,11 +3548,11 @@ sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber, sal_uInt16 i, j; xub_StrLen k; String sStr; - long nPrecExp; sal_Bool bInteger = sal_False; if ( rInfo.nThousand != FLAG_STANDARD_IN_FORMAT ) { // special formatting only if no GENERAL keyword in format code const sal_uInt16 nThousand = rInfo.nThousand; + long nPrecExp; for (i = 0; i < nThousand; i++) { if (fNumber > _D_MIN_M_BY_1000) diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index a28f6bbcfe8e..edf9f8de81b8 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -467,13 +467,10 @@ void Ruler::ImplInvertLines( sal_Bool bErase ) void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) { - long n = 0; long nTick3 = aImplRulerUnitTab[mnUnitIndex].nTick3; long nTickCount = aImplRulerUnitTab[mnUnitIndex].nTick1; Size aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode ); long nTickWidth; - long nX; - long nY; sal_Bool bNoTicks = sal_False; //Amelia @@ -569,6 +566,9 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) if ( !bNoTicks ) { + long nX; + long nY; + long n = 0; long nTxtWidth2; long nTxtHeight2 = GetTextHeight()/2; long nTick = 0; diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index 6270dbcc5715..d83c578d4650 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -1081,12 +1081,12 @@ void ToolbarMenu::MouseMove( const MouseEvent& rMEvt ) void ToolbarMenu::implHighlightEntry( const MouseEvent& rMEvt, bool bMBDown ) { - long nY = 0; long nMouseY = rMEvt.GetPosPixel().Y(); Size aOutSz = GetOutputSizePixel(); if ( ( nMouseY >= 0 ) && ( nMouseY < aOutSz.Height() ) ) { bool bHighlighted = sal_False; + long nY = 0; const int nEntryCount = mpImpl->maEntryVector.size(); int nEntry; diff --git a/svtools/source/filter.vcl/filter/sgvmain.cxx b/svtools/source/filter.vcl/filter/sgvmain.cxx index 404e2b5b01a1..ad0c530382f8 100644 --- a/svtools/source/filter.vcl/filter/sgvmain.cxx +++ b/svtools/source/filter.vcl/filter/sgvmain.cxx @@ -768,7 +768,6 @@ void CircType::Draw(OutputDevice& rOut) void BmapType::Draw(OutputDevice& rOut) { //ifstream aInp; - unsigned char nSgfTyp; sal_uInt16 nVersion; String aStr( reinterpret_cast< char const * >(&Filename[ 1 ]), @@ -778,7 +777,7 @@ void BmapType::Draw(OutputDevice& rOut) SvStream* pInp = ::utl::UcbStreamHelper::CreateStream( aFNam.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); if ( pInp ) { - nSgfTyp=CheckSgfTyp( *pInp,nVersion); + unsigned char nSgfTyp=CheckSgfTyp( *pInp,nVersion); switch(nSgfTyp) { case SGF_BITIMAGE: { GraphicFilter aFlt; diff --git a/svtools/source/filter.vcl/filter/sgvspln.cxx b/svtools/source/filter.vcl/filter/sgvspln.cxx index 0ed81a50d534..5077e91f44ea 100644 --- a/svtools/source/filter.vcl/filter/sgvspln.cxx +++ b/svtools/source/filter.vcl/filter/sgvspln.cxx @@ -807,9 +807,6 @@ sal_Bool CalcSpline(Polygon& rPoly, sal_Bool Periodic, sal_uInt16& n, *************************************************************************/ sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly) { - short MinKoord=-32000; // zur Vermeidung - short MaxKoord=32000; // von Ueberlaeufen - double* ax; // Koeffizienten der Polynome double* ay; double* bx; @@ -820,19 +817,20 @@ sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly) double* dy; double* tv; - double Step; // Schrittweite fuer t - double dt1,dt2,dt3; // Delta t, y, ^3 - double t; sal_Bool bEnde; // Teilpolynom zu Ende? sal_uInt16 n; // Anzahl der zu zeichnenden Teilpolynome sal_uInt16 i; // aktuelles Teilpolynom sal_Bool bOk; // noch alles ok? - sal_uInt16 PolyMax=16380;// Maximale Anzahl von Polygonpunkten - long x,y; bOk=CalcSpline(rSpln,Periodic,n,ax,ay,bx,by,cx,cy,dx,dy,tv); if (bOk) { - Step =10; + short MinKoord=-32000; // zur Vermeidung + short MaxKoord=32000; // von Ueberlaeufen + double Step =10; + double dt1,dt2,dt3; // Delta t, y, ^3 + double t; + sal_uInt16 PolyMax=16380;// Maximale Anzahl von Polygonpunkten + long x,y; rPoly.SetSize(1); rPoly.SetPoint(Point(short(ax[0]),short(ay[0])),0); // erster Punkt diff --git a/svtools/source/filter.vcl/filter/sgvtext.cxx b/svtools/source/filter.vcl/filter/sgvtext.cxx index 5eb0b5e5c1f4..c46d180d042e 100644 --- a/svtools/source/filter.vcl/filter/sgvtext.cxx +++ b/svtools/source/filter.vcl/filter/sgvtext.cxx @@ -765,7 +765,6 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A sal_uInt16& nChars, sal_uInt16 Rest, short* Line, UCHAR* cLine) { - sal_uInt16 KernDist=0; // Wert fuer Kerning sal_uInt16 ChrWidth; UCHAR c; UCHAR c1; @@ -775,6 +774,7 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A AbsEnd=(c==AbsatzEnd || c==TextEnd); if (AbsEnd==sal_False) { + sal_uInt16 KernDist=0; // Wert fuer Kerning R.OutCh=ConvertTextChar(c); // von HardTrenn nach '-', ... R.Kapt=(R.Attrib.Schnitt & TextKaptBit) !=0 && UpcasePossible(R.OutCh); if (R.Kapt) R.OutCh=Upcase(R.OutCh); diff --git a/svtools/source/filter.vcl/igif/gifread.cxx b/svtools/source/filter.vcl/igif/gifread.cxx index 8de8c6c01148..6765937081d7 100644 --- a/svtools/source/filter.vcl/igif/gifread.cxx +++ b/svtools/source/filter.vcl/igif/gifread.cxx @@ -451,7 +451,7 @@ void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount ) { if( bInterlaced ) { - long nT1, nT2; + long nT1; // falls Interlaced, werden die Zeilen kopiert if( nLastInterCount ) @@ -489,7 +489,7 @@ void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount ) if( nT1 >= nImageHeight ) { - nT2 = nImageY - ( ( nImageHeight + 7 ) >> 3 ); + long nT2 = nImageY - ( ( nImageHeight + 7 ) >> 3 ); nT1 = ( nT2 << 3 ) + 4; nLastInterCount = 3; diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx index 9390cdd12a9e..07d404b090ad 100644 --- a/tools/source/inet/inetstrm.cxx +++ b/tools/source/inet/inetstrm.cxx @@ -1686,9 +1686,9 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize) for( pOldPos = pChar = (const sal_Char *) pMsgBuffer->GetData(); nBufSize--; pChar++ ) { - int status; if( *pChar == '\r' || *pChar == '\n' ) { + int status; if( aDelim.CompareTo (pOldPos, aDelim.Len()) != COMPARE_EQUAL && aClose.CompareTo (pOldPos, aClose.Len()) |