27#include <com/sun/star/beans/PropertyValue.hpp>
45 css::uno::Any* pRet =
nullptr;
46 PropertyHashMap::iterator aHashIter(
aPropHashMap.find( rPropName ) );
48 pRet = &
aPropSeq.getArray()[ (*aHashIter).second ].Value;
54 const css::uno::Any* pRet =
nullptr;
55 PropertyHashMap::const_iterator aHashIter(
aPropHashMap.find( rPropName ) );
57 pRet = &
aPropSeq[ (*aHashIter).second ].Value;
63 css::uno::Any* pRet =
nullptr;
67 if (
auto rSecSequence =
o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pSeqAny) )
72 pRet = &
const_cast<css::uno::Sequence<css::beans::PropertyValue> &
>(*rSecSequence).getArray()[ (*aHashIter).second ].Value;
81 const css::uno::Any* pRet =
nullptr;
85 if (
auto rSecSequence =
o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pSeqAny) )
90 pRet = &(*rSecSequence)[ (*aHashIter).second ].Value;
102 if (
auto rSecSequence =
o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pAny) )
104 for (
auto const &
i : *rSecSequence )
111 *pAny = rPropVal.Value;
112 if (
auto rSecSequence =
o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pAny) )
114 for ( sal_Int32
i = 0;
i < rSecSequence->getLength();
i++ )
116 beans::PropertyValue
const & rPropVal2 = (*rSecSequence)[
i ];
124 [&rPropVal](beans::PropertyValue
const& rVal)
125 {
return rVal.Name == rPropVal.Name; } ));
139 *pAny = rPropVal.Value;
143 if( pSeqAny ==
nullptr )
145 css::uno::Sequence < beans::PropertyValue >
aSeq;
146 beans::PropertyValue aValue;
147 aValue.Name = rSequenceName;
148 aValue.Value <<=
aSeq;
151 [&rSequenceName](beans::PropertyValue
const& rV)
152 {
return rV.Name == rSequenceName; } ));
155 auto pPropSeq =
aPropSeq.getArray();
156 pPropSeq[
nIndex ] = aValue;
159 pSeqAny = &pPropSeq[
nIndex ].Value;
162 if (
auto pSecSequence =
o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pSeqAny))
164 PropertyPairHashMap::iterator aHashIter(
166 auto& rSeq =
const_cast<css::uno::Sequence<css::beans::PropertyValue>&
>(*pSecSequence);
169 rSeq.getArray()[(*aHashIter).second].Value = rPropVal.Value;
173 const sal_Int32
nCount = pSecSequence->getLength();
175 rSeq.getArray()[
nCount] = rPropVal;
189 PropertyHashMap::iterator aHashIter(
aPropHashMap.find( rPropName ) );
193 auto pPropSeq =
aPropSeq.getArray();
194 css::uno::Any& rSeqAny = pPropSeq[(*aHashIter).second].Value;
195 if (
auto pSecSequence
198 for (
const auto& rPropVal : *pSecSequence)
208 sal_Int32
nIndex = (*aHashIter).second;
212 (*aHashIter2).second =
nIndex;
227 if( !SfxPoolItem::operator==( rCmp ))
265 if( hash.has_value())
284 if ( ePresentation == SfxItemPresentation::Complete )
289 else if ( ePresentation == SfxItemPresentation::Nameless )
307 css::uno::Sequence< css::beans::PropertyValue > propSeq;
308 if ( ! ( rVal >>= propSeq ) )
323 for ( sal_Int32
i = 0;
i <
aPropSeq.getLength();
i++ )
325 const beans::PropertyValue& rPropVal =
aPropSeq[
i ];
326 std::pair<PropertyHashMap::iterator, bool>
const ret(
331 throw uno::RuntimeException(
332 "CustomShapeGeometry has duplicate property " + rPropVal.Name);
334 if (
auto rPropSeq =
o3tl::tryAccess<uno::Sequence<beans::PropertyValue>>(
337 for ( sal_Int32 j = 0; j < rPropSeq->getLength(); j++ )
339 beans::PropertyValue
const & rPropVal2 = (*rPropSeq)[ j ];
virtual SdrCustomShapeGeometryItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
std::pair< const OUString, const OUString > PropertyPair
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &) const override
PropertyPairHashMap aPropPairHashMap
void SetPropertyValue(const css::beans::PropertyValue &rPropVal)
virtual bool operator<(const SfxPoolItem &) const override
PropertyHashMap aPropHashMap
css::uno::Any * GetPropertyValueByName(const OUString &rPropName)
virtual ~SdrCustomShapeGeometryItem() override
css::uno::Sequence< css::beans::PropertyValue > aPropSeq
void ClearPropertyValue(const OUString &rPropertyName)
void SetPropSeq(const css::uno::Sequence< css::beans::PropertyValue > &rPropSeq)
SdrCustomShapeGeometryItem()
virtual bool operator==(const SfxPoolItem &) const override
Sequence< sal_Int8 > aSeq
std::optional< size_t > anyToHash(uno::Any const &value)
bool anyLess(css::uno::Any const &lhs, css::uno::Any const &rhs)
std::enable_if<!(detail::IsDerivedReference< T >::value||detail::IsUnoSequenceType< T >::value||std::is_base_of< css::uno::XInterface, T >::value), typenamedetail::Optional< T >::type >::type tryAccess(css::uno::Any const &any)
constexpr TypedWhichId< SdrCustomShapeGeometryItem > SDRATTR_CUSTOMSHAPE_GEOMETRY(SDRATTR_CUSTOMSHAPE_FIRST+2)