diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-25 18:46:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-27 09:00:06 +0100 |
commit | aaa42c672596e5fcac684b0cefee2e72a216f5bc (patch) | |
tree | 6d40c7151e682d6a64aa79699187271c91fb8253 /framework | |
parent | da86317827b494affb12039b9b7c817652f7d598 (diff) |
use comphelper::WeakComponentImplHelper in WindowContentFactoryManager
Change-Id: I0918d7d1ff84b4d5e41191b554d08474abce1f93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127518
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uifactory/windowcontentfactorymanager.cxx | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/framework/source/uifactory/windowcontentfactorymanager.cxx b/framework/source/uifactory/windowcontentfactorymanager.cxx index 0d2991c80b7e..ed8b61527675 100644 --- a/framework/source/uifactory/windowcontentfactorymanager.cxx +++ b/framework/source/uifactory/windowcontentfactorymanager.cxx @@ -31,8 +31,7 @@ #include <com/sun/star/lang/XSingleComponentFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <rtl/ref.hxx> #include <tools/diagnose_ex.h> @@ -42,12 +41,11 @@ using namespace framework; namespace { -typedef ::cppu::WeakComponentImplHelper< +typedef comphelper::WeakComponentImplHelper< css::lang::XServiceInfo, css::lang::XSingleComponentFactory > WindowContentFactoryManager_BASE; -class WindowContentFactoryManager : private cppu::BaseMutex, - public WindowContentFactoryManager_BASE +class WindowContentFactoryManager : public WindowContentFactoryManager_BASE { public: explicit WindowContentFactoryManager( const css::uno::Reference< css::uno::XComponentContext>& rxContext ); @@ -72,7 +70,7 @@ public: virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext( const css::uno::Sequence< css::uno::Any >& Arguments, const css::uno::Reference< css::uno::XComponentContext >& Context ) override; private: - virtual void SAL_CALL disposing() override; + virtual void disposing(std::unique_lock<std::mutex>&) override; css::uno::Reference< css::uno::XComponentContext > m_xContext; bool m_bConfigRead; @@ -80,7 +78,6 @@ private: }; WindowContentFactoryManager::WindowContentFactoryManager( const uno::Reference< uno::XComponentContext >& rxContext ) : - WindowContentFactoryManager_BASE(m_aMutex), m_xContext( rxContext ), m_bConfigRead( false ), m_pConfigAccess( @@ -89,7 +86,7 @@ WindowContentFactoryManager::WindowContentFactoryManager( const uno::Reference< "/org.openoffice.Office.UI.WindowContentFactories/Registered/ContentFactories")) {} -void SAL_CALL WindowContentFactoryManager::disposing() +void WindowContentFactoryManager::disposing(std::unique_lock<std::mutex>&) { m_pConfigAccess.clear(); } @@ -147,17 +144,17 @@ uno::Reference< uno::XInterface > SAL_CALL WindowContentFactoryManager::createIn // Determine the implementation name of the window content factory dependent on the // module identifier, user interface element type and name { // SAFE - osl::MutexGuard g(rBHelper.rMutex); - if (rBHelper.bDisposed) { - throw css::lang::DisposedException( - "disposed", static_cast<OWeakObject *>(this)); - } - if ( !m_bConfigRead ) - { - m_bConfigRead = true; - m_pConfigAccess->readConfigurationData(); - } - aImplementationName = m_pConfigAccess->getFactorySpecifierFromTypeNameModule( aType, aName, aModuleId ); + std::unique_lock g(m_aMutex); + if (m_bDisposed) { + throw css::lang::DisposedException( + "disposed", static_cast<OWeakObject *>(this)); + } + if ( !m_bConfigRead ) + { + m_bConfigRead = true; + m_pConfigAccess->readConfigurationData(); + } + aImplementationName = m_pConfigAccess->getFactorySpecifierFromTypeNameModule( aType, aName, aModuleId ); } // SAFE if ( !aImplementationName.isEmpty() ) |