sfx2/source/devtools/SelectionChangeHandler.hxx | 13 +++++-------- ucb/Library_ucpexpand1.mk | 1 + ucb/source/ucp/expand/ucpexpand.cxx | 18 +++++------------- 3 files changed, 11 insertions(+), 21 deletions(-)
New commits: commit 260ea19fb5e9aaa4ffff3f3ba06fc9c295be8d6a Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sat Dec 25 19:10:23 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Dec 27 07:37:48 2021 +0100 use comphelper::WeakComponentImplHelper in SelectionChangeHandler Change-Id: Iab23271e69b9ae703444387ecca172361f67dfd5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sfx2/source/devtools/SelectionChangeHandler.hxx b/sfx2/source/devtools/SelectionChangeHandler.hxx index 523165f2f599..612f8e46ff33 100644 --- a/sfx2/source/devtools/SelectionChangeHandler.hxx +++ b/sfx2/source/devtools/SelectionChangeHandler.hxx @@ -17,10 +17,9 @@ #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> -#include <cppuhelper/compbase.hxx> -#include <cppuhelper/basemutex.hxx> +#include <comphelper/compbase.hxx> -typedef cppu::WeakComponentImplHelper<css::view::XSelectionChangeListener> +typedef comphelper::WeakComponentImplHelper<css::view::XSelectionChangeListener> SelectionChangeHandlerInterfaceBase; /** Selection change handler to listen to document selection changes. @@ -28,8 +27,7 @@ typedef cppu::WeakComponentImplHelper<css::view::XSelectionChangeListener> * Listens to the changes and notifies the docking window with a new * selected object, when a change happens. */ -class SelectionChangeHandler final : private ::cppu::BaseMutex, - public SelectionChangeHandlerInterfaceBase +class SelectionChangeHandler final : public SelectionChangeHandlerInterfaceBase { private: css::uno::Reference<css::frame::XController> mxController; @@ -38,8 +36,7 @@ private: public: SelectionChangeHandler(const css::uno::Reference<css::frame::XController>& rxController, DevelopmentToolDockingWindow* pDockingWindow) - : SelectionChangeHandlerInterfaceBase(m_aMutex) - , mxController(rxController) + : mxController(rxController) , mpDockingWindow(pDockingWindow) { css::uno::Reference<css::view::XSelectionSupplier> xSupplier(mxController, @@ -69,7 +66,7 @@ public: } virtual void SAL_CALL disposing(const css::lang::EventObject& /*rEvent*/) override {} - virtual void SAL_CALL disposing() override {} + using comphelper::WeakComponentImplHelperBase::disposing; private: SelectionChangeHandler(const SelectionChangeHandler&) = delete; commit d3ca7a50908b6a689129eafe45305f5a1663da30 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sat Dec 25 18:51:39 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Dec 27 07:37:39 2021 +0100 use comphelper::WeakComponentImplHelper in ExpandContentProviderImpl Change-Id: I3c24b1c2eb3d44cb58709cb18de53597adf56e41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127520 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/ucb/Library_ucpexpand1.mk b/ucb/Library_ucpexpand1.mk index f66277874963..085782a03113 100644 --- a/ucb/Library_ucpexpand1.mk +++ b/ucb/Library_ucpexpand1.mk @@ -15,6 +15,7 @@ $(eval $(call gb_Library_set_componentfile,ucpexpand1,ucb/source/ucp/expand/ucpe $(eval $(call gb_Library_use_sdk_api,ucpexpand1)) $(eval $(call gb_Library_use_libraries,ucpexpand1,\ + comphelper \ cppu \ cppuhelper \ sal \ diff --git a/ucb/source/ucp/expand/ucpexpand.cxx b/ucb/source/ucp/expand/ucpexpand.cxx index 5b880a3d2a4d..2838c5cb728b 100644 --- a/ucb/source/ucp/expand/ucpexpand.cxx +++ b/ucb/source/ucp/expand/ucpexpand.cxx @@ -20,9 +20,8 @@ #include <rtl/uri.hxx> #include <osl/mutex.hxx> -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> #include <cppuhelper/factory.hxx> -#include <cppuhelper/basemutex.hxx> #include <cppuhelper/implementationentry.hxx> #include <cppuhelper/supportsservice.hxx> #include <ucbhelper/content.hxx> @@ -42,11 +41,11 @@ using namespace ::com::sun::star; namespace { -typedef ::cppu::WeakComponentImplHelper< +typedef comphelper::WeakComponentImplHelper< lang::XServiceInfo, ucb::XContentProvider > t_impl_helper; -class ExpandContentProviderImpl : protected cppu::BaseMutex, public t_impl_helper +class ExpandContentProviderImpl : public t_impl_helper { uno::Reference< uno::XComponentContext > m_xComponentContext; uno::Reference< util::XMacroExpander > m_xMacroExpander; @@ -55,13 +54,11 @@ class ExpandContentProviderImpl : protected cppu::BaseMutex, public t_impl_helpe protected: void check() const; - virtual void SAL_CALL disposing() override; public: explicit ExpandContentProviderImpl( uno::Reference< uno::XComponentContext > const & xComponentContext ) - : t_impl_helper( m_aMutex ), - m_xComponentContext( xComponentContext ), + : m_xComponentContext( xComponentContext ), m_xMacroExpander( util::theMacroExpander::get(xComponentContext) ) {} @@ -83,7 +80,7 @@ void ExpandContentProviderImpl::check() const { // xxx todo guard? // MutexGuard guard( m_mutex ); - if (rBHelper.bInDispose || rBHelper.bDisposed) + if (m_bDisposed) { throw lang::DisposedException( "expand content provider instance has " @@ -93,11 +90,6 @@ void ExpandContentProviderImpl::check() const } } -void ExpandContentProviderImpl::disposing() -{ -} - - // XServiceInfo OUString ExpandContentProviderImpl::getImplementationName()