27#include <com/sun/star/beans/PropertyValue.hpp>
44 css::uno::Any* pRet =
nullptr;
45 PropertyHashMap::iterator aHashIter(
m_aPropHashMap.find( rPropName ) );
47 pRet = &
m_aPropSeq.getArray()[ (*aHashIter).second ].Value;
53 const css::uno::Any* pRet =
nullptr;
54 PropertyHashMap::const_iterator aHashIter(
m_aPropHashMap.find( rPropName ) );
56 pRet = &
m_aPropSeq[ (*aHashIter).second ].Value;
62 css::uno::Any* pRet =
nullptr;
66 if (
auto rSecSequence =
o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pSeqAny) )
71 pRet = &
const_cast<css::uno::Sequence<css::beans::PropertyValue> &
>(*rSecSequence).getArray()[ (*aHashIter).second ].Value;
80 const css::uno::Any* pRet =
nullptr;
84 if (
auto rSecSequence =
o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pSeqAny) )
89 pRet = &(*rSecSequence)[ (*aHashIter).second ].Value;
101 if (
auto rSecSequence =
o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pAny) )
103 for (
auto const &
i : *rSecSequence )
110 *pAny = rPropVal.Value;
111 if (
auto rSecSequence =
o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pAny) )
113 for ( sal_Int32
i = 0;
i < rSecSequence->getLength();
i++ )
115 beans::PropertyValue
const & rPropVal2 = (*rSecSequence)[
i ];
123 [&rPropVal](beans::PropertyValue
const& rVal)
124 {
return rVal.Name == rPropVal.Name; } ));
138 *pAny = rPropVal.Value;
142 if( pSeqAny ==
nullptr )
144 css::uno::Sequence < beans::PropertyValue >
aSeq;
145 beans::PropertyValue aValue;
146 aValue.Name = rSequenceName;
147 aValue.Value <<=
aSeq;
150 [&rSequenceName](beans::PropertyValue
const& rV)
151 {
return rV.Name == rSequenceName; } ));
155 pPropSeq[
nIndex ] = aValue;
158 pSeqAny = &pPropSeq[
nIndex ].Value;
161 if (
auto pSecSequence =
o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pSeqAny))
163 PropertyPairHashMap::iterator aHashIter(
165 auto& rSeq =
const_cast<css::uno::Sequence<css::beans::PropertyValue>&
>(*pSecSequence);
168 rSeq.getArray()[(*aHashIter).second].Value = rPropVal.Value;
172 const sal_Int32
nCount = pSecSequence->getLength();
174 rSeq.getArray()[
nCount] = rPropVal;
188 PropertyHashMap::iterator aHashIter(
m_aPropHashMap.find( rPropName ) );
193 css::uno::Any& rSeqAny = pPropSeq[(*aHashIter).second].Value;
194 if (
auto pSecSequence
197 for (
const auto& rPropVal : *pSecSequence)
207 sal_Int32
nIndex = (*aHashIter).second;
211 (*aHashIter2).second =
nIndex;
226 if( !SfxPoolItem::operator==( rCmp ))
264 if( hash.has_value())
283 if ( ePresentation == SfxItemPresentation::Complete )
288 else if ( ePresentation == SfxItemPresentation::Nameless )
306 css::uno::Sequence< css::beans::PropertyValue > propSeq;
307 if ( ! ( rVal >>= propSeq ) )
324 const beans::PropertyValue& rPropVal =
m_aPropSeq[
i ];
325 std::pair<PropertyHashMap::iterator, bool>
const ret(
330 throw uno::RuntimeException(
331 "CustomShapeGeometry has duplicate property " + rPropVal.Name);
333 if (
auto rPropSeq =
o3tl::tryAccess<uno::Sequence<beans::PropertyValue>>(
336 for ( sal_Int32 j = 0; j < rPropSeq->getLength(); j++ )
338 beans::PropertyValue
const & rPropVal2 = (*rPropSeq)[ j ];
virtual SdrCustomShapeGeometryItem * Clone(SfxItemPool *pPool=nullptr) const override
css::uno::Sequence< css::beans::PropertyValue > m_aPropSeq
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
void SetPropertyValue(const css::beans::PropertyValue &rPropVal)
virtual bool operator<(const SfxPoolItem &) const override
PropertyPairHashMap m_aPropPairHashMap
css::uno::Any * GetPropertyValueByName(const OUString &rPropName)
virtual ~SdrCustomShapeGeometryItem() override
void ClearPropertyValue(const OUString &rPropertyName)
PropertyHashMap m_aPropHashMap
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)