From 17fc7aa3b8fcd731fb05b5e17e23ee984d166a8f Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Sat, 20 Dec 2014 21:09:40 +0100 Subject: fdo#39440 reduce scope of local variables This addresses some cppcheck warnings. Change-Id: I390607e002e93cf7a6babc26d9be084d9f185058 --- scripting/source/dlgprov/dlgprov.cxx | 2 +- scripting/source/stringresource/stringresource.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripting') diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index 38294297cc75..c6b23ba052e0 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -669,9 +669,9 @@ static const char aResourceResolverPropName[] = "ResourceResolver"; uno::Reference< beans::XPropertySet > xDlgModPropSet( xCtrlMod, uno::UNO_QUERY ); if( xDlgModPropSet.is() ) { - bool bDecoration = true; try { + bool bDecoration = true; Any aDecorationAny = xDlgModPropSet->getPropertyValue( aDecorationPropName ); aDecorationAny >>= bDecoration; if( !bDecoration ) diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index cde4e730a24d..667a9008d2b6 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -543,10 +543,10 @@ void StringResourceImpl::removeLocale( const Locale& locale ) sal_Int32 nLocaleCount = m_aLocaleItemVector.size(); if( nLocaleCount > 1 ) { - LocaleItem* pFallbackItem = NULL; if( m_pCurrentLocaleItem == pRemoveItem || m_pDefaultLocaleItem == pRemoveItem ) { + LocaleItem* pFallbackItem = NULL; for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it ) { LocaleItem* pLocaleItem = *it; -- cgit v1.2.3