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 /svl | |
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 'svl')
-rw-r--r-- | svl/source/passwordcontainer/passwordcontainer.cxx | 5 | ||||
-rw-r--r-- | svl/source/svdde/ddesvr.cxx | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index aadd1f9892a8..6588a4de4b30 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -50,14 +50,13 @@ using namespace com::sun::star::ucb; static OUString createIndex( vector< OUString > lines ) { OString aResult; - const sal_Char* pLine; for( unsigned int i = 0; i < lines.size(); i++ ) { if( i ) aResult += OString( "__" ); OString line = OUStringToOString( lines[i], RTL_TEXTENCODING_UTF8 ); - pLine = line.getStr(); + const sal_Char* pLine = line.getStr(); while( *pLine ) { @@ -852,7 +851,6 @@ OUString PasswordContainer::GetMasterPassword( const Reference< XInteractionHand if( m_aMasterPasswd.isEmpty() && aHandler.is() ) { OUString aEncodedMP; - bool bAskAgain = false; bool bDefaultPassword = false; if( !m_pStorageFile->getEncodedMP( aEncodedMP ) ) @@ -865,6 +863,7 @@ OUString PasswordContainer::GetMasterPassword( const Reference< XInteractionHand if ( !bDefaultPassword ) { + bool bAskAgain = false; do { bAskAgain = false; diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx index 24492be85a3a..1dd711083377 100644 --- a/svl/source/svdde/ddesvr.cxx +++ b/svl/source/svdde/ddesvr.cxx @@ -372,11 +372,10 @@ found: DdeService* DdeInternal::FindService( HSZ hService ) { - DdeService* s; DdeServices& rSvc = DdeService::GetServices(); for (DdeServices::iterator aI = rSvc.begin(); aI != rSvc.end(); ++aI) { - s = *aI; + DdeService* s = *aI; if ( *s->pName == hService ) return s; } @@ -932,12 +931,11 @@ OUString DdeService::Topics() OUString DdeService::Formats() { OUString s; - long f; short n = 0; for (size_t i = 0; i < aFormats.size(); ++i, ++n) { - f = aFormats[ i ]; + long f = aFormats[ i ]; if ( n ) s += "\t"; |