summaryrefslogtreecommitdiff
path: root/configmgr
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 /configmgr
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 'configmgr')
-rw-r--r--configmgr/source/broadcaster.cxx40
1 files changed, 14 insertions, 26 deletions
diff --git a/configmgr/source/broadcaster.cxx b/configmgr/source/broadcaster.cxx
index 06e502ade75b..206b6366f3f3 100644
--- a/configmgr/source/broadcaster.cxx
+++ b/configmgr/source/broadcaster.cxx
@@ -106,80 +106,68 @@ void Broadcaster::addChangesNotification(
void Broadcaster::send() {
css::uno::Any exception;
OUStringBuffer messages;
- for (DisposeNotifications::iterator i(disposeNotifications_.begin());
- i != disposeNotifications_.end(); ++i) {
+ for (auto& rNotification : disposeNotifications_) {
try {
- i->listener->disposing(i->event);
+ rNotification.listener->disposing(rNotification.event);
} catch (css::lang::DisposedException &) {
} catch (css::uno::Exception & e) {
exception = cppu::getCaughtException();
appendMessage(messages, e);
}
}
- for (ContainerNotifications::iterator i(
- containerElementInsertedNotifications_.begin());
- i != containerElementInsertedNotifications_.end(); ++i)
+ for (auto& rNotification : containerElementInsertedNotifications_)
{
try {
- i->listener->elementInserted(i->event);
+ rNotification.listener->elementInserted(rNotification.event);
} catch (css::lang::DisposedException &) {
} catch (css::uno::Exception & e) {
exception = cppu::getCaughtException();
appendMessage(messages, e);
}
}
- for (ContainerNotifications::iterator i(
- containerElementRemovedNotifications_.begin());
- i != containerElementRemovedNotifications_.end(); ++i)
+ for (auto& rNotification : containerElementRemovedNotifications_)
{
try {
- i->listener->elementRemoved(i->event);
+ rNotification.listener->elementRemoved(rNotification.event);
} catch (css::lang::DisposedException &) {
} catch (css::uno::Exception & e) {
exception = cppu::getCaughtException();
appendMessage(messages, e);
}
}
- for (ContainerNotifications::iterator i(
- containerElementReplacedNotifications_.begin());
- i != containerElementReplacedNotifications_.end(); ++i)
+ for (auto& rNotification : containerElementReplacedNotifications_)
{
try {
- i->listener->elementReplaced(i->event);
+ rNotification.listener->elementReplaced(rNotification.event);
} catch (css::lang::DisposedException &) {
} catch (css::uno::Exception & e) {
exception = cppu::getCaughtException();
appendMessage(messages, e);
}
}
- for (PropertyChangeNotifications::iterator i(
- propertyChangeNotifications_.begin());
- i != propertyChangeNotifications_.end(); ++i)
+ for (auto& rNotification : propertyChangeNotifications_)
{
try {
- i->listener->propertyChange(i->event);
+ rNotification.listener->propertyChange(rNotification.event);
} catch (css::lang::DisposedException &) {
} catch (css::uno::Exception & e) {
exception = cppu::getCaughtException();
appendMessage(messages, e);
}
}
- for (PropertiesChangeNotifications::iterator i(
- propertiesChangeNotifications_.begin());
- i != propertiesChangeNotifications_.end(); ++i)
+ for (auto& rNotification : propertiesChangeNotifications_)
{
try {
- i->listener->propertiesChange(i->event);
+ rNotification.listener->propertiesChange(rNotification.event);
} catch (css::lang::DisposedException &) {
} catch (css::uno::Exception & e) {
exception = cppu::getCaughtException();
appendMessage(messages, e);
}
}
- for (ChangesNotifications::iterator i(changesNotifications_.begin());
- i != changesNotifications_.end(); ++i) {
+ for (auto& rNotification : changesNotifications_) {
try {
- i->listener->changesOccurred(i->event);
+ rNotification.listener->changesOccurred(rNotification.event);
} catch (css::lang::DisposedException &) {
} catch (css::uno::Exception & e) {
exception = cppu::getCaughtException();