chart2/source/inc/UncachedDataSequence.hxx | 11 ++++------ chart2/source/tools/UncachedDataSequence.cxx | 28 ++++++++++----------------- 2 files changed, 16 insertions(+), 23 deletions(-)
New commits: commit afd6bd25ec748063825c74156bc9006366481f7f Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Mar 26 15:30:12 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Mar 27 10:51:18 2024 +0100 convert UncachedDataSequence to comphelper::WeakComponentImplHelper Change-Id: Ib7facb9050bc71d15e23cb54c3ef22199c446da5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165361 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/chart2/source/inc/UncachedDataSequence.hxx b/chart2/source/inc/UncachedDataSequence.hxx index ca32af236d80..c134601944ff 100644 --- a/chart2/source/inc/UncachedDataSequence.hxx +++ b/chart2/source/inc/UncachedDataSequence.hxx @@ -19,10 +19,10 @@ #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> #include <rtl/ref.hxx> @@ -46,7 +46,7 @@ class ModifyEventForwarder; namespace impl { -typedef ::cppu::WeakComponentImplHelper< +typedef ::comphelper::WeakComponentImplHelper< css::chart2::data::XDataSequence, css::chart2::data::XNumericalDataSequence, css::chart2::data::XTextualDataSequence, @@ -69,8 +69,7 @@ typedef ::cppu::WeakComponentImplHelper< * 'label 2', ...</p> */ class UncachedDataSequence final : - public ::comphelper::OMutexAndBroadcastHelper, - public ::comphelper::OPropertyContainer, + public ::comphelper::OPropertyContainer2, public ::comphelper::OPropertyArrayUsageHelper< UncachedDataSequence >, public impl::UncachedDataSequence_Base { @@ -103,7 +102,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/UncachedDataSequence.cxx b/chart2/source/tools/UncachedDataSequence.cxx index 7211daedba6f..176eadafe8b1 100644 --- a/chart2/source/tools/UncachedDataSequence.cxx +++ b/chart2/source/tools/UncachedDataSequence.cxx @@ -36,7 +36,6 @@ using ::com::sun::star::uno::Any; using ::osl::MutexGuard; // necessary for MS compiler -using ::comphelper::OPropertyContainer; using ::chart::impl::UncachedDataSequence_Base; namespace @@ -57,9 +56,7 @@ namespace chart UncachedDataSequence::UncachedDataSequence( rtl::Reference< InternalDataProvider > xIntDataProv, OUString aRangeRepresentation ) - : OPropertyContainer( GetBroadcastHelper()), - UncachedDataSequence_Base( GetMutex()), - m_nNumberFormatKey(0), + : m_nNumberFormatKey(0), m_xDataProvider(std::move( xIntDataProv )), m_aSourceRepresentation(std::move( aRangeRepresentation )), m_xModifyEventForwarder( new ModifyEventForwarder() ) @@ -71,21 +68,18 @@ UncachedDataSequence::UncachedDataSequence( rtl::Reference< InternalDataProvider > xIntDataProv, OUString aRangeRepresentation, const OUString & rRole ) - : OPropertyContainer( GetBroadcastHelper()), - UncachedDataSequence_Base( GetMutex()), - m_nNumberFormatKey(0), + : m_nNumberFormatKey(0), m_xDataProvider(std::move( xIntDataProv )), m_aSourceRepresentation(std::move( aRangeRepresentation )), m_xModifyEventForwarder( new ModifyEventForwarder() ) { registerProperties(); - setFastPropertyValue_NoBroadcast( PROP_PROPOSED_ROLE, uno::Any( rRole )); + std::unique_lock<std::mutex> aGuard; + setFastPropertyValue_NoBroadcast( aGuard, PROP_PROPOSED_ROLE, uno::Any( rRole )); } UncachedDataSequence::UncachedDataSequence( const UncachedDataSequence & rSource ) - : OPropertyContainer( GetBroadcastHelper()), - UncachedDataSequence_Base( GetMutex()), - m_nNumberFormatKey( rSource.m_nNumberFormatKey ), + : m_nNumberFormatKey( rSource.m_nNumberFormatKey ), m_sRole( rSource.m_sRole ), m_xDataProvider( rSource.m_xDataProvider ), m_aSourceRepresentation( rSource.m_aSourceRepresentation ), @@ -118,8 +112,8 @@ void UncachedDataSequence::registerProperties() cppu::UnoType<decltype(m_aXMLRange)>::get() ); } -IMPLEMENT_FORWARD_XINTERFACE2( UncachedDataSequence, UncachedDataSequence_Base, OPropertyContainer ) -IMPLEMENT_FORWARD_XTYPEPROVIDER2( UncachedDataSequence, UncachedDataSequence_Base, OPropertyContainer ) +IMPLEMENT_FORWARD_XINTERFACE2( UncachedDataSequence, UncachedDataSequence_Base, comphelper::OPropertyContainer2 ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( UncachedDataSequence, UncachedDataSequence_Base, comphelper::OPropertyContainer2 ) // ____ XPropertySet ____ Reference< beans::XPropertySetInfo > SAL_CALL UncachedDataSequence::getPropertySetInfo() @@ -167,7 +161,7 @@ css::uno::Sequence< OUString > SAL_CALL UncachedDataSequence::getSupportedServic Sequence< double > SAL_CALL UncachedDataSequence::getNumericalData() { Sequence< double > aResult; - MutexGuard aGuard( GetMutex() ); + std::unique_lock<std::mutex> aGuard; if( m_xDataProvider.is()) { const Sequence< uno::Any > aValues( m_xDataProvider->getDataByRangeRepresentation( m_aSourceRepresentation )); @@ -182,7 +176,7 @@ Sequence< double > SAL_CALL UncachedDataSequence::getNumericalData() Sequence< OUString > SAL_CALL UncachedDataSequence::getTextualData() { Sequence< OUString > aResult; - MutexGuard aGuard( GetMutex() ); + std::unique_lock<std::mutex> aGuard; if( m_xDataProvider.is()) { const Sequence< uno::Any > aValues( m_xDataProvider->getDataByRangeRepresentation( m_aSourceRepresentation )); @@ -196,7 +190,7 @@ Sequence< OUString > SAL_CALL UncachedDataSequence::getTextualData() // ________ XDataSequence ________ Sequence< Any > SAL_CALL UncachedDataSequence::getData() { - MutexGuard aGuard( GetMutex() ); + std::unique_lock<std::mutex> aGuard; if( m_xDataProvider.is()) return m_xDataProvider->getDataByRangeRepresentation( m_aSourceRepresentation ); return Sequence< Any >(); @@ -228,7 +222,7 @@ Sequence< OUString > SAL_CALL UncachedDataSequence::generateLabel( chart2::data: // ____ XIndexReplace ____ void SAL_CALL UncachedDataSequence::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) { - MutexGuard aGuard( GetMutex() ); + std::unique_lock<std::mutex> aGuard; Sequence< Any > aData( getData()); if( Index < aData.getLength() && m_xDataProvider.is() )