diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/dispatchwatcher.cxx | 8 | ||||
-rw-r--r-- | desktop/source/app/langselect.cxx | 3 | ||||
-rw-r--r-- | desktop/source/deployment/manager/dp_manager.cxx | 3 | ||||
-rw-r--r-- | desktop/source/deployment/misc/dp_misc.cxx | 4 | ||||
-rw-r--r-- | desktop/source/deployment/registry/dp_backend.cxx | 6 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 4 | ||||
-rw-r--r-- | desktop/source/migration/migration.cxx | 18 | ||||
-rw-r--r-- | desktop/source/migration/services/oo3extensionmigration.cxx | 8 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_app.cxx | 21 |
9 files changed, 36 insertions, 39 deletions
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index 257b5a6d94b8..bf7ef5931ee7 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -676,18 +676,18 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest aArgs[1].Name = "SynchronMode"; aArgs[1].Value <<= true; - for ( size_t n = 0; n < aDispatches.size(); n++ ) + for (DispatchHolder & aDispatche : aDispatches) { - Reference< XDispatch > xDispatch = aDispatches[n].xDispatch; + Reference< XDispatch > xDispatch = aDispatche.xDispatch; Reference < XNotifyingDispatch > xDisp( xDispatch, UNO_QUERY ); if ( xDisp.is() ) - xDisp->dispatchWithNotification( aDispatches[n].aURL, aArgs, this ); + xDisp->dispatchWithNotification( aDispatche.aURL, aArgs, this ); else { ::osl::ClearableMutexGuard aGuard(m_mutex); m_nRequestCount--; aGuard.clear(); - xDispatch->dispatch( aDispatches[n].aURL, aArgs ); + xDispatch->dispatch( aDispatche.aURL, aArgs ); } } } diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx index 32240d02349b..a8309e5987ba 100644 --- a/desktop/source/app/langselect.cxx +++ b/desktop/source/app/langselect.cxx @@ -61,8 +61,7 @@ OUString getInstalledLocale( } } ::std::vector<OUString> fallbacks( LanguageTag( locale).getFallbackStrings( false)); - for (size_t f=0; f < fallbacks.size(); ++f) { - const OUString& rf = fallbacks[f]; + for (OUString & rf : fallbacks) { for (sal_Int32 i = 0; i != installed.getLength(); ++i) { if (installed[i] == rf) { return installed[i]; diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 864d852c0a58..d86f02a663f1 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -211,9 +211,8 @@ void PackageManagerImpl::initActivationLayer( } bool bShared = (m_context == "shared"); - for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos ) + for (OUString & tempEntry : tempEntries) { - OUString const & tempEntry = tempEntries[ pos ]; const MatchTempDir match( tempEntry ); if (::std::none_of( id2temp.begin(), id2temp.end(), match )) { diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index e02b84d87bd7..ccf8e964d135 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -432,8 +432,8 @@ OUString generateRandomPipeId() throw RuntimeException( "random pool error!?", nullptr ); } OUStringBuffer buf; - for ( sal_uInt32 i = 0; i < ARLEN(bytes); ++i ) { - buf.append( static_cast<sal_Int32>(bytes[ i ]), 0x10 ); + for (unsigned char byte : bytes) { + buf.append( static_cast<sal_Int32>(byte), 0x10 ); } return buf.makeStringAndClear(); } diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index 4e3e2aeeb987..a7ca243e3d89 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -282,12 +282,12 @@ void PackageRegistryBackend::deleteUnusedFolders( makeURLAppendSysPathSegment(sDataFolder, title)); } - for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos ) + for (OUString & tempEntrie : tempEntries) { - if (::std::find( usedFolders.begin(), usedFolders.end(), tempEntries[pos] ) == + if (::std::find( usedFolders.begin(), usedFolders.end(), tempEntrie ) == usedFolders.end()) { - deleteTempFolder(tempEntries[pos]); + deleteTempFolder(tempEntrie); } } } diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index ceb7f9063309..20c48fd5a74b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -783,11 +783,11 @@ static void doc_iniUnoCommands () SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool(pViewFrame); uno::Reference<util::XURLTransformer> xParser(util::URLTransformer::create(xContext)); - for (sal_uInt32 nIterator = 0; nIterator < SAL_N_ELEMENTS(sUnoCommands); nIterator++) + for (const auto & sUnoCommand : sUnoCommands) { const SfxSlot* pSlot = nullptr; - aCommandURL.Complete = sUnoCommands[nIterator]; + aCommandURL.Complete = sUnoCommand; xParser->parseStrict(aCommandURL); pSlot = rSlotPool.GetUnoSlot(aCommandURL.Path); diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index c2f81bcb8b22..b8e933341141 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -241,14 +241,14 @@ bool MigrationImpl::doMigration() const OUString sMenubarResourceURL("private:resource/menubar/menubar"); const OUString sToolbarResourcePre("private:resource/toolbar/"); - for (size_t i=0; i<vModulesInfo.size(); ++i) { - OUString sModuleIdentifier = mapModuleShortNameToIdentifier(vModulesInfo[i].sModuleShortName); + for (MigrationModuleInfo & i : vModulesInfo) { + OUString sModuleIdentifier = mapModuleShortNameToIdentifier(i.sModuleShortName); if (sModuleIdentifier.isEmpty()) continue; uno::Sequence< uno::Any > lArgs(2); OUString aOldCfgDataPath = m_aInfo.userdata + "/user/config/soffice.cfg/modules/"; - lArgs[0] <<= aOldCfgDataPath + vModulesInfo[i].sModuleShortName; + lArgs[0] <<= aOldCfgDataPath + i.sModuleShortName; lArgs[1] <<= embed::ElementModes::READ; uno::Reference< uno::XComponentContext > xContext(comphelper::getProcessComponentContext()); @@ -261,24 +261,24 @@ bool MigrationImpl::doMigration() xOldCfgManager->reload(); } - uno::Reference< ui::XUIConfigurationManager > xCfgManager = aNewVersionUIInfo.getConfigManager(vModulesInfo[i].sModuleShortName); + uno::Reference< ui::XUIConfigurationManager > xCfgManager = aNewVersionUIInfo.getConfigManager(i.sModuleShortName); - if (vModulesInfo[i].bHasMenubar) { + if (i.bHasMenubar) { uno::Reference< container::XIndexContainer > xOldVersionMenuSettings(xOldCfgManager->getSettings(sMenubarResourceURL, true), uno::UNO_QUERY); - uno::Reference< container::XIndexContainer > xNewVersionMenuSettings = aNewVersionUIInfo.getNewMenubarSettings(vModulesInfo[i].sModuleShortName); + uno::Reference< container::XIndexContainer > xNewVersionMenuSettings = aNewVersionUIInfo.getNewMenubarSettings(i.sModuleShortName); OUString sParent; compareOldAndNewConfig(sParent, xOldVersionMenuSettings, xNewVersionMenuSettings, sMenubarResourceURL); mergeOldToNewVersion(xCfgManager, xNewVersionMenuSettings, sModuleIdentifier, sMenubarResourceURL); } - sal_Int32 nToolbars = vModulesInfo[i].m_vToolbars.size(); + sal_Int32 nToolbars = i.m_vToolbars.size(); if (nToolbars >0) { for (sal_Int32 j=0; j<nToolbars; ++j) { - OUString sToolbarName = vModulesInfo[i].m_vToolbars[j]; + OUString sToolbarName = i.m_vToolbars[j]; OUString sToolbarResourceURL = sToolbarResourcePre + sToolbarName; uno::Reference< container::XIndexContainer > xOldVersionToolbarSettings(xOldCfgManager->getSettings(sToolbarResourceURL, true), uno::UNO_QUERY); - uno::Reference< container::XIndexContainer > xNewVersionToolbarSettings = aNewVersionUIInfo.getNewToolbarSettings(vModulesInfo[i].sModuleShortName, sToolbarName); + uno::Reference< container::XIndexContainer > xNewVersionToolbarSettings = aNewVersionUIInfo.getNewToolbarSettings(i.sModuleShortName, sToolbarName); OUString sParent; compareOldAndNewConfig(sParent, xOldVersionToolbarSettings, xNewVersionToolbarSettings, sToolbarResourceURL); mergeOldToNewVersion(xCfgManager, xNewVersionToolbarSettings, sModuleIdentifier, sToolbarResourceURL); diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx index 414df39f06f9..b8b067735f68 100644 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -225,9 +225,9 @@ bool OO3ExtensionMigration::scanDescriptionXml( const OUString& sDescriptionXmlU if ( !aExtIdentifier.isEmpty() ) { // scan extension identifier and try to match with our black list entries - for ( size_t i = 0; i < m_aBlackList.size(); i++ ) + for (OUString & i : m_aBlackList) { - utl::SearchParam param(m_aBlackList[i], utl::SearchParam::SRCH_REGEXP); + utl::SearchParam param(i, utl::SearchParam::SRCH_REGEXP); utl::TextSearch ts(param, LANGUAGE_DONTKNOW); sal_Int32 start = 0; @@ -250,9 +250,9 @@ bool OO3ExtensionMigration::scanDescriptionXml( const OUString& sDescriptionXmlU // Try to use the folder name to match our black list // as some extensions don't provide an identifier in the // description.xml! - for ( size_t i = 0; i < m_aBlackList.size(); i++ ) + for (OUString & i : m_aBlackList) { - utl::SearchParam param(m_aBlackList[i], utl::SearchParam::SRCH_REGEXP); + utl::SearchParam param(i, utl::SearchParam::SRCH_REGEXP); utl::TextSearch ts(param, LANGUAGE_DONTKNOW); sal_Int32 start = 0; diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 93fa127fbba7..822a1b9c4276 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -364,9 +364,8 @@ extern "C" int unopkg_main() if ( subcmd_add || subCommand == "remove" ) { - for ( ::std::size_t pos = 0; pos < cmdPackages.size(); ++pos ) + for (OUString & cmdPackage : cmdPackages) { - OUString const & cmdPackage = cmdPackages[ pos ]; if (subcmd_add) { beans::NamedValue nvSuppress( @@ -449,18 +448,18 @@ extern "C" int unopkg_main() { //The user provided the names (ids or file names) of the extensions //which shall be listed - for ( ::std::size_t pos = 0; pos < cmdPackages.size(); ++pos ) + for (OUString & cmdPackage : cmdPackages) { Reference<deployment::XPackage> extension; try { extension = xExtensionManager->getDeployedExtension( - repository, cmdPackages[ pos ], cmdPackages[ pos ], xCmdEnv ); + repository, cmdPackage, cmdPackage, xCmdEnv ); } catch (const lang::IllegalArgumentException &) { extension = findPackage(repository, - xExtensionManager, xCmdEnv, cmdPackages[ pos ] ); + xExtensionManager, xCmdEnv, cmdPackage ); } //Now look if the requested extension has an unaccepted license @@ -470,7 +469,7 @@ extern "C" int unopkg_main() ::std::vector<Reference<deployment::XPackage> >::const_iterator i = ::std::find_if( vecExtUnaccepted.begin(), - vecExtUnaccepted.end(), ExtensionName(cmdPackages[pos])); + vecExtUnaccepted.end(), ExtensionName(cmdPackage)); if (i != vecExtUnaccepted.end()) { extension = *i; @@ -487,7 +486,7 @@ extern "C" int unopkg_main() else throw lang::IllegalArgumentException( "There is no such extension deployed: " + - cmdPackages[pos],nullptr,-1); + cmdPackage,nullptr,-1); } } @@ -501,18 +500,18 @@ extern "C" int unopkg_main() vecExtUnaccepted, xExtensionManager->getExtensionsWithUnacceptedLicenses( repository, xCmdEnv)); - for ( ::std::size_t pos = 0; pos < cmdPackages.size(); ++pos ) + for (OUString & cmdPackage : cmdPackages) { Reference<deployment::XPackage> extension; try { extension = xExtensionManager->getDeployedExtension( - repository, cmdPackages[ pos ], cmdPackages[ pos ], xCmdEnv ); + repository, cmdPackage, cmdPackage, xCmdEnv ); } catch (const lang::IllegalArgumentException &) { extension = findPackage( - repository, xExtensionManager, xCmdEnv, cmdPackages[ pos ] ); + repository, xExtensionManager, xCmdEnv, cmdPackage ); } if (!extension.is()) @@ -520,7 +519,7 @@ extern "C" int unopkg_main() ::std::vector<Reference<deployment::XPackage> >::const_iterator i = ::std::find_if( vecExtUnaccepted.begin(), - vecExtUnaccepted.end(), ExtensionName(cmdPackages[pos])); + vecExtUnaccepted.end(), ExtensionName(cmdPackage)); if (i != vecExtUnaccepted.end()) { extension = *i; |