diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-02-21 10:02:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-02-21 10:39:38 +0000 |
commit | c2c22a8ca6e04779c4daada73003b03c963b4cfd (patch) | |
tree | 06ff97be57be43698896ac12585871ab4371b04c /dbaccess/source | |
parent | d56b6e0904c276e9a9ea63eb226e6324422c21c8 (diff) |
osl::Mutex->std::mutex in FmXGridPeer
Change-Id: Ib0796a86f864ab0a1a1b99183668f486a8a8f198
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147381
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/ui/browser/sbagrid.cxx | 37 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/sbagrid.hxx | 6 |
2 files changed, 24 insertions, 19 deletions
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 03b81526a372..99ee5c30eb73 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -237,7 +237,6 @@ void SAL_CALL SbaXGridControl::dispose() // SbaXGridPeer SbaXGridPeer::SbaXGridPeer(const Reference< XComponentContext >& _rM) : FmXGridPeer(_rM) -,m_aStatusListeners(m_aMutex) { } @@ -247,10 +246,11 @@ SbaXGridPeer::~SbaXGridPeer() void SAL_CALL SbaXGridPeer::dispose() { - EventObject aEvt(*this); - - m_aStatusListeners.disposeAndClear(aEvt); - + { + std::unique_lock g(m_aMutex); + EventObject aEvt(*this); + m_aStatusListeners.disposeAndClear(g, aEvt); + } FmXGridPeer::dispose(); } @@ -275,12 +275,13 @@ void SbaXGridPeer::NotifyStatusChanged(const css::util::URL& _rUrl, const Refere xControl->statusChanged(aEvt); else { - ::comphelper::OInterfaceContainerHelper3<css::frame::XStatusListener> * pIter - = m_aStatusListeners.getContainer(_rUrl); + std::unique_lock g(m_aMutex); + ::comphelper::OInterfaceContainerHelper4<css::frame::XStatusListener> * pIter + = m_aStatusListeners.getContainer(g, _rUrl); if (pIter) { - pIter->notifyEach( &XStatusListener::statusChanged, aEvt ); + pIter->notifyEach( g, &XStatusListener::statusChanged, aEvt ); } } } @@ -439,20 +440,24 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa void SAL_CALL SbaXGridPeer::addStatusListener(const Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL) { - ::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener >* pCont - = m_aStatusListeners.getContainer(aURL); - if (!pCont) - m_aStatusListeners.addInterface(aURL,xControl); - else - pCont->addInterface(xControl); + { + std::unique_lock g(m_aMutex); + ::comphelper::OInterfaceContainerHelper4< css::frame::XStatusListener >* pCont + = m_aStatusListeners.getContainer(g, aURL); + if (!pCont) + m_aStatusListeners.addInterface(g, aURL,xControl); + else + pCont->addInterface(g, xControl); + } NotifyStatusChanged(aURL, xControl); } void SAL_CALL SbaXGridPeer::removeStatusListener(const Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL) { - ::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener >* pCont = m_aStatusListeners.getContainer(aURL); + std::unique_lock g(m_aMutex); + ::comphelper::OInterfaceContainerHelper4< css::frame::XStatusListener >* pCont = m_aStatusListeners.getContainer(g, aURL); if ( pCont ) - pCont->removeInterface(xControl); + pCont->removeInterface(g, xControl); } Sequence< Type > SAL_CALL SbaXGridPeer::getTypes() diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx index 22af70834425..4c0f37654647 100644 --- a/dbaccess/source/ui/inc/sbagrid.hxx +++ b/dbaccess/source/ui/inc/sbagrid.hxx @@ -25,7 +25,7 @@ #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/util/URL.hpp> -#include <comphelper/multiinterfacecontainer3.hxx> +#include <comphelper/multiinterfacecontainer4.hxx> #include <comphelper/servicehelper.hxx> #include <comphelper/uno3.hxx> #include "sbamultiplex.hxx" @@ -93,8 +93,8 @@ namespace dbaui :public FmXGridPeer ,public css::frame::XDispatch { - comphelper::OMultiTypeInterfaceContainerHelperVar3< css::frame::XStatusListener, - css::util::URL, SbaURLCompare> m_aStatusListeners; + comphelper::OMultiTypeInterfaceContainerHelperVar4< css::util::URL, css::frame::XStatusListener, + SbaURLCompare> m_aStatusListeners; public: SbaXGridPeer(const css::uno::Reference< css::uno::XComponentContext >&); |