summaryrefslogtreecommitdiff
path: root/basic/source/basmgr
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2018-09-08 10:44:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-08 14:45:42 +0200
commitb678dee6a856e3c0bd4e969db76f6a19970e5343 (patch)
tree40210420214763e6f61d78288e91cf36336d7e75 /basic/source/basmgr
parent85966810131b1db3fe0cdc0c54b08703350abf39 (diff)
cppcheck: variableScope in basic
use a range based loop in one case Change-Id: I3d3acc35739634797e2b6e4d1cc2909b3fe33750 Reviewed-on: https://gerrit.libreoffice.org/60188 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic/source/basmgr')
-rw-r--r--basic/source/basmgr/basmgr.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 8318466c88f1..08e13d857eae 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -551,20 +551,18 @@ void BasicManager::SetLibraryContainerInfo( const LibraryContainerInfo& rInfo )
xLibContainer->addContainerListener( xLibContainerListener );
uno::Sequence< OUString > aScriptLibNames = xScriptCont->getElementNames();
- const OUString* pScriptLibName = aScriptLibNames.getConstArray();
- sal_Int32 i, nNameCount = aScriptLibNames.getLength();
- if( nNameCount )
+ if( aScriptLibNames.hasElements() )
{
- for( i = 0 ; i < nNameCount ; ++i, ++pScriptLibName )
+ for(const auto& rScriptLibName : aScriptLibNames)
{
- uno::Any aLibAny = xScriptCont->getByName( *pScriptLibName );
+ uno::Any aLibAny = xScriptCont->getByName( rScriptLibName );
- if ( *pScriptLibName == "Standard" || *pScriptLibName == "VBAProject")
- xScriptCont->loadLibrary( *pScriptLibName );
+ if ( rScriptLibName == "Standard" || rScriptLibName == "VBAProject")
+ xScriptCont->loadLibrary( rScriptLibName );
BasMgrContainerListenerImpl::insertLibraryImpl
- ( xScriptCont, this, aLibAny, *pScriptLibName );
+ ( xScriptCont, this, aLibAny, rScriptLibName );
}
}
else