diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-10-14 20:25:12 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-15 08:00:08 +0200 |
commit | 40ab4d8fda9b69b388ac674c1ee4e88084af9519 (patch) | |
tree | 4e793d89f6e5001cd8f43ead80ffa26a5798ac4e /unoxml/source/dom | |
parent | 9ec8bf8f22fe74884185492ef2576ce79b41e4f1 (diff) |
Simplify containers iterations in unotools, unoxml, uui, vbahelper
Use range-based loop or replace with STL functions.
Change-Id: I5a43f6fc62c81453dcef3820bb715f4da76915af
Reviewed-on: https://gerrit.libreoffice.org/61762
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unoxml/source/dom')
-rw-r--r-- | unoxml/source/dom/document.cxx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 69a15862501a..2ba945fb7efa 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -110,10 +110,9 @@ namespace DOM ::osl::MutexGuard const g(m_Mutex); #ifdef DBG_UTIL // node map must be empty now, otherwise CDocument must not die! - for (nodemap_t::iterator i = m_NodeMap.begin(); - i != m_NodeMap.end(); ++i) + for (const auto& rEntry : m_NodeMap) { - Reference<XNode> const xNode(i->second.first); + Reference<XNode> const xNode(rEntry.second.first); OSL_ENSURE(!xNode.is(), "CDocument::~CDocument(): ERROR: live node in document node map!"); } @@ -377,11 +376,9 @@ namespace DOM } // notify listeners about start - listenerlist_t::const_iterator iter1 = streamListeners.begin(); - while (iter1 != streamListeners.end()) { - Reference< XStreamListener > aListener = *iter1; + for (const auto& rStreamListener : streamListeners) { + Reference< XStreamListener > aListener = rStreamListener; aListener->started(); - ++iter1; } { @@ -398,11 +395,9 @@ namespace DOM } // call listeners - listenerlist_t::const_iterator iter2 = streamListeners.begin(); - while (iter2 != streamListeners.end()) { - Reference< XStreamListener > aListener = *iter2; + for (const auto& rStreamListener : streamListeners) { + Reference< XStreamListener > aListener = rStreamListener; aListener->closed(); - ++iter2; } } |