diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-11-11 08:19:39 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-11-11 09:58:40 +0100 |
commit | d1bf03e40b195ea5b05db33ed9884f291c877572 (patch) | |
tree | 44a5569ab80811d2845d367cdefbaff375bbd9db | |
parent | e1f523a9f6808b895caab266c7eb3b2839b5e4ce (diff) |
Replace list by vector in addinlis (sc)
Change-Id: I38d83b7d611537ae903d7d63d2a04391eece11ae
Reviewed-on: https://gerrit.libreoffice.org/44621
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r-- | sc/source/core/inc/addinlis.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/addinlis.cxx | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/sc/source/core/inc/addinlis.hxx b/sc/source/core/inc/addinlis.hxx index 5c657621eae9..7da698456046 100644 --- a/sc/source/core/inc/addinlis.hxx +++ b/sc/source/core/inc/addinlis.hxx @@ -41,7 +41,7 @@ private: css::uno::Any aResult; std::unique_ptr<ScAddInDocs> pDocs; // documents where this is used - static ::std::list<rtl::Reference<ScAddInListener>> aAllListeners; + static ::std::vector<rtl::Reference<ScAddInListener>> aAllListeners; // always allocated via CreateListener ScAddInListener( css::uno::Reference<css::sheet::XVolatileResult> const & xVR, diff --git a/sc/source/core/tool/addinlis.cxx b/sc/source/core/tool/addinlis.cxx index 211605650f7b..2a56a6ca87f8 100644 --- a/sc/source/core/tool/addinlis.cxx +++ b/sc/source/core/tool/addinlis.cxx @@ -30,7 +30,7 @@ using namespace com::sun::star; SC_SIMPLE_SERVICE_INFO( ScAddInListener, "ScAddInListener", "stardiv.one.sheet.AddInListener" ) -::std::list<rtl::Reference<ScAddInListener>> ScAddInListener::aAllListeners; +::std::vector<rtl::Reference<ScAddInListener>> ScAddInListener::aAllListeners; ScAddInListener* ScAddInListener::CreateListener( const uno::Reference<sheet::XVolatileResult>& xVR, ScDocument* pDoc ) @@ -61,11 +61,11 @@ ScAddInListener* ScAddInListener::Get( const uno::Reference<sheet::XVolatileResu ScAddInListener* pLst = nullptr; sheet::XVolatileResult* pComp = xVR.get(); - for(auto iter = aAllListeners.begin(); iter != aAllListeners.end(); ++iter) + for (auto const& listener : aAllListeners) { - if ( pComp == (*iter)->xVolRes.get() ) + if ( pComp == listener->xVolRes.get() ) { - pLst = iter->get(); + pLst = listener.get(); break; } } @@ -108,9 +108,8 @@ void SAL_CALL ScAddInListener::modified( const css::sheet::ResultEvent& aEvent ) Broadcast( ScHint(SfxHintId::ScDataChanged, ScAddress()) ); - for ( ScAddInDocs::iterator it = pDocs->begin(); it != pDocs->end(); ++it ) + for (auto const& pDoc : *pDocs) { - ScDocument* pDoc = *it; pDoc->TrackFormulas(); pDoc->GetDocumentShell()->Broadcast( SfxHint( SfxHintId::ScDataChanged ) ); } |