diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-03-17 11:59:25 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-03-17 18:30:39 +0100 |
commit | c6994fb815624d31bc2570bdcdc5991fd1195792 (patch) | |
tree | 3a6238330ab8c88ed452526629007c5df1051276 /embedserv | |
parent | a57bda77c3094558e8dae6ecec761ee4b98e5af3 (diff) |
Use for-range loops in embeddedobj, embedserv and formula
Change-Id: I56e1bace8ab8312524e681d3865a1a89d523812d
Reviewed-on: https://gerrit.libreoffice.org/51459
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'embedserv')
-rw-r--r-- | embedserv/source/embed/ed_ioleobject.cxx | 25 | ||||
-rw-r--r-- | embedserv/source/embed/ed_ipersiststr.cxx | 6 |
2 files changed, 12 insertions, 19 deletions
diff --git a/embedserv/source/embed/ed_ioleobject.cxx b/embedserv/source/embed/ed_ioleobject.cxx index 82a39b8b583a..ed1e734b45ac 100644 --- a/embedserv/source/embed/ed_ioleobject.cxx +++ b/embedserv/source/embed/ed_ioleobject.cxx @@ -90,11 +90,10 @@ HRESULT EmbedDocument_Impl::OLENotifyClosing() { AdviseSinkHashMap aAHM(m_aAdviseHashMap); - for ( AdviseSinkHashMapIterator iAdvise = aAHM.begin(); - iAdvise != aAHM.end(); iAdvise++ ) + for (auto const& advise : aAHM) { - if ( iAdvise->second ) - iAdvise->second->OnClose(); + if (advise.second) + advise.second->OnClose(); } return S_OK; @@ -405,12 +404,9 @@ HRESULT EmbedDocument_Impl::SaveObject() if(m_pClientSite) { hr = m_pClientSite->SaveObject(); - for ( AdviseSinkHashMapIterator iAdvise = - m_aAdviseHashMap.begin(); - iAdvise != m_aAdviseHashMap.end(); - iAdvise++ ) - if ( iAdvise->second ) - iAdvise->second->OnSave( ); + for (auto const& advise : m_aAdviseHashMap) + if (advise.second) + advise.second->OnSave(); } else if ( m_aFileName.getLength() && IsDirty() == S_OK ) { @@ -440,12 +436,9 @@ HRESULT EmbedDocument_Impl::ShowObject() void EmbedDocument_Impl::notify( bool bDataChanged ) { - for ( AdviseSinkHashMapIterator iAdvise = - m_aAdviseHashMap.begin(); - iAdvise != m_aAdviseHashMap.end(); - iAdvise++ ) - if ( iAdvise->second ) - iAdvise->second->OnViewChange( DVASPECT_CONTENT, -1 ); + for (auto const& advise : m_aAdviseHashMap) + if (advise.second) + advise.second->OnViewChange( DVASPECT_CONTENT, -1 ); if ( m_pDAdviseHolder && bDataChanged ) m_pDAdviseHolder->SendOnDataChange( static_cast<IDataObject*>(this), 0, 0 ); diff --git a/embedserv/source/embed/ed_ipersiststr.cxx b/embedserv/source/embed/ed_ipersiststr.cxx index 3b817ceb3138..632297274451 100644 --- a/embedserv/source/embed/ed_ipersiststr.cxx +++ b/embedserv/source/embed/ed_ipersiststr.cxx @@ -702,10 +702,10 @@ STDMETHODIMP EmbedDocument_Impl::SaveCompleted( IStorage *pStgNew ) &m_pExtStream ); if ( FAILED( hr ) || !m_pExtStream ) return E_OUTOFMEMORY; - for ( AdviseSinkHashMapIterator iAdvise = m_aAdviseHashMap.begin(); iAdvise != m_aAdviseHashMap.end(); iAdvise++ ) + for (auto const& advise : m_aAdviseHashMap) { - if ( iAdvise->second ) - iAdvise->second->OnSave(); + if ( advise.second ) + advise.second->OnSave(); } return S_OK; |