diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/unocore/unobkm.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unochart.cxx | 23 | ||||
-rw-r--r-- | sw/source/core/unocore/unofield.cxx | 37 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/unocore/unoftn.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unoidx.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unoparagraph.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unorefmk.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/unocore/unosect.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 32 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 8 |
11 files changed, 67 insertions, 69 deletions
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 347038a09ba0..b5577df6ecde 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -301,7 +301,7 @@ void SAL_CALL SwXBookmark::addEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.addInterface(xListener); + m_pImpl->m_EventListeners.addInterface(aGuard, xListener); } void SAL_CALL SwXBookmark::removeEventListener( @@ -309,7 +309,7 @@ void SAL_CALL SwXBookmark::removeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.removeInterface(xListener); + m_pImpl->m_EventListeners.removeInterface(aGuard, xListener); } OUString SAL_CALL SwXBookmark::getName() diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index d1bc07765758..b32a0dc35b80 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -160,7 +160,8 @@ static void LaunchModifiedEvent( const uno::Reference< uno::XInterface > &rxI ) { lang::EventObject aEvtObj( rxI ); - rICH.notifyEach( &util::XModifyListener::modified, aEvtObj ); + std::unique_lock aGuard(GetChartMutex()); + rICH.notifyEach( aGuard, &util::XModifyListener::modified, aEvtObj ); } /** @@ -1383,7 +1384,7 @@ void SAL_CALL SwChartDataProvider::addEventListener( { std::unique_lock aGuard( GetChartMutex() ); if (!m_bDisposed && rxListener.is()) - m_aEventListeners.addInterface( rxListener ); + m_aEventListeners.addInterface( aGuard, rxListener ); } void SAL_CALL SwChartDataProvider::removeEventListener( @@ -1391,7 +1392,7 @@ void SAL_CALL SwChartDataProvider::removeEventListener( { std::unique_lock aGuard( GetChartMutex() ); if (!m_bDisposed && rxListener.is()) - m_aEventListeners.removeInterface( rxListener ); + m_aEventListeners.removeInterface( aGuard, rxListener ); } OUString SAL_CALL SwChartDataProvider::getImplementationName( ) @@ -2191,7 +2192,7 @@ void SAL_CALL SwChartDataSequence::addModifyListener( { std::unique_lock aGuard( GetChartMutex() ); if (!m_bDisposed && rxListener.is()) - m_aModifyListeners.addInterface( rxListener ); + m_aModifyListeners.addInterface( aGuard, rxListener ); } void SAL_CALL SwChartDataSequence::removeModifyListener( @@ -2199,7 +2200,7 @@ void SAL_CALL SwChartDataSequence::removeModifyListener( { std::unique_lock aGuard( GetChartMutex() ); if (!m_bDisposed && rxListener.is()) - m_aModifyListeners.removeInterface( rxListener ); + m_aModifyListeners.removeInterface( aGuard, rxListener ); } void SAL_CALL SwChartDataSequence::disposing( const lang::EventObject& rSource ) @@ -2274,7 +2275,7 @@ void SAL_CALL SwChartDataSequence::addEventListener( { std::unique_lock aGuard( GetChartMutex() ); if (!m_bDisposed && rxListener.is()) - m_aEvtListeners.addInterface( rxListener ); + m_aEvtListeners.addInterface( aGuard, rxListener ); } void SAL_CALL SwChartDataSequence::removeEventListener( @@ -2282,7 +2283,7 @@ void SAL_CALL SwChartDataSequence::removeEventListener( { std::unique_lock aGuard( GetChartMutex() ); if (!m_bDisposed && rxListener.is()) - m_aEvtListeners.removeInterface( rxListener ); + m_aEvtListeners.removeInterface( aGuard, rxListener ); } bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox ) @@ -2652,7 +2653,7 @@ void SAL_CALL SwChartLabeledDataSequence::addModifyListener( { std::unique_lock aGuard( GetChartMutex() ); if (!m_bDisposed && rxListener.is()) - m_aModifyListeners.addInterface( rxListener ); + m_aModifyListeners.addInterface( aGuard, rxListener ); } void SAL_CALL SwChartLabeledDataSequence::removeModifyListener( @@ -2660,7 +2661,7 @@ void SAL_CALL SwChartLabeledDataSequence::removeModifyListener( { std::unique_lock aGuard( GetChartMutex() ); if (!m_bDisposed && rxListener.is()) - m_aModifyListeners.removeInterface( rxListener ); + m_aModifyListeners.removeInterface( aGuard, rxListener ); } void SAL_CALL SwChartLabeledDataSequence::dispose( ) @@ -2690,7 +2691,7 @@ void SAL_CALL SwChartLabeledDataSequence::addEventListener( { std::unique_lock aGuard( GetChartMutex() ); if (!m_bDisposed && rxListener.is()) - m_aEventListeners.addInterface( rxListener ); + m_aEventListeners.addInterface( aGuard, rxListener ); } void SAL_CALL SwChartLabeledDataSequence::removeEventListener( @@ -2698,7 +2699,7 @@ void SAL_CALL SwChartLabeledDataSequence::removeEventListener( { std::unique_lock aGuard( GetChartMutex() ); if (!m_bDisposed && rxListener.is()) - m_aEventListeners.removeInterface( rxListener ); + m_aEventListeners.removeInterface( aGuard, rxListener ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 717776dbc6f0..703eb3e1f2a5 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -404,10 +404,9 @@ static sal_uInt16 lcl_GetPropertyMapOfService( SwServiceType nServiceId ) class SwXFieldMaster::Impl : public SvtListener { -private: - std::mutex m_Mutex; // just for OInterfaceContainerHelper3 - public: + std::mutex m_Mutex; // just for OInterfaceContainerHelper4 + uno::WeakReference<uno::XInterface> m_wThis; ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_EventListeners; @@ -970,15 +969,15 @@ void SAL_CALL SwXFieldMaster::dispose() void SAL_CALL SwXFieldMaster::addEventListener( const uno::Reference<lang::XEventListener> & xListener) { - // no need to lock here as m_pImpl is const and container threadsafe - m_pImpl->m_EventListeners.addInterface(xListener); + std::unique_lock aGuard(m_pImpl->m_Mutex); + m_pImpl->m_EventListeners.addInterface(aGuard, xListener); } void SAL_CALL SwXFieldMaster::removeEventListener( const uno::Reference<lang::XEventListener> & xListener) { - // no need to lock here as m_pImpl is const and container threadsafe - m_pImpl->m_EventListeners.removeInterface(xListener); + std::unique_lock aGuard(m_pImpl->m_Mutex); + m_pImpl->m_EventListeners.removeInterface(aGuard, xListener); } void SwXFieldMaster::Impl::Notify(const SfxHint& rHint) @@ -1083,12 +1082,11 @@ struct SwFieldProperties_Impl class SwXTextField::Impl : public SvtListener { -private: - std::mutex m_Mutex; // just for OInterfaceContainerHelper3 +public: + std::mutex m_Mutex; // just for OInterfaceContainerHelper4 SwFieldType* m_pFieldType; SwFormatField* m_pFormatField; -public: uno::WeakReference<uno::XInterface> m_wThis; ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_EventListeners; @@ -2112,15 +2110,15 @@ void SAL_CALL SwXTextField::dispose() void SAL_CALL SwXTextField::addEventListener( const uno::Reference<lang::XEventListener> & xListener) { - // no need to lock here as m_pImpl is const and container threadsafe - m_pImpl->m_EventListeners.addInterface(xListener); + std::unique_lock aGuard(m_pImpl->m_Mutex); + m_pImpl->m_EventListeners.addInterface(aGuard, xListener); } void SAL_CALL SwXTextField::removeEventListener( const uno::Reference<lang::XEventListener> & xListener) { - // no need to lock here as m_pImpl is const and container threadsafe - m_pImpl->m_EventListeners.removeInterface(xListener); + std::unique_lock aGuard(m_pImpl->m_Mutex); + m_pImpl->m_EventListeners.removeInterface(aGuard, xListener); } uno::Reference< beans::XPropertySetInfo > SAL_CALL @@ -2898,22 +2896,23 @@ void SAL_CALL SwXTextFieldTypes::refresh() } // call refresh listeners (without SolarMutex locked) lang::EventObject const event(static_cast< ::cppu::OWeakObject*>(this)); - m_pImpl->m_RefreshListeners.notifyEach( + std::unique_lock aGuard(m_pImpl->m_Mutex); + m_pImpl->m_RefreshListeners.notifyEach(aGuard, & util::XRefreshListener::refreshed, event); } void SAL_CALL SwXTextFieldTypes::addRefreshListener( const uno::Reference<util::XRefreshListener> & xListener) { - // no need to lock here as m_pImpl is const and container threadsafe - m_pImpl->m_RefreshListeners.addInterface(xListener); + std::unique_lock aGuard(m_pImpl->m_Mutex); + m_pImpl->m_RefreshListeners.addInterface(aGuard, xListener); } void SAL_CALL SwXTextFieldTypes::removeRefreshListener( const uno::Reference<util::XRefreshListener> & xListener) { - // no need to lock here as m_pImpl is const and container threadsafe - m_pImpl->m_RefreshListeners.removeInterface(xListener); + std::unique_lock aGuard(m_pImpl->m_Mutex); + m_pImpl->m_RefreshListeners.removeInterface(aGuard, xListener); } class SwXFieldEnumeration::Impl diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 73f713b438aa..5ba3ecf98f8e 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2598,15 +2598,15 @@ uno::Any SwXFrame::getPropertyDefault( const OUString& rPropertyName ) void SAL_CALL SwXFrame::addEventListener( const uno::Reference<lang::XEventListener> & xListener) { - // no need to lock here as m_pImpl is const and container threadsafe - m_pImpl->m_EventListeners.addInterface(xListener); + std::unique_lock aGuard(m_pImpl->m_Mutex); + m_pImpl->m_EventListeners.addInterface(aGuard, xListener); } void SAL_CALL SwXFrame::removeEventListener( const uno::Reference<lang::XEventListener> & xListener) { - // no need to lock here as m_pImpl is const and container threadsafe - m_pImpl->m_EventListeners.removeInterface(xListener); + std::unique_lock aGuard(m_pImpl->m_Mutex); + m_pImpl->m_EventListeners.removeInterface(aGuard, xListener); } void SwXFrame::DisposeInternal() diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 82c7f2555243..ca012bbb03e5 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -378,7 +378,7 @@ SwXFootnote::addEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.addInterface(xListener); + m_pImpl->m_EventListeners.addInterface(aGuard, xListener); } void SAL_CALL @@ -387,7 +387,7 @@ SwXFootnote::removeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.removeInterface(xListener); + m_pImpl->m_EventListeners.removeInterface(aGuard, xListener); } const SwStartNode *SwXFootnote::GetStartNode() const diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index e4276a618410..98eb107977be 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1990,7 +1990,7 @@ SwXDocumentIndexMark::addEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.addInterface(xListener); + m_pImpl->m_EventListeners.addInterface(aGuard, xListener); } void SAL_CALL @@ -1999,7 +1999,7 @@ SwXDocumentIndexMark::removeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.removeInterface(xListener); + m_pImpl->m_EventListeners.removeInterface(aGuard, xListener); } uno::Reference< beans::XPropertySetInfo > SAL_CALL diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 658fa7aac3eb..208ebad07fd7 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -1234,7 +1234,7 @@ void SAL_CALL SwXParagraph::addEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.addInterface(xListener); + m_pImpl->m_EventListeners.addInterface(aGuard, xListener); } void SAL_CALL SwXParagraph::removeEventListener( @@ -1242,7 +1242,7 @@ void SAL_CALL SwXParagraph::removeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.removeInterface(xListener); + m_pImpl->m_EventListeners.removeInterface(aGuard, xListener); } uno::Reference< container::XEnumeration > SAL_CALL diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 925f40b370f9..53c12ab255a5 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -360,7 +360,7 @@ void SAL_CALL SwXReferenceMark::addEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.addInterface(xListener); + m_pImpl->m_EventListeners.addInterface(aGuard, xListener); } void SAL_CALL SwXReferenceMark::removeEventListener( @@ -368,7 +368,7 @@ void SAL_CALL SwXReferenceMark::removeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.removeInterface(xListener); + m_pImpl->m_EventListeners.removeInterface(aGuard, xListener); } OUString SAL_CALL SwXReferenceMark::getName() @@ -876,7 +876,7 @@ SwXMeta::addEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.addInterface(xListener); + m_pImpl->m_EventListeners.addInterface(aGuard, xListener); } void SAL_CALL @@ -885,7 +885,7 @@ SwXMeta::removeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.removeInterface(xListener); + m_pImpl->m_EventListeners.removeInterface(aGuard, xListener); } void SAL_CALL diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 2fc5ac582ab7..54cc983c57c8 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -494,7 +494,7 @@ void SAL_CALL SwXTextSection::addEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.addInterface(xListener); + m_pImpl->m_EventListeners.addInterface(aGuard, xListener); } void SAL_CALL SwXTextSection::removeEventListener( @@ -502,7 +502,7 @@ void SAL_CALL SwXTextSection::removeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.removeInterface(xListener); + m_pImpl->m_EventListeners.removeInterface(aGuard, xListener); } uno::Reference< beans::XPropertySetInfo > SAL_CALL diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 7853d7ccbe2b..7680b458176d 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -146,12 +146,12 @@ namespace return event; } - void lcl_SendChartEvent( + void lcl_SendChartEvent(std::unique_lock<std::mutex>& rGuard, uno::Reference<uno::XInterface> const& xSource, ::comphelper::OInterfaceContainerHelper4<chart::XChartDataChangeEventListener> & rListeners) { - if (rListeners.getLength()) - rListeners.notifyEach( + if (rListeners.getLength(rGuard)) + rListeners.notifyEach(rGuard, &chart::XChartDataChangeEventListener::chartDataChanged, createChartEvent(xSource)); } @@ -2167,7 +2167,7 @@ void SAL_CALL SwXTextTable::addEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.addInterface(xListener); + m_pImpl->m_EventListeners.addInterface(aGuard, xListener); } void SAL_CALL SwXTextTable::removeEventListener( @@ -2175,7 +2175,7 @@ void SAL_CALL SwXTextTable::removeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_EventListeners.removeInterface(xListener); + m_pImpl->m_EventListeners.removeInterface(aGuard, xListener); } uno::Reference<table::XCell> SwXTextTable::getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow) @@ -2317,7 +2317,7 @@ void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData xAllRange->setData(rData); // this is rather inconsistent: setData on XTextTable sends events, but e.g. CellRanges do not std::unique_lock aGuard2(m_pImpl->m_Mutex); - lcl_SendChartEvent(*this, m_pImpl->m_ChartListeners); + lcl_SendChartEvent(aGuard2, *this, m_pImpl->m_ChartListeners); } uno::Sequence<OUString> SwXTextTable::getRowDescriptions() @@ -2373,7 +2373,7 @@ void SAL_CALL SwXTextTable::addChartDataChangeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_ChartListeners.addInterface(xListener); + m_pImpl->m_ChartListeners.addInterface(aGuard, xListener); } void SAL_CALL SwXTextTable::removeChartDataChangeEventListener( @@ -2381,7 +2381,7 @@ void SAL_CALL SwXTextTable::removeChartDataChangeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_ChartListeners.removeInterface(xListener); + m_pImpl->m_ChartListeners.removeInterface(aGuard, xListener); } sal_Bool SwXTextTable::isNotANumber(double nNumber) @@ -2492,7 +2492,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An if (m_pImpl->m_bFirstRowAsLabel != bTmp) { std::unique_lock aGuard2(m_pImpl->m_Mutex); - lcl_SendChartEvent(*this, m_pImpl->m_ChartListeners); + lcl_SendChartEvent(aGuard2, *this, m_pImpl->m_ChartListeners); m_pImpl->m_bFirstRowAsLabel = bTmp; } } @@ -2504,7 +2504,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An if (m_pImpl->m_bFirstColumnAsLabel != bTmp) { std::unique_lock aGuard2(m_pImpl->m_Mutex); - lcl_SendChartEvent(*this, m_pImpl->m_ChartListeners); + lcl_SendChartEvent(aGuard2, *this, m_pImpl->m_ChartListeners); m_pImpl->m_bFirstColumnAsLabel = bTmp; } } @@ -3086,7 +3086,7 @@ void SwXTextTable::Impl::Notify(const SfxHint& rHint) else { std::unique_lock aGuard(m_Mutex); - lcl_SendChartEvent(xThis, m_ChartListeners); + lcl_SendChartEvent(aGuard, xThis, m_ChartListeners); } } } @@ -3413,7 +3413,7 @@ SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV if (m_pImpl->m_bFirstRowAsLabel != bTmp) { std::unique_lock aGuard2(m_pImpl->m_Mutex); - lcl_SendChartEvent(*this, m_pImpl->m_ChartListeners); + lcl_SendChartEvent(aGuard2, *this, m_pImpl->m_ChartListeners); m_pImpl->m_bFirstRowAsLabel = bTmp; } } @@ -3424,7 +3424,7 @@ SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV if (m_pImpl->m_bFirstColumnAsLabel != bTmp) { std::unique_lock aGuard2(m_pImpl->m_Mutex); - lcl_SendChartEvent(*this, m_pImpl->m_ChartListeners); + lcl_SendChartEvent(aGuard2, *this, m_pImpl->m_ChartListeners); m_pImpl->m_bFirstColumnAsLabel = bTmp; } } @@ -3762,7 +3762,7 @@ void SAL_CALL SwXCellRange::addChartDataChangeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_ChartListeners.addInterface(xListener); + m_pImpl->m_ChartListeners.addInterface(aGuard, xListener); } void SAL_CALL SwXCellRange::removeChartDataChangeEventListener( @@ -3770,7 +3770,7 @@ void SAL_CALL SwXCellRange::removeChartDataChangeEventListener( { // no need to lock here as m_pImpl is const and container threadsafe std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_ChartListeners.removeInterface(xListener); + m_pImpl->m_ChartListeners.removeInterface(aGuard, xListener); } sal_Bool SwXCellRange::isNotANumber(double /*fNumber*/) @@ -3828,7 +3828,7 @@ void SwXCellRange::Impl::Notify( const SfxHint& rHint ) if(m_pFrameFormat) { std::unique_lock aGuard(m_Mutex); - lcl_SendChartEvent(xThis, m_ChartListeners); + lcl_SendChartEvent(aGuard, xThis, m_ChartListeners); } else { diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 7c2b71079635..959f7abd7527 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -2144,7 +2144,7 @@ void SwXTextDocument::NotifyRefreshListeners() // (sometimes) a different shell than GetWrtShell()? lang::EventObject const ev(static_cast<SwXTextDocumentBaseClass &>(*this)); std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_RefreshListeners.notifyEach( + m_pImpl->m_RefreshListeners.notifyEach(aGuard, & util::XRefreshListener::refreshed, ev); } @@ -2163,22 +2163,20 @@ void SwXTextDocument::refresh() void SAL_CALL SwXTextDocument::addRefreshListener( const Reference<util::XRefreshListener> & xListener) { - // no need to lock here as m_pImpl is const and container threadsafe if (xListener) { std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_RefreshListeners.addInterface(xListener); + m_pImpl->m_RefreshListeners.addInterface(aGuard, xListener); } } void SAL_CALL SwXTextDocument::removeRefreshListener( const Reference<util::XRefreshListener> & xListener) { - // no need to lock here as m_pImpl is const and container threadsafe if (xListener) { std::unique_lock aGuard(m_pImpl->m_Mutex); - m_pImpl->m_RefreshListeners.removeInterface(xListener); + m_pImpl->m_RefreshListeners.removeInterface(aGuard, xListener); } } |