forms/source/xforms/datatypes.cxx | 34 +++++++++++++++---------------- forms/source/xforms/datatypes.hxx | 22 +++++++++----------- include/comphelper/propshlp.hxx | 13 +++++------ scripting/source/basprov/basmethnode.cxx | 9 +++----- scripting/source/basprov/basmethnode.hxx | 12 ++++------ 5 files changed, 42 insertions(+), 48 deletions(-)
New commits: commit 35d9d669f26663d8fc71f9a67bbaf94bc90d4b25 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Mar 27 10:08:21 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Mar 28 19:08:49 2024 +0100 convert OXSDDataType to comphelper::WeakImplHelperBase Change-Id: Idb299ea698480d0b98ac0deff9d1f9b87e749782 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165442 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/forms/source/xforms/datatypes.cxx b/forms/source/xforms/datatypes.cxx index 382c5c80fdd0..91cb67efcf9f 100644 --- a/forms/source/xforms/datatypes.cxx +++ b/forms/source/xforms/datatypes.cxx @@ -56,8 +56,7 @@ namespace xforms U_NAMESPACE_USE OXSDDataType::OXSDDataType( OUString _aName, sal_Int16 _nTypeClass ) - :OXSDDataType_PBase( m_aBHelper ) - ,m_bIsBasic( true ) + :m_bIsBasic( true ) ,m_nTypeClass( _nTypeClass ) ,m_sName(std::move( _aName )) ,m_nWST( WhiteSpaceTreatment::Preserve ) @@ -99,10 +98,10 @@ namespace xforms } - IMPLEMENT_FORWARD_XINTERFACE2( OXSDDataType, OXSDDataType_Base, ::comphelper::OPropertyContainer ) + IMPLEMENT_FORWARD_XINTERFACE2( OXSDDataType, OXSDDataType_Base, ::comphelper::OPropertyContainer2 ) - IMPLEMENT_FORWARD_XTYPEPROVIDER2( OXSDDataType, OXSDDataType_Base, ::comphelper::OPropertyContainer ) + IMPLEMENT_FORWARD_XTYPEPROVIDER2( OXSDDataType, OXSDDataType_Base, ::comphelper::OPropertyContainer2 ) OUString SAL_CALL OXSDDataType::getName( ) { @@ -233,10 +232,10 @@ namespace xforms } - sal_Bool OXSDDataType::convertFastPropertyValue( Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue ) + bool OXSDDataType::convertFastPropertyValue( std::unique_lock<std::mutex>& rGuard, Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue ) { // let the base class do the conversion - if ( !OXSDDataType_PBase::convertFastPropertyValue( _rConvertedValue, _rOldValue, _nHandle, _rValue ) ) + if ( !::comphelper::OPropertyContainer2::convertFastPropertyValue( rGuard, _rConvertedValue, _rOldValue, _nHandle, _rValue ) ) return false; // sanity checks @@ -250,9 +249,9 @@ namespace xforms } - void SAL_CALL OXSDDataType::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _rValue ) + void OXSDDataType::setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 _nHandle, const Any& _rValue ) { - OXSDDataType_PBase::setFastPropertyValue_NoBroadcast( _nHandle, _rValue ); + ::comphelper::OPropertyContainer2::setFastPropertyValue_NoBroadcast( rGuard, _nHandle, _rValue ); if ( _nHandle == PROPERTY_ID_XSD_PATTERN ) m_bPatternMatcherDirty = true; } @@ -280,37 +279,37 @@ namespace xforms void SAL_CALL OXSDDataType::setPropertyValue( const OUString& aPropertyName, const Any& aValue ) { - OXSDDataType_PBase::setPropertyValue( aPropertyName, aValue ); + ::comphelper::OPropertyContainer2::setPropertyValue( aPropertyName, aValue ); } Any SAL_CALL OXSDDataType::getPropertyValue( const OUString& PropertyName ) { - return OXSDDataType_PBase::getPropertyValue( PropertyName ); + return ::comphelper::OPropertyContainer2::getPropertyValue( PropertyName ); } void SAL_CALL OXSDDataType::addPropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& xListener ) { - OXSDDataType_PBase::addPropertyChangeListener( aPropertyName, xListener ); + ::comphelper::OPropertyContainer2::addPropertyChangeListener( aPropertyName, xListener ); } void SAL_CALL OXSDDataType::removePropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& aListener ) { - OXSDDataType_PBase::removePropertyChangeListener( aPropertyName, aListener ); + ::comphelper::OPropertyContainer2::removePropertyChangeListener( aPropertyName, aListener ); } void SAL_CALL OXSDDataType::addVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) { - OXSDDataType_PBase::addVetoableChangeListener( PropertyName, aListener ); + ::comphelper::OPropertyContainer2::addVetoableChangeListener( PropertyName, aListener ); } void SAL_CALL OXSDDataType::removeVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) { - OXSDDataType_PBase::removeVetoableChangeListener( PropertyName, aListener ); + ::comphelper::OPropertyContainer2::removeVetoableChangeListener( PropertyName, aListener ); } OValueLimitedType_Base::OValueLimitedType_Base( const OUString& _rName, sal_Int16 _nTypeClass ) @@ -343,10 +342,11 @@ namespace xforms } - void SAL_CALL OValueLimitedType_Base::setFastPropertyValue_NoBroadcast( + void OValueLimitedType_Base::setFastPropertyValue_NoBroadcast( + std::unique_lock<std::mutex>& rGuard, sal_Int32 _nHandle, const css::uno::Any& _rValue ) { - OXSDDataType::setFastPropertyValue_NoBroadcast( _nHandle, _rValue ); + OXSDDataType::setFastPropertyValue_NoBroadcast( rGuard, _nHandle, _rValue ); // if one of our limit properties has been set, translate it into a double // value, for later efficient validation @@ -1173,7 +1173,7 @@ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL ODerivedDataType< C template< typename CONCRETE_DATA_TYPE_IMPL, typename SUPERCLASS > -::cppu::IPropertyArrayHelper& SAL_CALL ODerivedDataType< CONCRETE_DATA_TYPE_IMPL, SUPERCLASS >::getInfoHelper() +::cppu::IPropertyArrayHelper& ODerivedDataType< CONCRETE_DATA_TYPE_IMPL, SUPERCLASS >::getInfoHelper() { if ( !m_bPropertiesRegistered ) { diff --git a/forms/source/xforms/datatypes.hxx b/forms/source/xforms/datatypes.hxx index 69d627403090..db1500402a9d 100644 --- a/forms/source/xforms/datatypes.hxx +++ b/forms/source/xforms/datatypes.hxx @@ -24,11 +24,10 @@ #include <com/sun/star/util/Time.hpp> #include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/xsd/XDataType.hpp> -#include <cppuhelper/implbase.hxx> +#include <comphelper/compbase.hxx> #include <comphelper/uno3.hxx> -#include <comphelper/propertycontainer.hxx> +#include <comphelper/propertycontainer2.hxx> #include <comphelper/proparrhlp.hxx> -#include <comphelper/broadcasthelper.hxx> #include <rtl/ref.hxx> #include <unotools/resmgr.hxx> @@ -45,14 +44,11 @@ namespace xforms //= OXSDDataType - typedef ::cppu::WeakImplHelper < css::xsd::XDataType + typedef ::comphelper::WeakImplHelper < css::xsd::XDataType > OXSDDataType_Base; - typedef ::comphelper::OMutexAndBroadcastHelper OXSDDataType_BBase; - typedef ::comphelper::OPropertyContainer OXSDDataType_PBase; class OXSDDataType :public OXSDDataType_Base - ,public OXSDDataType_BBase // order matters: OMutexAndBroadcastHelper before - ,public OXSDDataType_PBase // OPropertyContainer + ,public ::comphelper::OPropertyContainer2 { private: // <properties> @@ -108,8 +104,9 @@ namespace xforms protected: // XPropertySet and friends - virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any& _rConvertedValue, css::uno::Any& _rOldValue, sal_Int32 _nHandle, const css::uno::Any& _rValue ) override; - virtual void SAL_CALL setFastPropertyValue_NoBroadcast( + virtual bool convertFastPropertyValue( std::unique_lock<std::mutex>& rGuard, css::uno::Any& _rConvertedValue, css::uno::Any& _rOldValue, sal_Int32 _nHandle, const css::uno::Any& _rValue ) override; + virtual void setFastPropertyValue_NoBroadcast( + std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override; @@ -153,7 +150,8 @@ namespace xforms void initializeTypedClone( const OValueLimitedType_Base& _rCloneSource ); // XPropertySet and friends - virtual void SAL_CALL setFastPropertyValue_NoBroadcast( + virtual void setFastPropertyValue_NoBroadcast( + std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override; @@ -218,7 +216,7 @@ namespace xforms // XPropertySet virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override; - virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + virtual ::cppu::IPropertyArrayHelper& getInfoHelper() override; }; class OBooleanType; diff --git a/include/comphelper/propshlp.hxx b/include/comphelper/propshlp.hxx index d5f148de4893..bd08cd6a6499 100644 --- a/include/comphelper/propshlp.hxx +++ b/include/comphelper/propshlp.hxx @@ -91,33 +91,32 @@ public: value and setFastPropertyValue is called. */ virtual void SAL_CALL setPropertyValue(const ::rtl::OUString& rPropertyName, - const css::uno::Any& aValue) override final; + const css::uno::Any& aValue) override; /** Throw UnknownPropertyException if the property with the name rPropertyName does not exist. */ - virtual css::uno::Any SAL_CALL - getPropertyValue(const ::rtl::OUString& aPropertyName) override final; + virtual css::uno::Any SAL_CALL getPropertyValue(const ::rtl::OUString& aPropertyName) override; /** Ignored if the property is not bound. */ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, - const css::uno::Reference<css::beans::XPropertyChangeListener>& aListener) override final; + const css::uno::Reference<css::beans::XPropertyChangeListener>& aListener) override; /** Ignored if the property is not bound. */ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, - const css::uno::Reference<css::beans::XPropertyChangeListener>& aListener) override final; + const css::uno::Reference<css::beans::XPropertyChangeListener>& aListener) override; /** Ignored if the property is not constrained. */ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& aPropertyName, - const css::uno::Reference<css::beans::XVetoableChangeListener>& aListener) override final; + const css::uno::Reference<css::beans::XVetoableChangeListener>& aListener) override; /** Ignored if the property is not constrained. */ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& aPropertyName, - const css::uno::Reference<css::beans::XVetoableChangeListener>& aListener) override final; + const css::uno::Reference<css::beans::XVetoableChangeListener>& aListener) override; /** Throw UnknownPropertyException or PropertyVetoException if the property with the name commit 6e8fb02d75eea17d41bbf76d40de723162968f27 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Mar 27 11:16:17 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Mar 28 19:08:39 2024 +0100 convert BasicMethodNodeImpl to comphelper::WeakImplHelper Change-Id: I568800deabc82185afafc4415efd55bbe762901c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165444 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/scripting/source/basprov/basmethnode.cxx b/scripting/source/basprov/basmethnode.cxx index f26e4c9a931b..d4e4f9e79539 100644 --- a/scripting/source/basprov/basmethnode.cxx +++ b/scripting/source/basprov/basmethnode.cxx @@ -59,9 +59,8 @@ namespace basprov BasicMethodNodeImpl::BasicMethodNodeImpl( const Reference< XComponentContext >& rxContext, OUString sScriptingContext, SbMethod* pMethod, bool isAppScript ) - : ::scripting_helper::OBroadcastHelperHolder( m_aMutex ) - ,OPropertyContainer( GetBroadcastHelper() ) - ,m_xContext( rxContext ) + : + m_xContext( rxContext ) ,m_sScriptingContext(std::move( sScriptingContext )) ,m_pMethod( pMethod ) ,m_bIsAppScript( isAppScript ) @@ -103,13 +102,13 @@ namespace basprov // XInterface - IMPLEMENT_FORWARD_XINTERFACE2( BasicMethodNodeImpl, BasicMethodNodeImpl_BASE, OPropertyContainer ) + IMPLEMENT_FORWARD_XINTERFACE2( BasicMethodNodeImpl, BasicMethodNodeImpl_BASE, comphelper::OPropertyContainer2 ) // XTypeProvider - IMPLEMENT_FORWARD_XTYPEPROVIDER2( BasicMethodNodeImpl, BasicMethodNodeImpl_BASE, OPropertyContainer ) + IMPLEMENT_FORWARD_XTYPEPROVIDER2( BasicMethodNodeImpl, BasicMethodNodeImpl_BASE, comphelper::OPropertyContainer2 ) // XBrowseNode diff --git a/scripting/source/basprov/basmethnode.hxx b/scripting/source/basprov/basmethnode.hxx index d1b08d837a90..169d06988f62 100644 --- a/scripting/source/basprov/basmethnode.hxx +++ b/scripting/source/basprov/basmethnode.hxx @@ -24,10 +24,10 @@ #include <com/sun/star/script/XInvocation.hpp> #include <com/sun/star/script/browse/XBrowseNode.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include <comphelper/compbase.hxx> #include <comphelper/proparrhlp.hxx> -#include <comphelper/propertycontainer.hxx> +#include <comphelper/propertycontainer2.hxx> #include <comphelper/uno3.hxx> -#include <cppuhelper/basemutex.hxx> #include <cppuhelper/implbase.hxx> @@ -40,14 +40,12 @@ namespace basprov - typedef ::cppu::WeakImplHelper< + typedef ::comphelper::WeakImplHelper< css::script::browse::XBrowseNode, css::script::XInvocation > BasicMethodNodeImpl_BASE; class BasicMethodNodeImpl : public BasicMethodNodeImpl_BASE, - public cppu::BaseMutex, - public ::scripting_helper::OBroadcastHelperHolder, - public ::comphelper::OPropertyContainer, + public ::comphelper::OPropertyContainer2, public ::comphelper::OPropertyArrayUsageHelper< BasicMethodNodeImpl > { private: @@ -62,7 +60,7 @@ namespace basprov protected: // OPropertySetHelper - virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper( ) override; + virtual ::cppu::IPropertyArrayHelper& getInfoHelper( ) override; // OPropertyArrayUsageHelper virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;