diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 13:56:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 20:23:04 +0200 |
commit | c504780e7883e911916689c12709d64d78125422 (patch) | |
tree | 55b6551855f14d14454f9bd6302870fa8766c61b /stoc | |
parent | 56a9a3a2d7f64c277b3dadd5a910a1183a47ac69 (diff) |
loplugin:sequenceloop in starmath..svl
Change-Id: I473a8eec9cbf6d44b55ffd6f2233bf39cf6217da
Reviewed-on: https://gerrit.libreoffice.org/77528
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/defaultregistry/defaultregistry.cxx | 2 | ||||
-rw-r--r-- | stoc/source/implementationregistration/implreg.cxx | 22 | ||||
-rw-r--r-- | stoc/source/inspect/introspection.cxx | 6 | ||||
-rw-r--r-- | stoc/source/servicemanager/servicemanager.cxx | 12 |
4 files changed, 21 insertions, 21 deletions
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx index 69cd40406944..bfa698b13b91 100644 --- a/stoc/source/defaultregistry/defaultregistry.cxx +++ b/stoc/source/defaultregistry/defaultregistry.cxx @@ -770,7 +770,7 @@ Sequence< Reference< XRegistryKey > > SAL_CALL NestedKeyImpl::openKeys( ) std::transform(localSeq.begin(), localSeq.end(), retSeq.begin(), lKeyNameToRegKey); sal_uInt32 k = local; - for (const auto& rDef : defaultSeq) + for (const auto& rDef : std::as_const(defaultSeq)) { bool insert = std::none_of(retSeq.begin(), std::next(retSeq.begin(), local), [&rDef](const Reference<XRegistryKey>& rKey) { return rKey->getKeyName() == rDef; }); diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 545e2cd6820b..c3d0f1e38820 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -91,7 +91,7 @@ void deleteAllLinkReferences(const Reference < XSimpleRegistry >& xReg, if (!(xKey.is() && (xKey->getValueType() == RegistryValueType_ASCIILIST))) return; - Sequence<OUString> linkNames = xKey->getAsciiListValue(); + const Sequence<OUString> linkNames = xKey->getAsciiListValue(); if (!linkNames.hasElements()) return; @@ -216,7 +216,7 @@ OUString searchImplForLink( Reference < XRegistryKey > xKey = xRootKey->openKey( slash_IMPLEMENTATIONS ); if (xKey.is()) { - Sequence< Reference < XRegistryKey > > subKeys( xKey->openKeys() ); + const Sequence< Reference < XRegistryKey > > subKeys( xKey->openKeys() ); OUString key_name( slash_UNO + linkName ); for (const Reference < XRegistryKey >& xImplKey : subKeys) @@ -526,7 +526,7 @@ void prepareUserKeys(const Reference < XSimpleRegistry >& xDest, } } else { - Sequence< Reference < XRegistryKey> > subKeys = xKey->openKeys(); + const Sequence< Reference < XRegistryKey> > subKeys = xKey->openKeys(); if (subKeys.hasElements()) { @@ -581,7 +581,7 @@ void deleteAllImplementations( const Reference < XSimpleRegistry >& xReg, { bool hasLocationUrl = false; - for (const Reference < XRegistryKey> & xImplKey : subKeys) + for (const Reference < XRegistryKey> & xImplKey : std::as_const(subKeys)) { Reference < XRegistryKey > xKey = xImplKey->openKey( slash_UNO_slash_LOCATION ); @@ -605,7 +605,7 @@ void deleteAllImplementations( const Reference < XSimpleRegistry >& xReg, xKey = xImplKey->openKey( slash_UNO ); if (xKey.is()) { - Sequence< Reference < XRegistryKey > > subKeys2 = xKey->openKeys(); + const Sequence< Reference < XRegistryKey > > subKeys2 = xKey->openKeys(); for (const Reference < XRegistryKey > & rSubKey2 : subKeys2) { @@ -721,7 +721,7 @@ void deleteAllServiceEntries( const Reference < XSimpleRegistry >& xReg, { bool hasNoImplementations = false; - for (const Reference < XRegistryKey > & xServiceKey : subKeys) + for (const Reference < XRegistryKey > & xServiceKey : std::as_const(subKeys)) { if (xServiceKey->getValueType() == RegistryValueType_ASCIILIST) { @@ -902,7 +902,7 @@ void prepareRegistry( Reference< XComponentContext > const & xContext ) // throw ( InvalidRegistryException, CannotRegisterImplementationException, RuntimeException ) { - Sequence< Reference < XRegistryKey > > subKeys = xSource->openKeys(); + const Sequence< Reference < XRegistryKey > > subKeys = xSource->openKeys(); if (!subKeys.hasElements()) { @@ -918,7 +918,7 @@ void prepareRegistry( if (xKey.is()) { // update entries in SERVICES section - Sequence< Reference < XRegistryKey > > serviceKeys = xKey->openKeys(); + const Sequence< Reference < XRegistryKey > > serviceKeys = xKey->openKeys(); OUString implName = xImplKey->getKeyName().copy(1); sal_Int32 firstDot = implName.indexOf('/'); @@ -941,7 +941,7 @@ void prepareRegistry( xKey = xImplKey->openKey( slash_UNO ); if (xKey.is()) { - Sequence< Reference < XRegistryKey > > subKeys2 = xKey->openKeys(); + const Sequence< Reference < XRegistryKey > > subKeys2 = xKey->openKeys(); for (const Reference < XRegistryKey >& rSubKey2 : subKeys2) { @@ -976,7 +976,7 @@ void prepareRegistry( if (xKey.is() && (xKey->getValueType() == RegistryValueType_ASCIILIST)) { // update link entries in REGISTRY_LINKS section - Sequence<OUString> linkNames = xKey->getAsciiListValue(); + const Sequence<OUString> linkNames = xKey->getAsciiListValue(); for (const OUString& rLinkName : linkNames) { @@ -1020,7 +1020,7 @@ void findImplementations( const Reference < XRegistryKey > & xSource, try { - Sequence< Reference < XRegistryKey > > subKeys = xSource->openKeys(); + const Sequence< Reference < XRegistryKey > > subKeys = xSource->openKeys(); for (const Reference < XRegistryKey >& rSubKey : subKeys) { diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index ecfd5684004e..b5cebfd268d5 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -1754,7 +1754,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect( aClassSeq.realloc( nIfaceCount + 1 ); aClassSeq.getArray()[ nIfaceCount ] = xImplClass2; - for( const Reference<XIdlClass>& rxIfaceClass : aClassSeq ) + for( const Reference<XIdlClass>& rxIfaceClass : std::as_const(aClassSeq) ) { if (!seen.insert(rxIfaceClass->getName()).second) { continue; @@ -1763,7 +1763,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect( // 2. Register fields as properties // Get fields - Sequence< Reference<XIdlField> > fields = rxIfaceClass->getFields(); + const Sequence< Reference<XIdlField> > fields = rxIfaceClass->getFields(); for( const Reference<XIdlField>& xField : fields ) { @@ -2355,7 +2355,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect( } // Get fields - Sequence< Reference<XIdlField> > fields = xClassRef->getFields(); + const Sequence< Reference<XIdlField> > fields = xClassRef->getFields(); for( const Reference<XIdlField>& xField : fields ) { diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index 2af11198678a..880b478ec847 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -773,7 +773,7 @@ Reference< XInterface > OServiceManager::createInstanceWithContext( } #endif - Sequence< Reference< XInterface > > factories( + const Sequence< Reference< XInterface > > factories( queryServiceFactories( rServiceSpecifier, xContext ) ); for ( Reference< XInterface > const & xFactory : factories ) { @@ -825,7 +825,7 @@ Reference< XInterface > OServiceManager::createInstanceWithArgumentsAndContext( } #endif - Sequence< Reference< XInterface > > factories( + const Sequence< Reference< XInterface > > factories( queryServiceFactories( rServiceSpecifier, xContext ) ); for ( Reference< XInterface > const & xFactory : factories ) { @@ -1038,7 +1038,7 @@ void OServiceManager::insert( const Any & Element ) m_ImplementationNameMap[ aImplName ] = xEle; //put into the service map - Sequence< OUString > aServiceNames = xInfo->getSupportedServiceNames(); + const Sequence< OUString > aServiceNames = xInfo->getSupportedServiceNames(); for( const OUString& rServiceName : aServiceNames ) { m_ServiceMap.emplace( @@ -1122,7 +1122,7 @@ void OServiceManager::remove( const Any & Element ) if( !xSF.is() ) return; - Sequence< OUString > aServiceNames = xSF->getSupportedServiceNames(); + const Sequence< OUString > aServiceNames = xSF->getSupportedServiceNames(); for( const OUString& rServiceName : aServiceNames ) { pair<HashMultimap_OWString_Interface::iterator, HashMultimap_OWString_Interface::iterator> p = @@ -1305,7 +1305,7 @@ Sequence<OUString> ORegistryServiceManager::getFromServiceName( Reference<XInterface > ORegistryServiceManager::loadWithServiceName( const OUString& serviceName, Reference< XComponentContext > const & xContext ) { - Sequence<OUString> implEntries = getFromServiceName( serviceName ); + const Sequence<OUString> implEntries = getFromServiceName( serviceName ); for (const auto& rEntry : implEntries) { Reference< XInterface > x( loadWithImplementationName( rEntry, xContext ) ); @@ -1411,7 +1411,7 @@ Reference<XEnumeration > ORegistryServiceManager::createContentEnumeration( check_undisposed(); MutexGuard aGuard(m_mutex); // get all implementation names registered under this service name from the registry - Sequence<OUString> aImpls = getFromServiceName( aServiceName ); + const Sequence<OUString> aImpls = getFromServiceName( aServiceName ); // load and insert all factories specified by the registry for( const OUString& aImplName : aImpls ) { |