diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-31 14:38:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-31 14:34:08 +0000 |
commit | 96a47eeedfe4c8adcf2c2903d72fe6e4e12a65e3 (patch) | |
tree | d8120e1cb51d1ad7fc4702293b5fa7cc941061c8 /toolkit | |
parent | 589cd835436de8ada027280f927fa2ae28420317 (diff) |
simplify subclasses of comphelper::OPropertySetHelper
they should deal in terms of the fast property IDS, they should not need
to override setPropertyValueImpl, so just remove this, and standardise
on the subclasses overriding setFastPropertyValueImpl
Change-Id: I190955ccc4ae3e07dd481a1044f3c074dd1a40aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149836
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 6 | ||||
-rw-r--r-- | toolkit/source/controls/formattedcontrol.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrolmodel.cxx | 13 |
3 files changed, 5 insertions, 16 deletions
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index b9027cbf17d7..1b3e7d988ffa 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -279,14 +279,14 @@ void UnoControlDialogModel::setFastPropertyValue_NoBroadcast( std::unique_lock<s uno::Reference<graphic::XGraphic> xGraphic; if (rValue >>= sImageURL) { - setPropertyValueImpl(rGuard, - GetPropertyName(BASEPROPERTY_GRAPHIC), + setFastPropertyValueImpl(rGuard, + BASEPROPERTY_GRAPHIC, uno::Any(ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( mxGrfObj, sImageURL))); } else if (rValue >>= xGraphic) { - setPropertyValueImpl(rGuard, "Graphic", uno::Any(xGraphic)); + setFastPropertyValueImpl(rGuard, BASEPROPERTY_GRAPHIC, uno::Any(xGraphic)); } } } diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx index ff34f4cbdda7..13ef8886cc4f 100644 --- a/toolkit/source/controls/formattedcontrol.cxx +++ b/toolkit/source/controls/formattedcontrol.cxx @@ -201,7 +201,7 @@ namespace toolkit } } - setPropertyValueImpl( rGuard, GetPropertyName( BASEPROPERTY_TEXT ), Any( sStringValue ) ); + setFastPropertyValueImpl( rGuard, BASEPROPERTY_TEXT, Any( sStringValue ) ); } catch( const Exception& ) { diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index bfadc7f6bb8a..8cb7b3a526f9 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -1002,7 +1002,7 @@ void UnoControlModel::read( const css::uno::Reference< css::io::XObjectInputStre { css::uno::Any aValue; aValue <<= *pFD; - setPropertyValueImpl( aGuard, GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ), aValue ); + setFastPropertyValueImpl( aGuard, BASEPROPERTY_FONTDESCRIPTOR, aValue ); } } @@ -1210,17 +1210,6 @@ void UnoControlModel::getFastPropertyValue( std::unique_lock<std::mutex>& /*rGua } } -// css::beans::XPropertySet -void UnoControlModel::setPropertyValueImpl( std::unique_lock<std::mutex>& rGuard, const OUString& rPropertyName, const css::uno::Any& rValue ) -{ - sal_Int32 nPropId = static_cast<sal_Int32>(GetPropertyId( rPropertyName )); - DBG_ASSERT( nPropId, "Invalid ID in UnoControlModel::setPropertyValue" ); - if( !nPropId ) - throw css::beans::UnknownPropertyException(rPropertyName); - - setFastPropertyValueImpl( rGuard, nPropId, rValue ); -} - // css::beans::XFastPropertySet void UnoControlModel::setFastPropertyValueImpl( std::unique_lock<std::mutex>& rGuard, sal_Int32 nPropId, const css::uno::Any& rValue ) { |