chart2/source/inc/CachedDataSequence.hxx | 12 +++++------- chart2/source/tools/CachedDataSequence.cxx | 27 +++++++++------------------ 2 files changed, 14 insertions(+), 25 deletions(-)
New commits: commit ebe0f745e88a4d96bb29e52f4a56ec788c7c06ae Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Mar 26 15:26:53 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Mar 27 10:09:33 2024 +0100 convert CachedDataSequence to comphelper::WeakComponentImplHelper Change-Id: Ia95efee23b7cf76636d5d85c722cf5ce5989bb79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165360 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/chart2/source/inc/CachedDataSequence.hxx b/chart2/source/inc/CachedDataSequence.hxx index e9c1b9d50d25..513907c2429d 100644 --- a/chart2/source/inc/CachedDataSequence.hxx +++ b/chart2/source/inc/CachedDataSequence.hxx @@ -19,10 +19,9 @@ #pragma once // helper classes -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> #include <comphelper/uno3.hxx> -#include <comphelper/broadcasthelper.hxx> -#include <comphelper/propertycontainer.hxx> +#include <comphelper/propertycontainer2.hxx> #include <comphelper/proparrhlp.hxx> // interfaces and types @@ -41,7 +40,7 @@ namespace chart namespace impl { -typedef ::cppu::WeakComponentImplHelper< +typedef ::comphelper::WeakComponentImplHelper< css::chart2::data::XDataSequence, css::chart2::data::XNumericalDataSequence, css::chart2::data::XTextualDataSequence, @@ -56,8 +55,7 @@ typedef ::cppu::WeakComponentImplHelper< * This sequence object does store actual values within, hence "cached". */ class CachedDataSequence final : - public ::comphelper::OMutexAndBroadcastHelper, - public ::comphelper::OPropertyContainer, + public ::comphelper::OPropertyContainer2, public ::comphelper::OPropertyArrayUsageHelper< CachedDataSequence >, public impl::CachedDataSequence_Base { @@ -93,7 +91,7 @@ private: /// @see css::beans::XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; /// @see ::comphelper::OPropertySetHelper - virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + virtual ::cppu::IPropertyArrayHelper& getInfoHelper() override; /// @see ::comphelper::OPropertyArrayUsageHelper virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override; diff --git a/chart2/source/tools/CachedDataSequence.cxx b/chart2/source/tools/CachedDataSequence.cxx index 23f5add5f85f..7ddc9a010408 100644 --- a/chart2/source/tools/CachedDataSequence.cxx +++ b/chart2/source/tools/CachedDataSequence.cxx @@ -34,7 +34,6 @@ using ::com::sun::star::uno::Any; using ::osl::MutexGuard; // necessary for MS compiler -using ::comphelper::OPropertyContainer; using ::chart::impl::CachedDataSequence_Base; namespace @@ -53,26 +52,20 @@ namespace chart { CachedDataSequence::CachedDataSequence() - : OPropertyContainer( GetBroadcastHelper()), - CachedDataSequence_Base( GetMutex()), - m_eCurrentDataType( NUMERICAL ), + : m_eCurrentDataType( NUMERICAL ), m_xModifyEventForwarder( new ModifyEventForwarder() ) { registerProperties(); } CachedDataSequence::CachedDataSequence( const Reference< uno::XComponentContext > & /*xContext*/ ) - : OPropertyContainer( GetBroadcastHelper()), - CachedDataSequence_Base( GetMutex()), - m_eCurrentDataType( MIXED ), + : m_eCurrentDataType( MIXED ), m_xModifyEventForwarder( new ModifyEventForwarder() ) { registerProperties(); } CachedDataSequence::CachedDataSequence( const OUString & rSingleText ) - : OPropertyContainer( GetBroadcastHelper()), - CachedDataSequence_Base( GetMutex()), - m_eCurrentDataType( TEXTUAL ), + : m_eCurrentDataType( TEXTUAL ), m_aTextualSequence({rSingleText}), m_xModifyEventForwarder( new ModifyEventForwarder() ) { @@ -80,9 +73,7 @@ CachedDataSequence::CachedDataSequence( const OUString & rSingleText ) } CachedDataSequence::CachedDataSequence( const CachedDataSequence & rSource ) - : OPropertyContainer( GetBroadcastHelper()), - CachedDataSequence_Base( GetMutex()), - m_nNumberFormatKey( rSource.m_nNumberFormatKey ), + : m_nNumberFormatKey( rSource.m_nNumberFormatKey ), m_sRole( rSource.m_sRole ), m_eCurrentDataType( rSource.m_eCurrentDataType ), m_xModifyEventForwarder( new ModifyEventForwarder() ) @@ -213,8 +204,8 @@ Sequence< Any > CachedDataSequence::Impl_getMixedData() const return aResult; } -IMPLEMENT_FORWARD_XINTERFACE2( CachedDataSequence, CachedDataSequence_Base, OPropertyContainer ) -IMPLEMENT_FORWARD_XTYPEPROVIDER2( CachedDataSequence, CachedDataSequence_Base, OPropertyContainer ) +IMPLEMENT_FORWARD_XINTERFACE2( CachedDataSequence, CachedDataSequence_Base, comphelper::OPropertyContainer2 ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( CachedDataSequence, CachedDataSequence_Base, comphelper::OPropertyContainer2 ) // ____ XPropertySet ____ Reference< beans::XPropertySetInfo > SAL_CALL CachedDataSequence::getPropertySetInfo() @@ -261,7 +252,7 @@ css::uno::Sequence< OUString > SAL_CALL CachedDataSequence::getSupportedServiceN // ________ XNumericalDataSequence ________ Sequence< double > SAL_CALL CachedDataSequence::getNumericalData() { - MutexGuard aGuard( GetMutex() ); + std::unique_lock aGuard( m_aMutex ); if( m_eCurrentDataType == NUMERICAL ) return m_aNumericalSequence; @@ -272,7 +263,7 @@ Sequence< double > SAL_CALL CachedDataSequence::getNumericalData() // ________ XTextualDataSequence ________ Sequence< OUString > SAL_CALL CachedDataSequence::getTextualData() { - MutexGuard aGuard( GetMutex() ); + std::unique_lock aGuard( m_aMutex ); if( m_eCurrentDataType == TEXTUAL ) return m_aTextualSequence; @@ -283,7 +274,7 @@ Sequence< OUString > SAL_CALL CachedDataSequence::getTextualData() // ________ XDataSequence ________ Sequence< Any > SAL_CALL CachedDataSequence::getData() { - MutexGuard aGuard( GetMutex() ); + std::unique_lock aGuard( m_aMutex ); return Impl_getMixedData(); }