diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-05 09:28:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-05 14:42:36 +0200 |
commit | 9742c9e40fc2e104eaa806b8f02014055d37ed68 (patch) | |
tree | b9f219659f880407e50a16f2f5744d0d420a415e | |
parent | 8e34b8ce575bab7e71de20db10cc49ae956d7ff1 (diff) |
loplugin:reducevarscope in extensions
Change-Id: I6ba76a8e50d564cd72edc5a3438faef5f3c71bc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103948
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
4 files changed, 5 insertions, 6 deletions
diff --git a/extensions/source/propctrlr/defaultforminspection.cxx b/extensions/source/propctrlr/defaultforminspection.cxx index b4f491051f5b..809279330ae8 100644 --- a/extensions/source/propctrlr/defaultforminspection.cxx +++ b/extensions/source/propctrlr/defaultforminspection.cxx @@ -180,9 +180,9 @@ namespace pcr return; } - sal_Int32 nMinHelpTextLines( 0 ), nMaxHelpTextLines( 0 ); if ( arguments.size() == 2 ) { // constructor: "createWithHelpSection( long, long )" + sal_Int32 nMinHelpTextLines( 0 ), nMaxHelpTextLines( 0 ); if ( !( arguments[0] >>= nMinHelpTextLines ) || !( arguments[1] >>= nMaxHelpTextLines ) ) throw IllegalArgumentException( OUString(), *this, 0 ); createWithHelpSection( nMinHelpTextLines, nMaxHelpTextLines ); diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index fd71ce028da8..669aa0cacd6a 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -395,11 +395,10 @@ namespace pcr sal_Int32 nOldIdCount = aOldIdStrings.getLength(); for ( i = 0; i < nNewCount; ++i ) { - OUString aOldIdStr; OUString aOldPureIdStr; if( i < nOldIdCount ) { - aOldIdStr = pOldIdStrings[i]; + OUString aOldIdStr = pOldIdStrings[i]; aOldPureIdStr = aOldIdStr.copy( 1 ); } OUString aNewPureIdStr = pNewPureIds[i]; @@ -1681,7 +1680,6 @@ namespace pcr { bool bAccuracy = (PROPERTY_ID_DECIMAL_ACCURACY == nActuatingPropId); sal_uInt16 nNewDigits = 0; - bool bUseSep = false; if ( bAccuracy ) { if( ! (_rNewValue >>= nNewDigits) ) @@ -1689,6 +1687,7 @@ namespace pcr } else { + bool bUseSep = false; if( ! (_rNewValue >>= bUseSep) ) SAL_WARN("extensions.propctrlr", "actuatingPropertyChanged: unable to get property " << PROPERTY_ID_SHOWTHOUSANDSEP); } diff --git a/extensions/source/propctrlr/objectinspectormodel.cxx b/extensions/source/propctrlr/objectinspectormodel.cxx index 99447d5c8a3f..6ed1db687aa0 100644 --- a/extensions/source/propctrlr/objectinspectormodel.cxx +++ b/extensions/source/propctrlr/objectinspectormodel.cxx @@ -127,9 +127,9 @@ namespace pcr return; } - sal_Int32 nMinHelpTextLines( 0 ), nMaxHelpTextLines( 0 ); if ( arguments.size() == 3 ) { // constructor: "createWithHandlerFactoriesAndHelpSection( any[], long, long )" + sal_Int32 nMinHelpTextLines( 0 ), nMaxHelpTextLines( 0 ); impl_verifyArgument_throw( arguments[1] >>= nMinHelpTextLines, 2 ); impl_verifyArgument_throw( arguments[2] >>= nMaxHelpTextLines, 3 ); createWithHandlerFactoriesAndHelpSection( factories, nMinHelpTextLines, nMaxHelpTextLines ); diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index 485b4e140947..997dc7eccd60 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -1058,10 +1058,10 @@ UpdateCheck::enableDownload(bool enable, bool paused) { OSL_ASSERT(nullptr == m_pThread); - State eState = DISABLED; if( enable ) { m_pThread = new DownloadThread(m_aCondition, m_xContext, this, m_aUpdateInfo.Sources[0].URL ); + State eState = DISABLED; if( !paused ) { eState = DOWNLOADING; |