summaryrefslogtreecommitdiff
path: root/rsc/source/tools
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2014-12-19 10:24:04 +0100
committerNoel Grandin <noelgrandin@gmail.com>2014-12-19 13:48:56 +0000
commit5712983f18e7cdec16ea20a9b3d94a1586de543e (patch)
tree80180ebbf5662ead34dff534e5a14b251dafa28d /rsc/source/tools
parent1e2786ac6d51838308c27a2cb84ce8ad9acd59c9 (diff)
fdo#39440 rsc: reduce scope of local variables
This addresses some cppcheck warnings. Change-Id: I69454a75c8ce4aecf9e68f5887f38f8bf6fe6dca Reviewed-on: https://gerrit.libreoffice.org/13543 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'rsc/source/tools')
-rw-r--r--rsc/source/tools/rscdef.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx
index d89700ef0072..99bec484a792 100644
--- a/rsc/source/tools/rscdef.cxx
+++ b/rsc/source/tools/rscdef.cxx
@@ -392,11 +392,9 @@ RscFile :: ~RscFile()
bool RscFile::Depend( sal_uLong lDepend, sal_uLong lFree )
{
- RscDepend * pDep;
-
for ( size_t i = aDepLst.size(); i > 0; )
{
- pDep = aDepLst[ --i ];
+ RscDepend * pDep = aDepLst[ --i ];
if( pDep->GetFileKey() == lDepend )
{
for ( size_t j = i ? --i : 0; j > 0; )
@@ -442,10 +440,9 @@ RscDefTree::~RscDefTree()
void RscDefTree::Remove()
{
- RscDefine * pDef;
while( pDefRoot )
{
- pDef = pDefRoot;
+ RscDefine * pDef = pDefRoot;
pDefRoot = static_cast<RscDefine *>(pDefRoot->Remove( pDefRoot ));
pDef->DecRef();
}
@@ -647,11 +644,9 @@ void RscFileTab :: DeleteFileContext( sal_uLong lFileKey )
pFName = GetFile( lFileKey );
if( pFName )
{
- RscDefine * pDef;
-
for ( size_t i = 0, n = pFName->aDefLst.maList.size(); i < n; ++i )
{
- pDef = pFName->aDefLst.maList[ i ];
+ RscDefine * pDef = pFName->aDefLst.maList[ i ];
aDefTree.Remove( pDef );
};