summaryrefslogtreecommitdiff
path: root/svl/source/notify
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2016-03-29 21:36:59 +0200
committerJulien Nabet <serval2412@yahoo.fr>2016-03-30 05:06:21 +0000
commita0527676b17838c310701f169ce23d0386b82eb6 (patch)
tree55f06881249f196372d399dc49c0e47d0552ed3d /svl/source/notify
parent1d060568ce8e7b8aa04c418e282962131801bea4 (diff)
Use const_iterator when possible (svl except svdde)
Change-Id: Ie19467a020d1839146d5a6324e54ccf223d99dd6 Reviewed-on: https://gerrit.libreoffice.org/23603 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'svl/source/notify')
-rw-r--r--svl/source/notify/broadcast.cxx6
-rw-r--r--svl/source/notify/listener.cxx6
2 files changed, 7 insertions, 5 deletions
diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx
index b7415ad39006..2a9338ca787e 100644
--- a/svl/source/notify/broadcast.cxx
+++ b/svl/source/notify/broadcast.cxx
@@ -79,7 +79,7 @@ SvtBroadcaster::SvtBroadcaster( const SvtBroadcaster &rBC ) :
if (mbAboutToDie)
Normalize();
- ListenersType::iterator dest(maDestructedListeners.begin());
+ ListenersType::const_iterator dest(maDestructedListeners.begin());
for (ListenersType::iterator it(maListeners.begin()); it != maListeners.end(); ++it)
{
bool bStart = true;
@@ -108,7 +108,7 @@ SvtBroadcaster::~SvtBroadcaster()
// now when both lists are sorted, we can linearly unregister all
// listeners, with the exception of those that already asked to be removed
// during their own destruction
- ListenersType::iterator dest(maDestructedListeners.begin());
+ ListenersType::const_iterator dest(maDestructedListeners.begin());
for (ListenersType::iterator it(maListeners.begin()); it != maListeners.end(); ++it)
{
// skip the destructed ones
@@ -124,7 +124,7 @@ void SvtBroadcaster::Broadcast( const SfxHint &rHint )
{
Normalize();
- ListenersType::iterator dest(maDestructedListeners.begin());
+ ListenersType::const_iterator dest(maDestructedListeners.begin());
ListenersType aListeners(maListeners); // this copy is important to avoid erasing entries while iterating
for (ListenersType::iterator it(aListeners.begin()); it != aListeners.end(); ++it)
{
diff --git a/svl/source/notify/listener.cxx b/svl/source/notify/listener.cxx
index 52adeb948de9..e1f193cb3753 100644
--- a/svl/source/notify/listener.cxx
+++ b/svl/source/notify/listener.cxx
@@ -67,7 +67,8 @@ bool SvtListener::EndListening( SvtBroadcaster& rBroadcaster )
void SvtListener::EndListeningAll()
{
- BroadcastersType::iterator it = maBroadcasters.begin(), itEnd = maBroadcasters.end();
+ BroadcastersType::iterator it = maBroadcasters.begin();
+ BroadcastersType::const_iterator itEnd = maBroadcasters.end();
for (; it != itEnd; ++it)
{
SvtBroadcaster& rBC = **it;
@@ -81,7 +82,8 @@ void SvtListener::CopyAllBroadcasters( const SvtListener& r )
{
BroadcastersType aCopy(r.maBroadcasters);
maBroadcasters.swap(aCopy);
- BroadcastersType::iterator it = maBroadcasters.begin(), itEnd = maBroadcasters.end();
+ BroadcastersType::iterator it = maBroadcasters.begin();
+ BroadcastersType::const_iterator itEnd = maBroadcasters.end();
for (; it != itEnd; ++it)
{
SvtBroadcaster* p = *it;