diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2015-01-10 15:52:17 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-01-12 06:45:19 +0000 |
commit | d5f48d742ac1fea9fd341244bbcea09bcd78b476 (patch) | |
tree | e68143fca184da493e368081981d666bad8bd906 /stoc | |
parent | babe4ab629d476bbddbacb85c33436ba09655aea (diff) |
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: I46b9293eed0cba2ebca119cc1fb0a6334ea66308
Reviewed-on: https://gerrit.libreoffice.org/13844
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/defaultregistry/defaultregistry.cxx | 6 | ||||
-rw-r--r-- | stoc/source/implementationregistration/implreg.cxx | 3 |
2 files changed, 3 insertions, 6 deletions
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx index 37ff4a47b8b4..aff3f149edff 100644 --- a/stoc/source/defaultregistry/defaultregistry.cxx +++ b/stoc/source/defaultregistry/defaultregistry.cxx @@ -822,7 +822,6 @@ Sequence< Reference< XRegistryKey > > SAL_CALL NestedKeyImpl::openKeys( ) } Sequence< Reference<XRegistryKey> > retSeq(local + def - len); - bool insert = true; OUString name; sal_Int32 lastIndex; @@ -838,7 +837,7 @@ Sequence< Reference< XRegistryKey > > SAL_CALL NestedKeyImpl::openKeys( ) sal_uInt32 k = local; for (i=0; i < def; i++) { - insert = true; + bool insert = true; for (j=0 ; j < local; j++) { @@ -902,7 +901,6 @@ Sequence< OUString > SAL_CALL NestedKeyImpl::getKeyNames( ) } Sequence<OUString> retSeq(local + def - len); - bool insert = true; for (i=0; i < local; i++) { @@ -912,7 +910,7 @@ Sequence< OUString > SAL_CALL NestedKeyImpl::getKeyNames( ) sal_uInt32 k = local; for (i=0; i < def; i++) { - insert = true; + bool insert = true; for (j=0 ; j < local; j++) { diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index d0627d2cda3a..90d3ce20f684 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -505,13 +505,12 @@ static void deleteUserLink(const Reference < XRegistryKey >& xRootKey, linkName + spool().colon_old ); if (xOldKey.is()) { - bool hasNoImplementations = false; - if (xOldKey->getValueType() == RegistryValueType_ASCIILIST) { Sequence<OUString> implEntries = xOldKey->getAsciiListValue(); sal_Int32 length = implEntries.getLength(); sal_Int32 equals = 0; + bool hasNoImplementations = false; for (sal_Int32 i = 0; i < length; i++) { |