diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-02-14 10:26:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-02-14 14:24:44 +0000 |
commit | 93059e2b164bd5eea4898519e45f1001f299c4ae (patch) | |
tree | 71d6264fe3d415bfd3ac1eccf72c3d8056b93bd9 /sc/source/ui/unoobj | |
parent | ce0b9f3eb3f57f57a2315e099a0093c33987e6ca (diff) |
osl::Mutex->std::mutex in ScCellFieldsObj
Change-Id: I7e9a95d093573d786b97f79f9f3b1f18c424fd8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146973
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r-- | sc/source/ui/unoobj/fielduno.cxx | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index afc27560c1fe..2a05a24fab75 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -276,21 +276,24 @@ ScCellFieldsObj::ScCellFieldsObj( ScCellFieldsObj::~ScCellFieldsObj() { - SolarMutexGuard g; + { + SolarMutexGuard g; - if (pDocShell) - pDocShell->GetDocument().RemoveUnoObject(*this); + if (pDocShell) + pDocShell->GetDocument().RemoveUnoObject(*this); - mpEditSource.reset(); + mpEditSource.reset(); + } // increment refcount to prevent double call off dtor osl_atomic_increment( &m_refCount ); + std::unique_lock g(aMutex); if (mpRefreshListeners) { lang::EventObject aEvent; aEvent.Source.set(static_cast<cppu::OWeakObject*>(this)); - mpRefreshListeners->disposeAndClear(aEvent); + mpRefreshListeners->disposeAndClear(g, aEvent); mpRefreshListeners.reset(); } } @@ -383,12 +386,13 @@ void SAL_CALL ScCellFieldsObj::removeContainerListener( // XRefreshable void SAL_CALL ScCellFieldsObj::refresh( ) { + std::unique_lock g(aMutex); if (mpRefreshListeners) { // Call all listeners. lang::EventObject aEvent; aEvent.Source.set(uno::Reference< util::XRefreshable >(this)); - mpRefreshListeners->notifyEach( &util::XRefreshListener::refreshed, aEvent ); + mpRefreshListeners->notifyEach( g, &util::XRefreshListener::refreshed, aEvent ); } } @@ -396,10 +400,10 @@ void SAL_CALL ScCellFieldsObj::addRefreshListener( const uno::Reference< util::X { if (xListener.is()) { - SolarMutexGuard aGuard; + std::unique_lock g(aMutex); if (!mpRefreshListeners) - mpRefreshListeners.reset( new comphelper::OInterfaceContainerHelper3<util::XRefreshListener>(aMutex) ); - mpRefreshListeners->addInterface(xListener); + mpRefreshListeners.reset( new comphelper::OInterfaceContainerHelper4<util::XRefreshListener>() ); + mpRefreshListeners->addInterface(g, xListener); } } @@ -407,9 +411,9 @@ void SAL_CALL ScCellFieldsObj::removeRefreshListener( const uno::Reference<util: { if (xListener.is()) { - SolarMutexGuard aGuard; + std::unique_lock g(aMutex); if (mpRefreshListeners) - mpRefreshListeners->removeInterface(xListener); + mpRefreshListeners->removeInterface(g, xListener); } } |