diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-03-17 21:42:27 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-03-17 23:08:48 +0100 |
commit | 823ef9ef3238efd92895254e0f8042ff1e543bb6 (patch) | |
tree | 08d58131644869f46319b246b919a33bbf64f46e /framework/source/dispatch | |
parent | b9cf7da2907f759c98b801939e7c04cf0b80388f (diff) |
Use for-range loops in framework
Change-Id: I72ea832848fd7c76863bcee70a3303de488c0b0f
Reviewed-on: https://gerrit.libreoffice.org/51471
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'framework/source/dispatch')
-rw-r--r-- | framework/source/dispatch/dispatchdisabler.cxx | 4 | ||||
-rw-r--r-- | framework/source/dispatch/interceptionhelper.cxx | 19 |
2 files changed, 9 insertions, 14 deletions
diff --git a/framework/source/dispatch/dispatchdisabler.cxx b/framework/source/dispatch/dispatchdisabler.cxx index 9fa3f99b3d30..b847031bf742 100644 --- a/framework/source/dispatch/dispatchdisabler.cxx +++ b/framework/source/dispatch/dispatchdisabler.cxx @@ -87,8 +87,8 @@ uno::Sequence< OUString > SAL_CALL { uno::Sequence< OUString > aDisabledURLs(maDisabledURLs.size()); sal_Int32 n = 0; - for (auto i = maDisabledURLs.begin(); i != maDisabledURLs.end(); ++i) - aDisabledURLs[n++] = *i; + for (auto const& disabledURL : maDisabledURLs) + aDisabledURLs[n++] = disabledURL; return aDisabledURLs; } diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index 8e478f2dc101..819e96475393 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -54,13 +54,12 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD // Find first interceptor w/o pattern, so we need to query it if (!xInterceptor.is() && m_lInterceptionRegs.size()>0) { - InterceptorList::const_iterator pIt2; - for (pIt2=m_lInterceptionRegs.begin(); pIt2!=m_lInterceptionRegs.end(); ++pIt2) + for (auto const& lInterceptionReg : m_lInterceptionRegs) { - if (!pIt2->lURLPattern.getLength()) + if (!lInterceptionReg.lURLPattern.getLength()) { // no pattern -> need to ask this guy! - xInterceptor = pIt2->xInterceptor; + xInterceptor = lInterceptionReg.xInterceptor; break; } } @@ -229,17 +228,13 @@ void SAL_CALL InterceptionHelper::disposing(const css::lang::EventObject& aEvent aReadLock.clear(); // <- SAFE - InterceptionHelper::InterceptorList::iterator pIt; - for ( pIt = aCopy.begin(); - pIt != aCopy.end(); - ++pIt ) + for (auto & elem : aCopy) { - InterceptionHelper::InterceptorInfo& rInfo = *pIt; - if (rInfo.xInterceptor.is()) + if (elem.xInterceptor.is()) { - css::uno::Reference< css::frame::XDispatchProviderInterceptor > xInterceptor(rInfo.xInterceptor, css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::frame::XDispatchProviderInterceptor > xInterceptor(elem.xInterceptor, css::uno::UNO_QUERY_THROW); releaseDispatchProviderInterceptor(xInterceptor); - rInfo.xInterceptor.clear(); + elem.xInterceptor.clear(); } } |