summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2011-02-10 14:48:51 +0100
committerJulien Nabet <serval2412@yahoo.fr>2011-02-10 14:48:51 +0100
commit4d1e8ed389f11c06a4d666c62b13da42e1fd8f7c (patch)
tree6fe1ac97c73cb4719e1bcb444a2ff3187186afee /basic
parent31b0769d2c6d58bbd2e067ee88fd5f45f518182f (diff)
Some cppcheck cleaning
Diffstat (limited to 'basic')
-rw-r--r--basic/source/app/msgedit.cxx3
-rw-r--r--basic/source/classes/image.cxx2
-rw-r--r--basic/source/classes/sb.cxx4
-rw-r--r--basic/source/sbx/sbxscan.cxx7
-rw-r--r--basic/source/sbx/sbxvalue.cxx2
5 files changed, 9 insertions, 9 deletions
diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx
index 16e8639c7430..c6d7b0b8d062 100644
--- a/basic/source/app/msgedit.cxx
+++ b/basic/source/app/msgedit.cxx
@@ -543,10 +543,9 @@ String MsgEdit::GetSelected()
TextSelection MsgEdit::GetSelection() const
{
- ULONG nStart=0,nEnd=0;
-
if ( aEditTree.FirstSelected() )
{
+ ULONG nStart=0,nEnd=0;
nStart = aEditTree.GetModel()->GetAbsPos(aEditTree.FirstSelected() );
if ( aEditTree.LastSelected() )
nEnd = aEditTree.GetModel()->GetAbsPos(aEditTree.LastSelected() );
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 654ad79df750..716cbe0497d7 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -149,7 +149,6 @@ BOOL SbiImage::Load( SvStream& r, UINT32& nVersion )
ULONG nNext;
while( ( nNext = r.Tell() ) < nLast )
{
- short i;
r >> nSign >> nLen >> nCount;
nNext += nLen + 8;
@@ -217,6 +216,7 @@ BOOL SbiImage::Load( SvStream& r, UINT32& nVersion )
case B_STRINGPOOL:
if( bBadVer ) break;
MakeStrings( nCount );
+ short i;
for( i = 0; i < nStrings && SbiGood( r ); i++ )
{
r >> nOff;
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index ed2de2533c6f..e53570035efb 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -375,12 +375,12 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
SbxBase* pParObj = pVar->GetObject();
SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
- INT32 lb = 0;
- INT32 ub = 0;
pDest->setHasFixedSize( pSource->hasFixedSize() );
if ( pSource->GetDims() && pSource->hasFixedSize() )
{
+ INT32 lb = 0;
+ INT32 ub = 0;
for ( INT32 j = 1 ; j <= pSource->GetDims(); ++j )
{
pSource->GetDim32( (INT32)j, lb, ub );
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 5fe1704bcc38..c7cfe6e6850e 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -289,7 +289,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth,
short nExp = 0; // Exponent
short nDig = nPrec + 1; // Anzahl Digits in Zahl
short nDec; // Anzahl Vorkommastellen
- register int i, digit;
+ register int i;
// Komma besorgen
sal_Unicode cDecimalSep, cThousandSep;
@@ -339,6 +339,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth,
// Zahl ausgeben:
if( nDig > 0 )
{
+ register int digit;
for( i = 0 ; ; ++i )
{
if( i < 16 )
@@ -747,8 +748,6 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
SvNumberFormatter aFormatter( xFactory, eLangType );
sal_uInt32 nIndex;
- xub_StrLen nCheckPos = 0;
- short nType;
double nNumber;
Color* pCol;
@@ -757,6 +756,8 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
// number format, use SvNumberFormatter to handle it.
if( bSuccess )
{
+ xub_StrLen nCheckPos = 0;
+ short nType;
String aFmtStr = *pFmt;
VbaFormatInfo* pInfo = getFormatInfo( aFmtStr );
if( pInfo && pInfo->meType != VBA_FORMAT_TYPE_NULL )
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index df4fe7b4a753..15b98a2f1256 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -1199,7 +1199,6 @@ BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp )
}
else if( GetType() == SbxCURRENCY || rOp.GetType() == SbxCURRENCY )
{
- double dTest;
aL.eType = SbxCURRENCY;
aR.eType = SbxCURRENCY;
@@ -1210,6 +1209,7 @@ BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp )
if( Get( aL ) ) switch( eOp )
{
+ double dTest;
case SbxMUL:
// first overflow check: see if product will fit - test real value of product (hence 2 curr factors)
dTest = (double)aL.nInt64 * (double)aR.nInt64 / (double)CURRENCY_FACTOR_SQUARE;