diff options
-rw-r--r-- | editeng/source/uno/unoipset.cxx | 19 | ||||
-rw-r--r-- | include/editeng/unoipset.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopback.cxx | 4 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 4 |
4 files changed, 17 insertions, 14 deletions
diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index 8c76af4c45f6..aa6f310c1987 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -37,6 +37,7 @@ using namespace ::com::sun::star; struct SvxIDPropertyCombine { sal_uInt16 nWID; + sal_uInt8 memberId; uno::Any aAny; }; @@ -54,21 +55,23 @@ SvxItemPropertySet::~SvxItemPropertySet() } -uno::Any* SvxItemPropertySet::GetUsrAnyForID(sal_uInt16 nWID) const +uno::Any* SvxItemPropertySet::GetUsrAnyForID(SfxItemPropertySimpleEntry const & entry) const { for (auto const & pActual : aCombineList) { - if( pActual->nWID == nWID ) + if( pActual->nWID == entry.nWID && pActual->memberId == entry.nMemberId ) return &pActual->aAny; } return nullptr; } -void SvxItemPropertySet::AddUsrAnyForID(const uno::Any& rAny, sal_uInt16 nWID) +void SvxItemPropertySet::AddUsrAnyForID( + const uno::Any& rAny, SfxItemPropertySimpleEntry const & entry) { std::unique_ptr<SvxIDPropertyCombine> pNew(new SvxIDPropertyCombine); - pNew->nWID = nWID; + pNew->nWID = entry.nWID; + pNew->memberId = entry.nMemberId; pNew->aAny = rAny; aCombineList.push_back( std::move(pNew) ); } @@ -187,7 +190,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* pMap ) const { // Already entered a value? Then finish quickly - uno::Any* pUsrAny = GetUsrAnyForID(pMap->nWID); + uno::Any* pUsrAny = GetUsrAnyForID(*pMap); if(pUsrAny) return *pUsrAny; @@ -213,7 +216,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* if(eState >= SfxItemState::DEFAULT && pItem) { pItem->QueryValue( aVal, nMemberId ); - const_cast<SvxItemPropertySet*>(this)->AddUsrAnyForID(aVal, pMap->nWID); + const_cast<SvxItemPropertySet*>(this)->AddUsrAnyForID(aVal, *pMap); } } @@ -238,9 +241,9 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const uno::Any& rVal ) const { - uno::Any* pUsrAny = GetUsrAnyForID(pMap->nWID); + uno::Any* pUsrAny = GetUsrAnyForID(*pMap); if(!pUsrAny) - const_cast<SvxItemPropertySet*>(this)->AddUsrAnyForID(rVal, pMap->nWID); + const_cast<SvxItemPropertySet*>(this)->AddUsrAnyForID(rVal, *pMap); else *pUsrAny = rVal; } diff --git a/include/editeng/unoipset.hxx b/include/editeng/unoipset.hxx index d32fc76cd657..c05ff656ee9c 100644 --- a/include/editeng/unoipset.hxx +++ b/include/editeng/unoipset.hxx @@ -53,8 +53,8 @@ public: void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const css::uno::Any& rVal ) const; bool AreThereOwnUsrAnys() const { return ! aCombineList.empty(); } - css::uno::Any* GetUsrAnyForID(sal_uInt16 nWID) const; - void AddUsrAnyForID(const css::uno::Any& rAny, sal_uInt16 nWID); + css::uno::Any* GetUsrAnyForID(SfxItemPropertySimpleEntry const & entry) const; + void AddUsrAnyForID(const css::uno::Any& rAny, SfxItemPropertySimpleEntry const & entry); void ClearAllUsrAny(); css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const; diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index 88c2c6fb5554..09fd1309a2a6 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -105,7 +105,7 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet ) for( const auto& rProp : aProperties ) { - uno::Any* pAny = mpPropSet->GetUsrAnyForID( rProp.nWID ); + uno::Any* pAny = mpPropSet->GetUsrAnyForID( rProp ); if( pAny ) { OUString aPropertyName( rProp.sName ); @@ -343,7 +343,7 @@ beans::PropertyState SAL_CALL SdUnoPageBackground::getPropertyState( const OUStr } else { - if( nullptr == mpPropSet->GetUsrAnyForID(pEntry->nWID) ) + if( nullptr == mpPropSet->GetUsrAnyForID(*pEntry) ) return beans::PropertyState_DEFAULT_VALUE; else return beans::PropertyState_DIRECT_VALUE; diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index c34c3a153307..5fa3200ceb9d 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -611,7 +611,7 @@ static void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemProper const sal_uInt16 nWID = rSrcProp.nWID; if(SfxItemPool::IsWhich(nWID) && (nWID < OWN_ATTR_VALUE_START || nWID > OWN_ATTR_VALUE_END) - && rPropSet.GetUsrAnyForID(nWID)) + && rPropSet.GetUsrAnyForID(rSrcProp)) rSet.Put(rSet.GetPool()->GetDefaultItem(nWID)); } @@ -619,7 +619,7 @@ static void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemProper { if(rSrcProp.nWID) { - uno::Any* pUsrAny = rPropSet.GetUsrAnyForID(rSrcProp.nWID); + uno::Any* pUsrAny = rPropSet.GetUsrAnyForID(rSrcProp); if(pUsrAny) { // search for equivalent entry in pDst |