chart2/source/inc/RangeHighlighter.hxx | 12 ++++++------ chart2/source/tools/RangeHighlighter.cxx | 15 ++++++--------- include/sfx2/sidebar/Theme.hxx | 10 ++++------ sfx2/source/sidebar/DeckLayouter.cxx | 1 + sfx2/source/sidebar/TabBar.cxx | 1 + sfx2/source/sidebar/Theme.cxx | 5 ++--- 6 files changed, 20 insertions(+), 24 deletions(-)
New commits: commit f55f46594cf43b46ed092af415a8a3af6972a7cd Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Tue Dec 28 21:33:57 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Dec 29 19:50:15 2021 +0100 use comphelper::WeakComponentImplHelper in RangeHighlighter Change-Id: I38d14bb253981db18885355c64accaa91c3accd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/chart2/source/inc/RangeHighlighter.hxx b/chart2/source/inc/RangeHighlighter.hxx index 43f22d985763..3c9278fc1328 100644 --- a/chart2/source/inc/RangeHighlighter.hxx +++ b/chart2/source/inc/RangeHighlighter.hxx @@ -18,8 +18,8 @@ */ #pragma once -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> +#include <comphelper/interfacecontainer4.hxx> #include <com/sun/star/chart2/data/XRangeHighlighter.hpp> #include <com/sun/star/view/XSelectionChangeListener.hpp> @@ -38,15 +38,14 @@ namespace chart namespace impl { -typedef ::cppu::WeakComponentImplHelper< +typedef comphelper::WeakComponentImplHelper< css::chart2::data::XRangeHighlighter, css::view::XSelectionChangeListener > RangeHighlighter_Base; } -class RangeHighlighter : - public cppu::BaseMutex, +class RangeHighlighter final : public impl::RangeHighlighter_Base { public: @@ -72,7 +71,7 @@ protected: // ____ WeakComponentImplHelperBase ____ // is called when dispose() is called at this component - virtual void SAL_CALL disposing() override; + virtual void disposing(std::unique_lock<std::mutex>&) override; private: void fireSelectionEvent(); @@ -95,6 +94,7 @@ private: m_aSelectedRanges; sal_Int32 m_nAddedListenerCount; bool m_bIncludeHiddenCells; + comphelper::OInterfaceContainerHelper4<css::view::XSelectionChangeListener> maSelectionChangeListeners; }; } // namespace chart diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx index 3dc667bfd043..247daaaae7e0 100644 --- a/chart2/source/tools/RangeHighlighter.cxx +++ b/chart2/source/tools/RangeHighlighter.cxx @@ -69,7 +69,6 @@ namespace chart RangeHighlighter::RangeHighlighter( const Reference< view::XSelectionSupplier > & xSelectionSupplier ) : - impl::RangeHighlighter_Base( m_aMutex ), m_xSelectionSupplier( xSelectionSupplier ), m_nAddedListenerCount( 0 ), m_bIncludeHiddenCells(true) @@ -307,7 +306,7 @@ void SAL_CALL RangeHighlighter::addSelectionChangeListener( const Reference< vie if( m_nAddedListenerCount == 0 ) startListening(); - rBHelper.addListener( cppu::UnoType<decltype(xListener)>::get(), xListener); + maSelectionChangeListeners.addInterface( xListener); ++m_nAddedListenerCount; //bring the new listener up to the current state @@ -317,7 +316,7 @@ void SAL_CALL RangeHighlighter::addSelectionChangeListener( const Reference< vie void SAL_CALL RangeHighlighter::removeSelectionChangeListener( const Reference< view::XSelectionChangeListener >& xListener ) { - rBHelper.removeListener( cppu::UnoType<decltype(xListener)>::get(), xListener ); + maSelectionChangeListeners.removeInterface( xListener ); --m_nAddedListenerCount; if( m_nAddedListenerCount == 0 ) stopListening(); @@ -335,15 +334,13 @@ void SAL_CALL RangeHighlighter::selectionChanged( const lang::EventObject& /*aEv void RangeHighlighter::fireSelectionEvent() { - ::cppu::OInterfaceContainerHelper* pIC = rBHelper.getContainer( - cppu::UnoType< view::XSelectionChangeListener >::get() ); - if( pIC ) + if( maSelectionChangeListeners.getLength() ) { lang::EventObject aEvent( static_cast< lang::XComponent* >( this ) ); - ::cppu::OInterfaceIteratorHelper aIt( *pIC ); + comphelper::OInterfaceIteratorHelper4 aIt( maSelectionChangeListeners ); while( aIt.hasMoreElements() ) { - static_cast< view::XSelectionChangeListener* >( aIt.next() )->selectionChanged( aEvent ); + aIt.next()->selectionChanged( aEvent ); } } } @@ -382,7 +379,7 @@ void RangeHighlighter::stopListening() // ____ WeakComponentImplHelperBase ____ // is called when dispose() is called at this component -void SAL_CALL RangeHighlighter::disposing() +void RangeHighlighter::disposing(std::unique_lock<std::mutex>&) { // @todo: remove listener. Currently the controller shows an assertion // because it is already disposed commit 94fbd711d0184b847ba78b70114ce9bdde04a63b Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Tue Dec 28 22:14:32 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Dec 29 19:50:02 2021 +0100 use comphelper::WeakComponentImplHelper in Theme Change-Id: Ia50d3919cb8a13781a43f00d102c556a82744ed9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/sfx2/sidebar/Theme.hxx b/include/sfx2/sidebar/Theme.hxx index f75f4724526e..a3f827f4a5d1 100644 --- a/include/sfx2/sidebar/Theme.hxx +++ b/include/sfx2/sidebar/Theme.hxx @@ -21,8 +21,7 @@ #include <sfx2/dllapi.h> #include <tools/color.hxx> -#include <cppuhelper/compbase.hxx> -#include <cppuhelper/basemutex.hxx> +#include <comphelper/compbase.hxx> #include <com/sun/star/beans/XPropertySet.hpp> @@ -32,7 +31,7 @@ namespace sfx2::sidebar { -typedef cppu::WeakComponentImplHelper < +typedef comphelper::WeakComponentImplHelper < css::beans::XPropertySet, css::beans::XPropertySetInfo > ThemeInterfaceBase; @@ -41,8 +40,7 @@ typedef cppu::WeakComponentImplHelper < look of the sidebar and its controls. */ class SFX2_DLLPUBLIC Theme final - : private ::cppu::BaseMutex, - public ThemeInterfaceBase + : public ThemeInterfaceBase { public: enum ThemeItem @@ -94,7 +92,7 @@ public: Theme(const Theme&) = delete; Theme& operator=( const Theme& ) = delete; - virtual void SAL_CALL disposing() override; + virtual void disposing(std::unique_lock<std::mutex>&) override; static css::uno::Reference<css::beans::XPropertySet> GetPropertySet(); diff --git a/sfx2/source/sidebar/DeckLayouter.cxx b/sfx2/source/sidebar/DeckLayouter.cxx index 0fc874c2e367..766159c58835 100644 --- a/sfx2/source/sidebar/DeckLayouter.cxx +++ b/sfx2/source/sidebar/DeckLayouter.cxx @@ -27,6 +27,7 @@ #include <sfx2/sidebar/SidebarController.hxx> #include <sfx2/viewsh.hxx> #include <comphelper/lok.hxx> +#include <osl/diagnose.h> #include <comphelper/processfactory.hxx> diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx index 878c87c67360..d874a3191300 100644 --- a/sfx2/source/sidebar/TabBar.cxx +++ b/sfx2/source/sidebar/TabBar.cxx @@ -31,6 +31,7 @@ #include <vcl/event.hxx> #include <vcl/svapp.hxx> #include <svtools/acceleratorexecute.hxx> +#include <osl/diagnose.h> using namespace css; using namespace css::uno; diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx index c6238bb3def0..99fcdb67b10e 100644 --- a/sfx2/source/sidebar/Theme.cxx +++ b/sfx2/source/sidebar/Theme.cxx @@ -37,8 +37,7 @@ Theme& Theme::GetCurrentTheme() } Theme::Theme() - : ThemeInterfaceBase(m_aMutex), - mbIsHighContrastMode(Application::GetSettings().GetStyleSettings().GetHighContrastMode()), + : mbIsHighContrastMode(Application::GetSettings().GetStyleSettings().GetHighContrastMode()), mbIsHighContrastModeSetManually(false) { SetupPropertyMaps(); @@ -143,7 +142,7 @@ void Theme::UpdateTheme() } } -void SAL_CALL Theme::disposing() +void Theme::disposing(std::unique_lock<std::mutex>&) { SolarMutexGuard aGuard;