37 OUString lcl_getUnknownPropertyErrorMessage( std::u16string_view _rPropertyName )
43 return OUString::Concat(
"The property \"") + _rPropertyName +
"\" is unknown.";
56 if ( !aReturn.hasValue() )
72 throw UnknownPropertyException( lcl_getUnknownPropertyErrorMessage( _rPropertyName ),
static_cast< XPropertyState*
>(
this ) );
86 sal_Int32
nProperties = _rPropertyNames.getLength();
94 const OUString* pNames = _rPropertyNames.getConstArray();
95 const OUString* pNamesCompare = pNames + 1;
96 const OUString* pNamesEnd = _rPropertyNames.getConstArray() + _rPropertyNames.getLength();
97 for ( ; pNamesCompare != pNamesEnd; ++pNames, ++pNamesCompare )
98 OSL_PRECOND( pNames->compareTo( *pNamesCompare ) < 0,
99 "OPropertyStateContainer::getPropertyStates: property sequence not sorted!" );
103 const OUString* pLookup = _rPropertyNames.getConstArray();
104 const OUString* pLookupEnd = pLookup +
nProperties;
105 PropertyState* pStates = aStates.getArray();
108 Sequence< Property> aAllProperties = rHelper.
getProperties();
109 sal_Int32 nAllProperties = aAllProperties.getLength();
110 const Property* pAllProperties = aAllProperties.getConstArray();
111 const Property* pAllPropertiesEnd = pAllProperties + nAllProperties;
114 for ( ; ( pAllProperties != pAllPropertiesEnd ) && ( pLookup != pLookupEnd ); ++pAllProperties )
117 if ( pAllProperties < pAllPropertiesEnd - 1 )
118 OSL_ENSURE( pAllProperties->Name.compareTo( (pAllProperties + 1)->Name ) < 0,
119 "OPropertyStateContainer::getPropertyStates: all-properties not sorted!" );
121 if ( pAllProperties->Name == *pLookup )
128 if ( pLookup != pLookupEnd )
131 throw UnknownPropertyException( lcl_getUnknownPropertyErrorMessage( *pLookup ),
static_cast< XPropertyState*
>(
this ) );
160 const_cast< void*
>( aCurrentValue.getValue() ), aCurrentValue.getValueType().getTypeLibType(),
161 const_cast< void*
>( aDefaultValue.getValue() ), aDefaultValue.getValueType().getTypeLibType(),
162 reinterpret_cast< uno_QueryInterfaceFunc
>(cpp_queryInterface),
163 reinterpret_cast< uno_ReleaseFunc
>(cpp_release)
166 return PropertyState_DEFAULT_VALUE;
168 return PropertyState_DIRECT_VALUE;
an OPropertySetHelper implementation which is just a simple container for properties represented by c...
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual void SAL_CALL setFastPropertyValue(sal_Int32 nHandle, const css::uno::Any &rValue) override final
Throw UnknownPropertyException or PropertyVetoException if the property with the name rPropertyName d...
helper implementation for components which have properties with a default
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
OPropertyStateContainer(::cppu::OBroadcastHelper &_rBHelper)
ctor
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
sal_Int32 getHandleForName(const OUString &_rPropertyName)
returns the handle for the given name
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
virtual void getPropertyDefaultByHandle(sal_Int32 _nHandle, css::uno::Any &_rDefault) const =0
get the default value for the property denoted by the given handle
void setPropertyToDefaultByHandle(sal_Int32 _nHandle)
set the property denoted by the given handle to its default value
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
css::beans::PropertyState getPropertyStateByHandle(sal_Int32 _nHandle) const
get the PropertyState of the property denoted by the given handle
virtual sal_Int32 SAL_CALL getHandleByName(const ::rtl::OUString &rPropertyName)=0
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties()=0
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual IPropertyArrayHelper &SAL_CALL getInfoHelper()=0
OBroadcastHelper & rBHelper
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) SAL_OVERRIDE
sal_Bool SAL_CALL uno_type_equalData(void *pVal1, typelib_TypeDescriptionReference *pVal1Type, void *pVal2, typelib_TypeDescriptionReference *pVal2Type, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
#define IMPLEMENT_FORWARD_XTYPEPROVIDER2(classname, baseclass1, baseclass2)