diff options
author | Noel Grandin <noel@peralex.com> | 2021-04-12 13:07:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-12 17:45:19 +0200 |
commit | fe23e35ba5705d7f51f69c3f4e7ccd6c5b575a6b (patch) | |
tree | bace053173689b600f8b6a75145e07cc2b933743 /sd/source/ui/unoidl | |
parent | 27911b0455d8dcc08a0702372492a6ce00250cb7 (diff) |
less copying in SfxItemPropertyMap::getPropertyEntries
we can just expose the map now, and avoid copying all the properties
Change-Id: Icb22975508582268dfa96e41eb98ac01e7f51317
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113982
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/unoidl')
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 11 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopback.cxx | 22 |
2 files changed, 15 insertions, 18 deletions
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 0aef28437972..02bd803cdeb9 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -2780,15 +2780,14 @@ void SdMasterPage::setBackground( const Any& rValue ) Reference< beans::XPropertySetInfo > xSetInfo( xInputSet->getPropertySetInfo(), UNO_SET_THROW ); Reference< beans::XPropertyState > xSetStates( xInputSet, UNO_QUERY ); - PropertyEntryVector_t aBackgroundProperties = ImplGetPageBackgroundPropertySet()->getPropertyMap().getPropertyEntries(); - for( const auto& rProp : aBackgroundProperties ) + for( const auto& rProp : ImplGetPageBackgroundPropertySet()->getPropertyMap().getPropertyEntries() ) { - if( xSetInfo->hasPropertyByName( rProp.sName ) ) + if( xSetInfo->hasPropertyByName( OUString(rProp.first) ) ) { - if( !xSetStates.is() || xSetStates->getPropertyState( rProp.sName ) == beans::PropertyState_DIRECT_VALUE ) - xStyleSet->setPropertyValue( rProp.sName, xInputSet->getPropertyValue( rProp.sName ) ); + if( !xSetStates.is() || xSetStates->getPropertyState( OUString(rProp.first) ) == beans::PropertyState_DIRECT_VALUE ) + xStyleSet->setPropertyValue( OUString(rProp.first), xInputSet->getPropertyValue( OUString(rProp.first) ) ); else - xSetStates->setPropertyToDefault( rProp.sName ); + xSetStates->setPropertyToDefault( OUString(rProp.first) ); } } } diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index 10aff03c05bf..60a1ac6bbe14 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -100,26 +100,24 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet ) if( mpPropSet->AreThereOwnUsrAnys() ) { - PropertyEntryVector_t aProperties = mpPropSet->getPropertyMap().getPropertyEntries(); - - for( const auto& rProp : aProperties ) + for( const auto& rProp : mpPropSet->getPropertyMap().getPropertyEntries() ) { - uno::Any* pAny = mpPropSet->GetUsrAnyForID( rProp ); + uno::Any* pAny = mpPropSet->GetUsrAnyForID( rProp.second ); if( pAny ) { - OUString aPropertyName( rProp.sName ); - switch( rProp.nWID ) + OUString aPropertyName( rProp.first ); + switch( rProp.second.nWID ) { case XATTR_FILLFLOATTRANSPARENCE : case XATTR_FILLGRADIENT : { if ( ( pAny->getValueType() == ::cppu::UnoType< css::awt::Gradient>::get() ) - && ( rProp.nMemberId == MID_FILLGRADIENT ) ) + && ( rProp.second.nMemberId == MID_FILLGRADIENT ) ) { setPropertyValue( aPropertyName, *pAny ); } else if ( ( pAny->getValueType() == ::cppu::UnoType<OUString>::get() ) && - ( rProp.nMemberId == MID_NAME ) ) + ( rProp.second.nMemberId == MID_NAME ) ) { setPropertyValue( aPropertyName, *pAny ); } @@ -128,12 +126,12 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet ) case XATTR_FILLHATCH : { if ( ( pAny->getValueType() == ::cppu::UnoType< css::drawing::Hatch>::get() ) - && ( rProp.nMemberId == MID_FILLHATCH ) ) + && ( rProp.second.nMemberId == MID_FILLHATCH ) ) { setPropertyValue( aPropertyName, *pAny ); } else if ( ( pAny->getValueType() == ::cppu::UnoType<OUString>::get() ) && - ( rProp.nMemberId == MID_NAME ) ) + ( rProp.second.nMemberId == MID_NAME ) ) { setPropertyValue( aPropertyName, *pAny ); } @@ -141,13 +139,13 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet ) break; case XATTR_FILLBITMAP : { - if (rProp.nMemberId == MID_BITMAP && + if (rProp.second.nMemberId == MID_BITMAP && (pAny->getValueType() == cppu::UnoType<css::awt::XBitmap>::get() || pAny->getValueType() == cppu::UnoType<css::graphic::XGraphic>::get())) { setPropertyValue( aPropertyName, *pAny ); } - else if (pAny->getValueType() == ::cppu::UnoType<OUString>::get() && rProp.nMemberId == MID_NAME) + else if (pAny->getValueType() == ::cppu::UnoType<OUString>::get() && rProp.second.nMemberId == MID_NAME) { setPropertyValue( aPropertyName, *pAny ); } |