summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2021-04-12 13:07:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-12 17:45:19 +0200
commitfe23e35ba5705d7f51f69c3f4e7ccd6c5b575a6b (patch)
treebace053173689b600f8b6a75145e07cc2b933743 /reportdesign
parent27911b0455d8dcc08a0702372492a6ce00250cb7 (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 'reportdesign')
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx24
1 files changed, 11 insertions, 13 deletions
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 92785547d4d3..14262558618c 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -276,16 +276,15 @@ namespace
uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
- PropertyEntryVector_t aPropVector = rPropertyMap.getPropertyEntries();
- for (const auto& rProp : aPropVector)
+ for (const auto& rProp : rPropertyMap.getPropertyEntries())
{
- if ( xInfo->hasPropertyByName(rProp.sName) )
+ if ( xInfo->hasPropertyByName(OUString(rProp.first)) )
{
- const SfxPoolItem* pItem = _rItemSet.GetItem(rProp.nWID);
+ const SfxPoolItem* pItem = _rItemSet.GetItem(rProp.second.nWID);
if ( pItem )
{
- ::std::unique_ptr<SfxPoolItem> pClone(pItem->CloneSetWhich(rProp.nWID));
- pClone->PutValue(_xShape->getPropertyValue(rProp.sName), rProp.nMemberId);
+ ::std::unique_ptr<SfxPoolItem> pClone(pItem->CloneSetWhich(rProp.second.nWID));
+ pClone->PutValue(_xShape->getPropertyValue(OUString(rProp.first)), rProp.second.nMemberId);
_rItemSet.Put(std::move(pClone));
}
}
@@ -297,21 +296,20 @@ namespace
const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
- PropertyEntryVector_t aPropVector = rPropertyMap.getPropertyEntries();
- for (const auto& rProp : aPropVector)
+ for (const auto& rProp : rPropertyMap.getPropertyEntries())
{
- if ( SfxItemState::SET == _rItemSet.GetItemState(rProp.nWID) && xInfo->hasPropertyByName(rProp.sName) )
+ if ( SfxItemState::SET == _rItemSet.GetItemState(rProp.second.nWID) && xInfo->hasPropertyByName(OUString(rProp.first)) )
{
- if ( ( rProp.nFlags & beans::PropertyAttribute::READONLY ) != beans::PropertyAttribute::READONLY )
+ if ( ( rProp.second.nFlags & beans::PropertyAttribute::READONLY ) != beans::PropertyAttribute::READONLY )
{
- const SfxPoolItem* pItem = _rItemSet.GetItem(rProp.nWID);
+ const SfxPoolItem* pItem = _rItemSet.GetItem(rProp.second.nWID);
if ( pItem )
{
uno::Any aValue;
- pItem->QueryValue(aValue,rProp.nMemberId);
+ pItem->QueryValue(aValue,rProp.second.nMemberId);
try
{
- _xShape->setPropertyValue(rProp.sName, aValue);
+ _xShape->setPropertyValue(OUString(rProp.first), aValue);
}
catch(uno::Exception&)
{ // shapes have a bug so we ignore this one.