// ::cppu::IPropertyArrayHelper
sal_Bool UnoPropertyArrayHelper::fillPropertyMembersByHandle( OUString * pPropName, sal_Int16 * pAttributes, sal_Int32 nPropId )
{
sal_uInt16 id = sal::static_int_cast< sal_uInt16 >(nPropId); bool bValid = ImplHasProperty( id ); if ( bValid )
{ if ( pPropName )
*pPropName = GetPropertyName( id ); if ( pAttributes )
*pAttributes = GetPropertyAttribs( id );
} return bValid;
}
css::uno::Sequence< css::beans::Property > UnoPropertyArrayHelper::getProperties()
{ // Sort by names ...
std::map<OUString, sal_uInt16> aSortedPropsIds; for (constauto& rId : maIDs)
{
sal_uInt16 nId = sal::static_int_cast< sal_uInt16 >(rId);
aSortedPropsIds.emplace(GetPropertyName( nId ), nId);
if ( nId == BASEPROPERTY_FONTDESCRIPTOR )
{ // single properties ... for ( sal_uInt16 i = BASEPROPERTY_FONTDESCRIPTORPART_START; i <= BASEPROPERTY_FONTDESCRIPTORPART_END; i++ )
aSortedPropsIds.emplace(GetPropertyName( i ), i);
}
}
sal_uInt32 nProps = aSortedPropsIds.size(); // could be more now
css::uno::Sequence< css::beans::Property> aProps( nProps );
css::beans::Property* pProps = aProps.getArray();
sal_uInt32 n = 0; for ( constauto& rPropIds : aSortedPropsIds )
{
sal_uInt16 nId = rPropIds.second;
pProps[n].Name = rPropIds.first;
pProps[n].Handle = nId;
pProps[n].Type = *GetPropertyType( nId );
pProps[n].Attributes = GetPropertyAttribs( nId );
++n;
}
return aProps;
}
css::beans::Property UnoPropertyArrayHelper::getPropertyByName(const OUString& rPropertyName)
{
css::beans::Property aProp;
sal_uInt16 nId = GetPropertyId( rPropertyName ); if ( ImplHasProperty( nId ) )
{
aProp.Name = rPropertyName;
aProp.Handle = -1;
aProp.Type = *GetPropertyType( nId );
aProp.Attributes = GetPropertyAttribs( nId );
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.