summaryrefslogtreecommitdiff
path: root/cli_ure
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-03-10 21:51:45 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-03-12 16:10:01 +0100
commit95a538180fd21c52b752cbef46acf2aa2b842ab8 (patch)
tree6b248190da44e68400fbd663dbb17d5fd6c4223d /cli_ure
parentf9b354784faf65ecc8024cf6d7d7aaf589f6d91f (diff)
Simplify containers iterations in chart2, cli_ure, comphelper, configmgr
Use range-based loop or replace with STL functions Change-Id: I7c229faa96e08b76cb4f182a1bd77c15bac4ba76 Reviewed-on: https://gerrit.libreoffice.org/69010 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cli_ure')
-rw-r--r--cli_ure/source/climaker/climaker_app.cxx26
1 files changed, 8 insertions, 18 deletions
diff --git a/cli_ure/source/climaker/climaker_app.cxx b/cli_ure/source/climaker/climaker_app.cxx
index b268726b4db3..97b1a5ce9bce 100644
--- a/cli_ure/source/climaker/climaker_app.cxx
+++ b/cli_ure/source/climaker/climaker_app.cxx
@@ -393,17 +393,15 @@ SAL_IMPLEMENT_MAIN()
css::uno::Reference< container::XSet > xSet( xTDmgr, UNO_QUERY_THROW );
rtl::Reference unoidlMgr(new unoidl::Manager);
std::vector< rtl::Reference< unoidl::Provider > > unoidlMandatoryProvs;
- for (vector< OUString >::iterator i(extra_registries.begin());
- i != extra_registries.end(); ++i)
+ for (auto& rRegistry : extra_registries)
{
- xSet->insert(makeAny(*i));
- unoidlMgr->addProvider(*i);
+ xSet->insert(makeAny(rRegistry));
+ unoidlMgr->addProvider(rRegistry);
}
- for (vector< OUString >::iterator i(mandatory_registries.begin());
- i != mandatory_registries.end(); ++i)
+ for (auto& rRegistry : mandatory_registries)
{
- xSet->insert(makeAny(*i));
- rtl::Reference< unoidl::Provider > prov(unoidlMgr->addProvider(*i));
+ xSet->insert(makeAny(rRegistry));
+ rtl::Reference< unoidl::Provider > prov(unoidlMgr->addProvider(rRegistry));
unoidlMandatoryProvs.push_back(prov);
}
@@ -586,16 +584,8 @@ SAL_IMPLEMENT_MAIN()
css::uno::Reference< reflection::XTypeDescription > td(
xTD_enum->nextTypeDescription());
OUString name(td->getName());
- bool bEmit = false;
- for (std::vector< rtl::Reference< unoidl::Provider > >::iterator
- i(unoidlMandatoryProvs.begin());
- i != unoidlMandatoryProvs.end(); ++i)
- {
- if ((*i)->findEntity(name).is()) {
- bEmit = true;
- break;
- }
- }
+ bool bEmit = std::any_of(unoidlMandatoryProvs.begin(), unoidlMandatoryProvs.end(),
+ [&name](rtl::Reference<unoidl::Provider>& rProv) { return rProv->findEntity(name).is(); });
if (bEmit) {
type_emitter->get_type(td);
}