summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-07 16:09:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-08 06:43:33 +0000
commit429d53316223809591cb4427b517f0e4266888ed (patch)
tree403496d8cfaa976571f00b280433a042a72352aa
parente385534e1fcbb626e50076d69e91bd31f537527f (diff)
BaseMutex->std::mutex in BibDataManager
Change-Id: Ieb341b37e9643474cfcbed0c0fb0d44e9f079157 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148441 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--extensions/source/bibliography/datman.cxx25
-rw-r--r--extensions/source/bibliography/datman.hxx13
-rw-r--r--extensions/source/bibliography/general.cxx1
3 files changed, 21 insertions, 18 deletions
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index b603d19d685f..4f20e997cc24 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -530,9 +530,7 @@ void SAL_CALL BibInterceptorHelper::setMasterDispatchProvider( const css::uno::R
constexpr OUStringLiteral gGridName(u"theGrid");
BibDataManager::BibDataManager()
- :BibDataManager_Base( GetMutex() )
- ,m_aLoadListeners(m_aMutex)
- ,pBibView( nullptr )
+ :pBibView( nullptr )
,pToolbar(nullptr)
{
}
@@ -1014,8 +1012,9 @@ void SAL_CALL BibDataManager::load( )
{
xFormAsLoadable->load();
+ std::unique_lock g(m_aMutex);
EventObject aEvt( static_cast< XWeak* >( this ) );
- m_aLoadListeners.notifyEach( &XLoadListener::loaded, aEvt );
+ m_aLoadListeners.notifyEach( g, &XLoadListener::loaded, aEvt );
}
}
@@ -1034,13 +1033,15 @@ void SAL_CALL BibDataManager::unload( )
EventObject aEvt( static_cast< XWeak* >( this ) );
{
- m_aLoadListeners.notifyEach( &XLoadListener::unloading, aEvt );
+ std::unique_lock g(m_aMutex);
+ m_aLoadListeners.notifyEach( g, &XLoadListener::unloading, aEvt );
}
xFormAsLoadable->unload();
{
- m_aLoadListeners.notifyEach( &XLoadListener::unloaded, aEvt );
+ std::unique_lock g(m_aMutex);
+ m_aLoadListeners.notifyEach( g, &XLoadListener::unloaded, aEvt );
}
}
@@ -1059,13 +1060,15 @@ void SAL_CALL BibDataManager::reload( )
EventObject aEvt( static_cast< XWeak* >( this ) );
{
- m_aLoadListeners.notifyEach( &XLoadListener::reloading, aEvt );
+ std::unique_lock g(m_aMutex);
+ m_aLoadListeners.notifyEach( g, &XLoadListener::reloading, aEvt );
}
xFormAsLoadable->reload();
{
- m_aLoadListeners.notifyEach( &XLoadListener::reloaded, aEvt );
+ std::unique_lock g(m_aMutex);
+ m_aLoadListeners.notifyEach( g, &XLoadListener::reloaded, aEvt );
}
}
@@ -1084,13 +1087,15 @@ sal_Bool SAL_CALL BibDataManager::isLoaded( )
void SAL_CALL BibDataManager::addLoadListener( const Reference< XLoadListener >& aListener )
{
- m_aLoadListeners.addInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aLoadListeners.addInterface( g, aListener );
}
void SAL_CALL BibDataManager::removeLoadListener( const Reference< XLoadListener >& aListener )
{
- m_aLoadListeners.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aLoadListeners.removeInterface( g, aListener );
}
diff --git a/extensions/source/bibliography/datman.hxx b/extensions/source/bibliography/datman.hxx
index 36cbdcd594b6..405cf83d85a5 100644
--- a/extensions/source/bibliography/datman.hxx
+++ b/extensions/source/bibliography/datman.hxx
@@ -25,10 +25,9 @@
#include <com/sun/star/form/XForm.hpp>
#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
#include <com/sun/star/form/runtime/XFormController.hpp>
-#include <cppuhelper/compbase.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/compbase.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <com/sun/star/form/XLoadable.hpp>
-#include <comphelper/broadcasthelper.hxx>
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
#include <cppuhelper/implbase.hxx>
@@ -72,11 +71,9 @@ public:
virtual void SAL_CALL setMasterDispatchProvider( const css::uno::Reference< css::frame::XDispatchProvider >& xNewMasterDispatchProvider ) override;
};
-typedef cppu::WeakComponentImplHelper < css::form::XLoadable
+typedef comphelper::WeakComponentImplHelper < css::form::XLoadable
> BibDataManager_Base;
-class BibDataManager final
- :public ::comphelper::OMutexAndBroadcastHelper
- ,public BibDataManager_Base
+class BibDataManager final : public BibDataManager_Base
{
private:
css::uno::Reference< css::form::XForm > m_xForm;
@@ -90,7 +87,7 @@ private:
OUString aDataSourceURL;
OUString aQuoteChar;
- ::comphelper::OInterfaceContainerHelper2 m_aLoadListeners;
+ ::comphelper::OInterfaceContainerHelper4<css::form::XLoadListener> m_aLoadListeners;
VclPtr< ::bib::BibView> pBibView;
VclPtr<BibToolBar> pToolbar;
diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx
index 41ed9cd1929f..5e633e4dd98a 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -29,6 +29,7 @@
#include <o3tl/safeint.hxx>
#include <o3tl/string_view.hxx>
#include <sal/log.hxx>
+#include <osl/diagnose.h>
#include <cppuhelper/implbase.hxx>
#include <utility>
#include <vcl/event.hxx>