summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-21 11:03:55 +0200
committerNoel Grandin <noel@peralex.com>2016-04-21 11:03:55 +0200
commite1af7f0c438bc242e4562aa0286c99787b5ad544 (patch)
tree29c7faa3556f33baa7eae5cd0aca3946afb8a560 /configmgr
parent8762aa986dbca42e61cc8fb1b2c1d2ca66bcfcbe (diff)
clang-tidy modernize-loop-convert in c*
Change-Id: I77d2548f8be97792660761e6156cd24734a95aaf
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/access.cxx60
-rw-r--r--configmgr/source/writemodfile.cxx8
2 files changed, 32 insertions, 36 deletions
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 3506beb7aeb4..8742dcfcb530 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1689,18 +1689,16 @@ void Access::initBroadcasterAndChanges(
assert(broadcaster != nullptr);
std::vector< css::beans::PropertyChangeEvent > propChanges;
bool collectPropChanges = !propertiesChangeListeners_.empty();
- for (Modifications::Node::Children::const_iterator i(
- modifications.children.begin());
- i != modifications.children.end(); ++i)
+ for (const auto & i : modifications.children)
{
- rtl::Reference< ChildAccess > child(getChild(i->first));
+ rtl::Reference< ChildAccess > child(getChild(i.first));
if (child.is()) {
switch (child->getNode()->kind()) {
case Node::KIND_LOCALIZED_PROPERTY:
- if (!i->second.children.empty()) {
+ if (!i.second.children.empty()) {
if (Components::allLocales(getRootAccess()->getLocale())) {
child->initBroadcasterAndChanges(
- i->second, broadcaster, allChanges);
+ i.second, broadcaster, allChanges);
//TODO: if allChanges==0, recurse only into children
// w/ listeners
} else {
@@ -1716,12 +1714,12 @@ void Access::initBroadcasterAndChanges(
css::container::ContainerEvent(
static_cast< cppu::OWeakObject * >(
this),
- css::uno::makeAny(i->first),
+ css::uno::makeAny(i.first),
css::uno::Any(), css::uno::Any()));
//TODO: non-void Element, ReplacedElement
}
PropertyChangeListeners::iterator j(
- propertyChangeListeners_.find(i->first));
+ propertyChangeListeners_.find(i.first));
if (j != propertyChangeListeners_.end()) {
for (PropertyChangeListenersElement::iterator k(
j->second.begin());
@@ -1732,7 +1730,7 @@ void Access::initBroadcasterAndChanges(
css::beans::PropertyChangeEvent(
static_cast< cppu::OWeakObject * >(
this),
- i->first, false, -1, css::uno::Any(),
+ i.first, false, -1, css::uno::Any(),
css::uno::Any()));
}
}
@@ -1747,7 +1745,7 @@ void Access::initBroadcasterAndChanges(
css::beans::PropertyChangeEvent(
static_cast< cppu::OWeakObject * >(
this),
- i->first, false, -1, css::uno::Any(),
+ i.first, false, -1, css::uno::Any(),
css::uno::Any()));
}
}
@@ -1763,7 +1761,7 @@ void Access::initBroadcasterAndChanges(
propChanges.push_back(
css::beans::PropertyChangeEvent(
static_cast< cppu::OWeakObject * >(this),
- i->first, false, -1, css::uno::Any(),
+ i.first, false, -1, css::uno::Any(),
css::uno::Any()));
}
}
@@ -1780,7 +1778,7 @@ void Access::initBroadcasterAndChanges(
*j,
css::container::ContainerEvent(
static_cast< cppu::OWeakObject * >(this),
- css::uno::makeAny(i->first), child->asValue(),
+ css::uno::makeAny(i.first), child->asValue(),
css::uno::Any()));
//TODO: distinguish add/modify; non-void ReplacedElement
}
@@ -1804,13 +1802,13 @@ void Access::initBroadcasterAndChanges(
*j,
css::container::ContainerEvent(
static_cast< cppu::OWeakObject * >(this),
- css::uno::makeAny(i->first), child->asValue(),
+ css::uno::makeAny(i.first), child->asValue(),
css::uno::Any()));
//TODO: distinguish add/remove/modify; non-void
// ReplacedElement
}
PropertyChangeListeners::iterator j(
- propertyChangeListeners_.find(i->first));
+ propertyChangeListeners_.find(i.first));
if (j != propertyChangeListeners_.end()) {
for (PropertyChangeListenersElement::iterator k(
j->second.begin());
@@ -1820,7 +1818,7 @@ void Access::initBroadcasterAndChanges(
*k,
css::beans::PropertyChangeEvent(
static_cast< cppu::OWeakObject * >(this),
- i->first, false, -1, css::uno::Any(),
+ i.first, false, -1, css::uno::Any(),
css::uno::Any()));
}
}
@@ -1834,7 +1832,7 @@ void Access::initBroadcasterAndChanges(
*k,
css::beans::PropertyChangeEvent(
static_cast< cppu::OWeakObject * >(this),
- i->first, false, -1, css::uno::Any(),
+ i.first, false, -1, css::uno::Any(),
css::uno::Any()));
}
}
@@ -1850,14 +1848,14 @@ void Access::initBroadcasterAndChanges(
propChanges.push_back(
css::beans::PropertyChangeEvent(
static_cast< cppu::OWeakObject * >(this),
- i->first, false, -1, css::uno::Any(),
+ i.first, false, -1, css::uno::Any(),
css::uno::Any()));
}
}
break;
case Node::KIND_GROUP:
case Node::KIND_SET:
- if (i->second.children.empty()) {
+ if (i.second.children.empty()) {
if (!child->getNode()->getTemplateName().isEmpty()) {
for (ContainerListeners::iterator j(
containerListeners_.begin());
@@ -1869,7 +1867,7 @@ void Access::initBroadcasterAndChanges(
css::container::ContainerEvent(
static_cast< cppu::OWeakObject * >(
this),
- css::uno::makeAny(i->first),
+ css::uno::makeAny(i.first),
child->asValue(), css::uno::Any()));
}
if (allChanges != nullptr) {
@@ -1885,7 +1883,7 @@ void Access::initBroadcasterAndChanges(
// change
} else {
child->initBroadcasterAndChanges(
- i->second, broadcaster, allChanges);
+ i.second, broadcaster, allChanges);
//TODO: if allChanges==0, recurse only into children w/
// listeners
}
@@ -1907,7 +1905,7 @@ void Access::initBroadcasterAndChanges(
*j,
css::container::ContainerEvent(
static_cast< cppu::OWeakObject * >(this),
- css::uno::makeAny(i->first), css::uno::Any(),
+ css::uno::makeAny(i.first), css::uno::Any(),
css::uno::Any()));
//TODO: non-void ReplacedElement
}
@@ -1916,7 +1914,7 @@ void Access::initBroadcasterAndChanges(
if (!path.isEmpty()) {
path.append('/');
}
- path.append(Data::createSegment("*", i->first));
+ path.append(Data::createSegment("*", i.first));
allChanges->push_back(
css::util::ElementChange(
css::uno::makeAny(path.makeStringAndClear()),
@@ -1936,12 +1934,12 @@ void Access::initBroadcasterAndChanges(
*j,
css::container::ContainerEvent(
static_cast< cppu::OWeakObject * >(this),
- css::uno::makeAny(i->first), css::uno::Any(),
+ css::uno::makeAny(i.first), css::uno::Any(),
css::uno::Any()));
//TODO: non-void ReplacedElement
}
PropertyChangeListeners::iterator j(
- propertyChangeListeners_.find(i->first));
+ propertyChangeListeners_.find(i.first));
if (j != propertyChangeListeners_.end()) {
for (PropertyChangeListenersElement::iterator k(
j->second.begin());
@@ -1951,7 +1949,7 @@ void Access::initBroadcasterAndChanges(
*k,
css::beans::PropertyChangeEvent(
static_cast< cppu::OWeakObject * >(this),
- i->first, false, -1, css::uno::Any(),
+ i.first, false, -1, css::uno::Any(),
css::uno::Any()));
}
}
@@ -1965,7 +1963,7 @@ void Access::initBroadcasterAndChanges(
*k,
css::beans::PropertyChangeEvent(
static_cast< cppu::OWeakObject * >(this),
- i->first, false, -1, css::uno::Any(),
+ i.first, false, -1, css::uno::Any(),
css::uno::Any()));
}
}
@@ -1975,7 +1973,7 @@ void Access::initBroadcasterAndChanges(
if (!path.isEmpty()) {
path.append('/');
}
- path.append(i->first);
+ path.append(i.first);
allChanges->push_back(
css::util::ElementChange(
css::uno::makeAny(path.makeStringAndClear()),
@@ -1986,14 +1984,14 @@ void Access::initBroadcasterAndChanges(
propChanges.push_back(
css::beans::PropertyChangeEvent(
static_cast< cppu::OWeakObject * >(this),
- i->first, false, -1, css::uno::Any(),
+ i.first, false, -1, css::uno::Any(),
css::uno::Any()));
}
}
break;
case Node::KIND_SET:
// Removed set member:
- if (i->second.children.empty()) {
+ if (i.second.children.empty()) {
for (ContainerListeners::iterator j(
containerListeners_.begin());
j != containerListeners_.end(); ++j)
@@ -2002,7 +2000,7 @@ void Access::initBroadcasterAndChanges(
*j,
css::container::ContainerEvent(
static_cast< cppu::OWeakObject * >(this),
- css::uno::makeAny(i->first),
+ css::uno::makeAny(i.first),
css::uno::Any(), css::uno::Any()));
//TODO: non-void ReplacedElement
}
@@ -2012,7 +2010,7 @@ void Access::initBroadcasterAndChanges(
if (!path.isEmpty()) {
path.append('/');
}
- path.append(Data::createSegment("*", i->first));
+ path.append(Data::createSegment("*", i.first));
allChanges->push_back(
css::util::ElementChange(
css::uno::makeAny(path.makeStringAndClear()),
diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx
index d04818ecae88..1d20c189c462 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -459,13 +459,11 @@ void writeModifications(
OUString pathRep(
parentPathRepresentation + "/" +
Data::createSegment(node->getTemplateName(), nodeName));
- for (Modifications::Node::Children::const_iterator i(
- modifications.children.begin());
- i != modifications.children.end(); ++i)
+ for (const auto & i : modifications.children)
{
writeModifications(
- components, handle, pathRep, node, i->first,
- node->getMember(i->first), i->second);
+ components, handle, pathRep, node, i.first,
+ node->getMember(i.first), i.second);
}
}
}