26#include <com/sun/star/beans/PropertyAttribute.hpp>
27#include <com/sun/star/lang/IllegalArgumentException.hpp>
41 for (
const auto & pEntry : pEntries)
43 assert(!pEntry.aName.isEmpty() &&
"empty name? might be something left an empty entry at the end of this array");
60 return lhs->
aName < rhs;
64 return lhs < rhs->
aName;
68 if (it ==
m_aMap.
end() || Compare()(rName, *it))
78 beans::Property* pPropArray =
m_aPropSeq.getArray();
82 pPropArray[
n].Name = pEntry->aName;
83 pPropArray[
n].Handle = pEntry->nWID;
84 pPropArray[
n].Type = pEntry->aType;
85 pPropArray[
n].Attributes =
86 sal::static_int_cast< sal_Int16 >(pEntry->nFlags);
98 throw UnknownPropertyException(rName);
99 beans::Property aProp;
101 aProp.Handle = pEntry->
nWID;
102 aProp.Type = pEntry->
aType;
103 aProp.Attributes = sal::static_int_cast< sal_Int16 >(pEntry->
nFlags);
129 else if(0 == (rEntry.
nFlags & PropertyAttribute::MAYBEVOID))
132 "Property not found in ItemSet but not MAYBEVOID?",
nullptr);
136 if( rEntry.
aType.getTypeClass() == TypeClass_ENUM &&
137 rAny.getValueTypeClass() == TypeClass_LONG )
139 sal_Int32 nTmp = *o3tl::forceAccess<sal_Int32>(rAny);
140 rAny.setValue( &nTmp, rEntry.
aType );
150 throw UnknownPropertyException(rName);
168 std::unique_ptr<SfxPoolItem> pNewItem;
174 pNewItem.reset(pItem->
Clone());
178 if( !pNewItem->PutValue( aVal, rEntry.
nMemberId ) )
180 throw IllegalArgumentException();
183 rSet.
Put( std::move(pNewItem) );
194 throw UnknownPropertyException(rName);
202 PropertyState eRet = PropertyState_DIRECT_VALUE;
203 sal_uInt16 nWhich = rEntry.
nWID;
209 eRet = PropertyState_DEFAULT_VALUE;
211 eRet = PropertyState_AMBIGUOUS_VALUE;
217 PropertyState eRet = PropertyState_DIRECT_VALUE;
221 if( !pEntry || !pEntry->
nWID )
223 throw UnknownPropertyException(rName);
225 sal_uInt16 nWhich = pEntry->
nWID;
231 eRet = PropertyState_DEFAULT_VALUE;
233 eRet = PropertyState_AMBIGUOUS_VALUE;
250 : m_aOwnMap( pEntries )
277 for (
const auto & rEntry : pEntries )
279 assert(!rEntry.
aName.isEmpty() &&
"empty name? might be something left an empty entry at the end of this array");
282 for(
const auto & rProp : rPropSeq )
286 sal::static_int_cast< sal_Int16 >( rProp.Handle ),
303 beans::Property* pPropArray =
m_aPropSeq.getArray();
307 pPropArray[
n].Name = rEntry.
aName;
308 pPropArray[
n].Handle = rEntry.
nWID;
309 pPropArray[
n].Type = rEntry.
aType;
310 pPropArray[
n].Attributes =
311 sal::static_int_cast< sal_Int16 >(rEntry.
nFlags);
323 throw UnknownPropertyException(rPropertyName);
324 beans::Property aProp;
325 aProp.Name = rPropertyName;
326 aProp.Handle = pEntry->
nWID;
327 aProp.Type = pEntry->
aType;
328 aProp.Attributes = sal::static_int_cast< sal_Int16 >(pEntry->
nFlags);
334 return getByName(rPropertyName) !=
nullptr;
343 return lhs.
aName < rhs;
347 return lhs < rhs.
aName;
351 if (it ==
maMap.
end() || Compare()(rName, *it))
virtual sal_Bool SAL_CALL hasPropertyByName(const OUString &Name) override
css::uno::Sequence< css::beans::Property > m_aPropSeq
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
virtual css::beans::Property SAL_CALL getPropertyByName(const OUString &aName) override
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties() override
virtual ~SfxExtItemPropertySetInfo() override
o3tl::sorted_vector< SfxItemPropertyMapEntry, SfxItemPropertyMapCompare2 > maMap
SfxExtItemPropertySetInfo(o3tl::span< const SfxItemPropertyMapEntry > pMap, const css::uno::Sequence< css::beans::Property > &rPropSeq)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
static bool IsWhich(sal_uInt16 nId)
css::uno::Sequence< css::beans::Property > const & getProperties() const
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
SfxItemPropertyMap(o3tl::span< const SfxItemPropertyMapEntry > pEntries)
css::uno::Sequence< css::beans::Property > m_aPropSeq
bool hasPropertyByName(std::u16string_view rName) const
css::beans::Property getPropertyByName(const OUString &rName) const
o3tl::sorted_vector< const SfxItemPropertyMapEntry *, SfxItemPropertyMapCompare > m_aMap
virtual ~SfxItemPropertySetInfo() override
virtual sal_Bool SAL_CALL hasPropertyByName(const OUString &Name) override
SfxItemPropertySetInfo(const SfxItemPropertyMap &rMap)
virtual css::beans::Property SAL_CALL getPropertyByName(const OUString &aName) override
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties() override
SfxItemPropertyMap m_aOwnMap
css::beans::PropertyState getPropertyState(const OUString &rName, const SfxItemSet &rSet) const
css::uno::Reference< css::beans::XPropertySetInfo > m_xInfo
void setPropertyValue(const SfxItemPropertyMapEntry &rEntry, const css::uno::Any &aVal, SfxItemSet &rSet) const
SfxItemPropertyMap m_aMap
void getPropertyValue(const SfxItemPropertyMapEntry &rEntry, const SfxItemSet &rSet, css::uno::Any &rAny) const
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
const_iterator begin() const
void reserve(size_type amount)
const_iterator end() const
std::pair< const_iterator, bool > insert(Value &&x)
constexpr size_type size() const noexcept
SfxItemState
These values have to match the values in the css::frame::status::ItemState IDL to be found at offapi/...
@ DEFAULT
Specifies that the property is currently in a default state.
@ SET
The property has been explicitly set to a given value hence we know we are not taking the default val...
map a property between beans::XPropertySet and SfxPoolItem
sal_uInt8 nMemberId
"member ID" to tell QueryValue/PutValue which property it is (when multiple properties map to the sam...
OUString aName
name of property
sal_uInt16 nWID
WhichId of SfxPoolItem.
css::uno::Type aType
UNO type of property.
sal_Int16 nFlags
flag bitmap,