diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 15:21:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-16 08:11:27 +0200 |
commit | a0073744aac89648e89506b79e227b17dacf58d0 (patch) | |
tree | d40b1c631884a0ce4428be716f550b12921ab21e /unotools | |
parent | 61e02561aa659d829a6786609fc57d99fd8652b4 (diff) |
loplugin:sequenceloop in ucb..unotools
Change-Id: Ie52d993c185ba43386b494baad0a484d5b365499
Reviewed-on: https://gerrit.libreoffice.org/77532
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/compatibility.cxx | 4 | ||||
-rw-r--r-- | unotools/source/config/configitem.cxx | 4 | ||||
-rw-r--r-- | unotools/source/config/eventcfg.cxx | 4 | ||||
-rw-r--r-- | unotools/source/config/fontcfg.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/historyoptions.cxx | 4 | ||||
-rw-r--r-- | unotools/source/config/lingucfg.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/optionsdlg.cxx | 4 | ||||
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/securityoptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/i18n/localedatawrapper.cxx | 2 | ||||
-rw-r--r-- | unotools/source/misc/ServiceDocumenter.cxx | 6 | ||||
-rw-r--r-- | unotools/source/ucbhelper/progresshandlerwrap.cxx | 2 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucbhelper.cxx | 2 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 2 |
14 files changed, 24 insertions, 22 deletions
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx index f0d211de6957..6fe672e78c31 100644 --- a/unotools/source/config/compatibility.cxx +++ b/unotools/source/config/compatibility.cxx @@ -170,7 +170,7 @@ SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl() : ConfigItem( ROOTN // 4 subkeys for every item! bool bDefaultFound = false; sal_Int32 nDestStep = 0; - for ( const auto& rNode : lNodes ) + for ( const auto& rNode : std::as_const(lNodes) ) { SvtCompatibilityEntry aItem; @@ -293,7 +293,7 @@ Sequence< OUString > SvtCompatibilityOptions_Impl::impl_GetPropertyNames( Sequen sal_Int32 nDestStep = 0; // Copy entries to destination and expand every item with 2 supported sub properties. - for ( const auto& rItem : rItems ) + for ( const auto& rItem : std::as_const(rItems) ) { OUString sFixPath = SETNODE_ALLFILEFORMATS; sFixPath += PATHDELIMITER; diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index ac801fc8df60..fd12fbde6796 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -281,7 +281,7 @@ void ConfigItem::impl_unpackLocalizedProperties( const Sequence< OUString > lOutValues.realloc ( nDestinationCounter+nPropertiesSize ); } - for( const auto& rProperty : lProperties ) + for( const auto& rProperty : std::as_const(lProperties) ) { lOutNames [nDestinationCounter] = sNodeName + rProperty.Name; lOutValues[nDestinationCounter] = rProperty.Value; @@ -641,7 +641,7 @@ bool ConfigItem::ClearNodeSet(const OUString& rNode) xCont.set(xHierarchyAccess, UNO_QUERY); if(!xCont.is()) return false; - Sequence< OUString > aNames = xCont->getElementNames(); + const Sequence< OUString > aNames = xCont->getElementNames(); Reference<XChangesBatch> xBatch(xHierarchyAccess, UNO_QUERY); for(const OUString& rName : aNames) { diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index 4c09402e2bcd..362a161bdfaf 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -185,7 +185,7 @@ void GlobalEventConfig_Impl::ImplCommit() void GlobalEventConfig_Impl::initBindingInfo() { // Get ALL names of current existing list items in configuration! - Sequence< OUString > lEventNames = GetNodeNames( SETNODE_BINDINGS, utl::ConfigNameFormat::LocalPath ); + const Sequence< OUString > lEventNames = GetNodeNames( SETNODE_BINDINGS, utl::ConfigNameFormat::LocalPath ); OUString aSetNode( SETNODE_BINDINGS ); aSetNode += PATHDELIMITER; @@ -230,7 +230,7 @@ void GlobalEventConfig_Impl::replaceByName( const OUString& aName, const Any& aE Reference< XInterface > (), 2); } OUString macroURL; - for( const auto& rProp : props ) + for( const auto& rProp : std::as_const(props) ) { if ( rProp.Name == "Script" ) rProp.Value >>= macroURL; diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index 2b1d3f24fb1f..bd7f7e21330b 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -117,7 +117,7 @@ DefaultFontConfiguration::DefaultFontConfiguration() UNO_QUERY ); if( m_xConfigAccess.is() ) { - Sequence< OUString > aLocales = m_xConfigAccess->getElementNames(); + const Sequence< OUString > aLocales = m_xConfigAccess->getElementNames(); // fill config hash with empty interfaces for( const OUString& rLocaleString : aLocales ) { @@ -331,7 +331,7 @@ FontSubstConfiguration::FontSubstConfiguration() : UNO_QUERY ); if( m_xConfigAccess.is() ) { - Sequence< OUString > aLocales = m_xConfigAccess->getElementNames(); + const Sequence< OUString > aLocales = m_xConfigAccess->getElementNames(); // fill config hash with empty interfaces for( const OUString& rLocaleString : aLocales ) { @@ -973,7 +973,7 @@ void FontSubstConfiguration::readLocaleSubst( const OUString& rBcp47 ) const } if( xNode.is() ) { - Sequence< OUString > aFonts = xNode->getElementNames(); + const Sequence< OUString > aFonts = xNode->getElementNames(); int nFonts = aFonts.getLength(); // improve performance, heap fragmentation it->second.aSubstAttributes.reserve( nFonts ); diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index ec2233ff32ec..5b17c4e927af 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -231,14 +231,14 @@ void SvtHistoryOptions_Impl::Clear( EHistoryType eHistory ) xListAccess->getByName(s_sItemList) >>= xNode; Sequence<OUString> aStrings(xNode->getElementNames()); - for (const auto& rString : aStrings) + for (const auto& rString : std::as_const(aStrings)) xNode->removeByName(rString); // clear OrderList xListAccess->getByName(s_sOrderList) >>= xNode; aStrings = xNode->getElementNames(); - for (const auto& rString : aStrings) + for (const auto& rString : std::as_const(aStrings)) xNode->removeByName(rString); ::comphelper::ConfigurationHelper::flush(m_xCfg); diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index 1d62a2f3013e..70efeba7b6c5 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -1021,7 +1021,7 @@ std::vector< SvtLinguConfigDictionaryEntry > SvtLinguConfig::GetActiveDictionari const uno::Sequence< OUString > aDisabledDics( GetDisabledDictionaries() ); SvtLinguConfigDictionaryEntry aDicEntry; - for (const OUString& rElementName : aElementNames) + for (const OUString& rElementName : std::as_const(aElementNames)) { // does dictionary match the format we are looking for? if (GetDictionaryEntry( rElementName, aDicEntry ) && diff --git a/unotools/source/config/optionsdlg.cxx b/unotools/source/config/optionsdlg.cxx index 988ef98f3857..18cd92386f03 100644 --- a/unotools/source/config/optionsdlg.cxx +++ b/unotools/source/config/optionsdlg.cxx @@ -83,7 +83,7 @@ SvtOptionsDlgOptions_Impl::SvtOptionsDlgOptions_Impl() m_aOptionNodeList( OptionNodeList() ) { OUString sRootNode( ROOT_NODE ); - Sequence< OUString > aNodeSeq = GetNodeNames( sRootNode ); + const Sequence< OUString > aNodeSeq = GetNodeNames( sRootNode ); OUString sNode( sRootNode + g_sPathDelimiter ); for ( const auto& rNode : aNodeSeq ) { @@ -143,7 +143,7 @@ void SvtOptionsDlgOptions_Impl::ReadNode( const OUString& _rNode, NodeType _eTyp if ( _eType != NT_Option ) { OUString sNodes( sNode + sSet ); - Sequence< OUString > aNodes = GetNodeNames( sNodes ); + const Sequence< OUString > aNodes = GetNodeNames( sNodes ); for ( const auto& rNode : aNodes ) { OUString sSubNodeName( sNodes + g_sPathDelimiter + rNode ); diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 02d71146e120..4219c8c44033 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -404,7 +404,7 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() : // Create temporary hash map to have a mapping between property names and property handles Reference< XPropertySetInfo > xPropSetInfo = xPathSettings->getPropertySetInfo(); - Sequence< Property > aPathPropSeq = xPropSetInfo->getProperties(); + const Sequence< Property > aPathPropSeq = xPropSetInfo->getProperties(); NameToHandleMap aTempHashMap; for ( const css::beans::Property& aProperty : aPathPropSeq ) diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index 33a87d8ffb6c..59b542879655 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -410,7 +410,7 @@ void SvtSecurityOptions_Impl::SetProperty( sal_Int32 nProperty, const Any& rValu void SvtSecurityOptions_Impl::LoadAuthors() { m_seqTrustedAuthors.realloc( 0 ); // first clear - Sequence< OUString > lAuthors = GetNodeNames( PROPERTYNAME_MACRO_TRUSTEDAUTHORS ); + const Sequence< OUString > lAuthors = GetNodeNames( PROPERTYNAME_MACRO_TRUSTEDAUTHORS ); sal_Int32 c1 = lAuthors.getLength(); if( c1 ) { diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index ead8a1ac53bb..8a16ec556f47 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -295,7 +295,7 @@ std::vector< LanguageType > LocaleDataWrapper::getInstalledLanguageTypes() if ( !rInstalledLanguageTypes.empty() ) return rInstalledLanguageTypes; - css::uno::Sequence< css::lang::Locale > xLoc = getInstalledLocaleNames(); + const css::uno::Sequence< css::lang::Locale > xLoc = getInstalledLocaleNames(); sal_Int32 nCount = xLoc.getLength(); std::vector< LanguageType > xLang; xLang.reserve(nCount); diff --git a/unotools/source/misc/ServiceDocumenter.cxx b/unotools/source/misc/ServiceDocumenter.cxx index b29848e5b25e..0823d2a6651e 100644 --- a/unotools/source/misc/ServiceDocumenter.cxx +++ b/unotools/source/misc/ServiceDocumenter.cxx @@ -33,7 +33,8 @@ void unotools::misc::ServiceDocumenter::showInterfaceDocs(const Reference<XTypeP return; auto xMSF(m_xContext->getServiceManager()); Reference<system::XSystemShellExecute> xShell(xMSF->createInstanceWithContext("com.sun.star.system.SystemShellExecute", m_xContext), uno::UNO_QUERY); - for(const auto& aType : xTypeProvider->getTypes()) + const css::uno::Sequence<css::uno::Type> aTypes = xTypeProvider->getTypes(); + for(const auto& aType : aTypes) { auto sUrl = aType.getTypeName(); sal_Int32 nIdx = 0; @@ -51,7 +52,8 @@ void unotools::misc::ServiceDocumenter::showServiceDocs(const Reference<XService return; auto xMSF(m_xContext->getServiceManager()); Reference<system::XSystemShellExecute> xShell(xMSF->createInstanceWithContext("com.sun.star.system.SystemShellExecute", m_xContext), uno::UNO_QUERY); - for(const auto& sService : xService->getSupportedServiceNames()) + const css::uno::Sequence<OUString> aServiceNames = xService->getSupportedServiceNames(); + for(const auto& sService : aServiceNames) { auto sUrl = sService; sal_Int32 nIdx = 0; diff --git a/unotools/source/ucbhelper/progresshandlerwrap.cxx b/unotools/source/ucbhelper/progresshandlerwrap.cxx index 2d085970bd53..0934633836a6 100644 --- a/unotools/source/ucbhelper/progresshandlerwrap.cxx +++ b/unotools/source/ucbhelper/progresshandlerwrap.cxx @@ -38,7 +38,7 @@ static bool getStatusFromAny_Impl( const Any& aAny, OUString& aText, sal_Int32& Sequence< Any > aSetList; if( aAny >>= aSetList ) - for( const auto& rSet : aSetList ) + for( const auto& rSet : std::as_const(aSetList) ) { if( !bNumIsSet && ( rSet >>= nNum ) ) bNumIsSet = true; diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index c2b25cd4f594..a411870827a6 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -239,7 +239,7 @@ bool utl::UCBContentHelper::MakeFolder( { bool exists = false; try { - css::uno::Sequence<css::ucb::ContentInfo> info( + const css::uno::Sequence<css::ucb::ContentInfo> info( parent.queryCreatableContentsInfo()); for (const auto& rInfo : info) { // Simply look for the first KIND_FOLDER: diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index a1e96fb3a338..0aa836bfd7fb 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -505,7 +505,7 @@ void Moderator::handle( const Reference<XInteractionRequest >& Request ) } if(aReplyType == EXIT) { - Sequence<Reference<XInteractionContinuation> > aSeq( + const Sequence<Reference<XInteractionContinuation> > aSeq( Request->getContinuations()); for(const auto& rContinuation : aSeq) { Reference<XInteractionAbort> aRef(rContinuation,UNO_QUERY); |