summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-05 13:27:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-06 08:35:23 +0200
commitab9b38a4064141705aa3a3de9a5d73b465ad3af3 (patch)
tree888fcc6b517c44d77e2d297c13ee84fb487dd7a7 /basic
parent13341ffa49d58f313a05edae4f4f04c215658e9f (diff)
use more begin()/end() for Sequence
Change-Id: I399be6b6ef7a6ce01e883569a177c0969bc29c69
Diffstat (limited to 'basic')
-rw-r--r--basic/source/basmgr/basmgr.cxx18
-rw-r--r--basic/source/uno/namecont.cxx14
2 files changed, 11 insertions, 21 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 762ac7a70ef3..464c10489b46 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1432,31 +1432,27 @@ bool BasicManager::LegacyPsswdBinaryLimitExceeded( std::vector< OUString >& _out
uno::Reference< script::XLibraryContainerPassword > xPassword( GetScriptLibraryContainer(), uno::UNO_QUERY_THROW );
uno::Sequence< OUString > aNames( xScripts->getElementNames() );
- const OUString* pNames = aNames.getConstArray();
- const OUString* pNamesEnd = aNames.getConstArray() + aNames.getLength();
- for ( ; pNames != pNamesEnd; ++pNames )
+ for ( auto const & scriptElementName : aNames )
{
- if( !xPassword->isLibraryPasswordProtected( *pNames ) )
+ if( !xPassword->isLibraryPasswordProtected( scriptElementName ) )
continue;
- StarBASIC* pBasicLib = GetLib( *pNames );
+ StarBASIC* pBasicLib = GetLib( scriptElementName );
if ( !pBasicLib )
continue;
- uno::Reference< container::XNameAccess > xScriptLibrary( xScripts->getByName( *pNames ), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameAccess > xScriptLibrary( xScripts->getByName( scriptElementName ), uno::UNO_QUERY_THROW );
uno::Sequence< OUString > aElementNames( xScriptLibrary->getElementNames() );
sal_Int32 nLen = aElementNames.getLength();
std::vector< OUString > aBigModules( nLen );
sal_Int32 nBigModules = 0;
- const OUString* pElementNames = aElementNames.getConstArray();
- const OUString* pElementNamesEnd = aElementNames.getConstArray() + aElementNames.getLength();
- for ( ; pElementNames != pElementNamesEnd; ++pElementNames )
+ for ( auto const & libraryElementName : aElementNames )
{
- SbModule* pMod = pBasicLib->FindModule( *pElementNames );
+ SbModule* pMod = pBasicLib->FindModule( libraryElementName );
if ( pMod && pMod->ExceedsLegacyModuleSize() )
- aBigModules[ nBigModules++ ] = *pElementNames;
+ aBigModules[ nBigModules++ ] = libraryElementName;
}
if ( nBigModules )
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index a76d47a23723..4a31ce5b2709 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -2014,22 +2014,16 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
{
// remove
const Sequence< OUString > aRemoveNames( xSourceLibrariesStor->getElementNames() );
- for ( const OUString* pRemoveName = aRemoveNames.getConstArray();
- pRemoveName != aRemoveNames.getConstArray() + aRemoveNames.getLength();
- ++pRemoveName
- )
+ for ( auto const & removeName : aRemoveNames )
{
- xSourceLibrariesStor->removeElement( *pRemoveName );
+ xSourceLibrariesStor->removeElement( removeName );
}
// copy
const Sequence< OUString > aCopyNames( xTargetLibrariesStor->getElementNames() );
- for ( const OUString* pCopyName = aCopyNames.getConstArray();
- pCopyName != aCopyNames.getConstArray() + aCopyNames.getLength();
- ++pCopyName
- )
+ for ( auto const & copyName : aCopyNames )
{
- xTargetLibrariesStor->copyElementTo( *pCopyName, xSourceLibrariesStor, *pCopyName );
+ xTargetLibrariesStor->copyElementTo( copyName, xSourceLibrariesStor, copyName );
}
}