Kaydet (Commit) cc0e9a37 authored tarafından Caolán McNamara's avatar Caolán McNamara

cppcheck: variableScope

Change-Id: If0c56c89e2722d47a401363f3854331229856490
üst 0eb52534
...@@ -3560,10 +3560,9 @@ RTLFUNC(Randomize) ...@@ -3560,10 +3560,9 @@ RTLFUNC(Randomize)
{ {
StarBASIC::Error( SbERR_BAD_ARGUMENT ); StarBASIC::Error( SbERR_BAD_ARGUMENT );
} }
int nSeed;
if( rPar.Count() == 2 ) if( rPar.Count() == 2 )
{ {
nSeed = (int)rPar.Get(1)->GetInteger(); int nSeed = (int)rPar.Get(1)->GetInteger();
theRandomNumberGenerator::get().global_rng.seed(nSeed); theRandomNumberGenerator::get().global_rng.seed(nSeed);
} }
// without parameter, no need to do anything - RNG is seeded at first use // without parameter, no need to do anything - RNG is seeded at first use
......
...@@ -713,13 +713,12 @@ bool VCartesianAxis::createTextShapes( ...@@ -713,13 +713,12 @@ bool VCartesianAxis::createTextShapes(
const TickInfo* pPreviousVisibleTickInfo = NULL; const TickInfo* pPreviousVisibleTickInfo = NULL;
const TickInfo* pPREPreviousVisibleTickInfo = NULL; const TickInfo* pPREPreviousVisibleTickInfo = NULL;
const TickInfo* pLastVisibleNeighbourTickInfo = NULL;
sal_Int32 nTick = 0; sal_Int32 nTick = 0;
for( TickInfo* pTickInfo = rTickIter.firstInfo() for( TickInfo* pTickInfo = rTickIter.firstInfo()
; pTickInfo ; pTickInfo
; pTickInfo = rTickIter.nextInfo(), nTick++ ) ; pTickInfo = rTickIter.nextInfo(), nTick++ )
{ {
pLastVisibleNeighbourTickInfo = bIsStaggered ? const TickInfo* pLastVisibleNeighbourTickInfo = bIsStaggered ?
pPREPreviousVisibleTickInfo : pPreviousVisibleTickInfo; pPREPreviousVisibleTickInfo : pPreviousVisibleTickInfo;
//don't create labels which does not fit into the rhythm //don't create labels which does not fit into the rhythm
...@@ -909,13 +908,12 @@ bool VCartesianAxis::createTextShapesSimple( ...@@ -909,13 +908,12 @@ bool VCartesianAxis::createTextShapesSimple(
uno::Any* pLimitedSpaceAny = PropertyMapper::getValuePointerForLimitedSpace(aPropValues,aPropNames,bLimitedHeight); uno::Any* pLimitedSpaceAny = PropertyMapper::getValuePointerForLimitedSpace(aPropValues,aPropNames,bLimitedHeight);
const TickInfo* pPreviousVisibleTickInfo = NULL; const TickInfo* pPreviousVisibleTickInfo = NULL;
const TickInfo* pLastVisibleNeighbourTickInfo = NULL;
sal_Int32 nTick = 0; sal_Int32 nTick = 0;
for( TickInfo* pTickInfo = rTickIter.firstInfo() for( TickInfo* pTickInfo = rTickIter.firstInfo()
; pTickInfo ; pTickInfo
; pTickInfo = rTickIter.nextInfo(), nTick++ ) ; pTickInfo = rTickIter.nextInfo(), nTick++ )
{ {
pLastVisibleNeighbourTickInfo = pPreviousVisibleTickInfo; const TickInfo* pLastVisibleNeighbourTickInfo = pPreviousVisibleTickInfo;
//don't create labels which does not fit into the rhythm //don't create labels which does not fit into the rhythm
if( nTick%rAxisLabelProperties.nRhythm != 0 ) if( nTick%rAxisLabelProperties.nRhythm != 0 )
......
...@@ -150,22 +150,18 @@ void RscLangEnum::Init( RscNameTable& rNames ) ...@@ -150,22 +150,18 @@ void RscLangEnum::Init( RscNameTable& rNames )
Atom RscLangEnum::AddLanguage( const char* pLang, RscNameTable& rNames ) Atom RscLangEnum::AddLanguage( const char* pLang, RscNameTable& rNames )
{ {
Atom nResult = 0; Atom nResult = 0;
bool bAdd = false;
KEY_STRUCT aStruct; KEY_STRUCT aStruct;
if( ! rNames.Get( nResult = pHS->getID( pLang ), &aStruct ) ) if( ! rNames.Get( nResult = pHS->getID( pLang ), &aStruct ) )
{ {
SetConstant( nResult = rNames.Put( pLang, CONSTNAME, mnLangId ), mnLangId ); SetConstant( nResult = rNames.Put( pLang, CONSTNAME, mnLangId ), mnLangId );
// insert new lang to ULong_Iso_map // insert new lang to ULong_Iso_map
OString aLang( pLang ); OString aLang( pLang );
bAdd = (GetLangId( aLang ) == 0); bool bAdd = (GetLangId( aLang ) == 0);
if ( bAdd ) if ( bAdd )
ULong_Iso_map[ aLang ] = mnLangId; ULong_Iso_map[ aLang ] = mnLangId;
// increase id counter // increase id counter
mnLangId++; mnLangId++;
} }
#if OSL_DEBUG_LEVEL > 2
fprintf( stderr, "AddLanguage( '%s' ) = %d (%s)\n", pLang, nResult, (bAdd ? "added" : "exists") );
#endif
return nResult; return nResult;
} }
......
...@@ -707,7 +707,6 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext ) ...@@ -707,7 +707,6 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext )
osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_FileURL ); osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_FileURL );
if( osl::Directory::E_None == aDirectory.open() ) if( osl::Directory::E_None == aDirectory.open() )
{ {
int idx_ = 0;
OUString aFileUrl, aFileName; OUString aFileUrl, aFileName;
while( aDirectory.getNextItem( aDirItem ) == osl::FileBase::E_None && while( aDirectory.getNextItem( aDirItem ) == osl::FileBase::E_None &&
aDirItem.getFileStatus( aFileStatus ) == osl::FileBase::E_None && aDirItem.getFileStatus( aFileStatus ) == osl::FileBase::E_None &&
...@@ -716,7 +715,7 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext ) ...@@ -716,7 +715,7 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext )
{ {
aFileUrl = aFileStatus.getFileURL(); aFileUrl = aFileStatus.getFileURL();
aFileName = aFileStatus.getFileName(); aFileName = aFileStatus.getFileName();
idx_ = aFileName.lastIndexOf( '.' ); int idx_ = aFileName.lastIndexOf( '.' );
if( idx_ == -1 ) if( idx_ == -1 )
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment