summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-04-12 09:21:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-15 15:53:25 +0200
commit6c934d0feb6a391fda0939e8db5d12aafeb93cc6 (patch)
tree6d256b92dc7913cfd195b199440e90226c772413 /reportdesign
parent6c9a86a6392662f1115d3fe6b793a451101429b7 (diff)
store ptr to the original entries in SfxItemPropertyMap
instead of copying them to a new data structure that is practically identical. Helps startup time since we build a ton of these when loading documents. And use o3tl::sorted_vector as a dense map data structure to reduce allocations and improve cache friendliness, since this is a build-once thing. Change-Id: I950be03b1a21c0c81c40f2677d4215f5e8e256cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114015 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 14262558618c..1981b229e567 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -276,15 +276,15 @@ namespace
uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
- for (const auto& rProp : rPropertyMap.getPropertyEntries())
+ for (const auto pProp : rPropertyMap.getPropertyEntries())
{
- if ( xInfo->hasPropertyByName(OUString(rProp.first)) )
+ if ( xInfo->hasPropertyByName(pProp->aName) )
{
- const SfxPoolItem* pItem = _rItemSet.GetItem(rProp.second.nWID);
+ const SfxPoolItem* pItem = _rItemSet.GetItem(pProp->nWID);
if ( pItem )
{
- ::std::unique_ptr<SfxPoolItem> pClone(pItem->CloneSetWhich(rProp.second.nWID));
- pClone->PutValue(_xShape->getPropertyValue(OUString(rProp.first)), rProp.second.nMemberId);
+ ::std::unique_ptr<SfxPoolItem> pClone(pItem->CloneSetWhich(pProp->nWID));
+ pClone->PutValue(_xShape->getPropertyValue(pProp->aName), pProp->nMemberId);
_rItemSet.Put(std::move(pClone));
}
}
@@ -296,20 +296,20 @@ namespace
const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
- for (const auto& rProp : rPropertyMap.getPropertyEntries())
+ for (const auto pProp : rPropertyMap.getPropertyEntries())
{
- if ( SfxItemState::SET == _rItemSet.GetItemState(rProp.second.nWID) && xInfo->hasPropertyByName(OUString(rProp.first)) )
+ if ( SfxItemState::SET == _rItemSet.GetItemState(pProp->nWID) && xInfo->hasPropertyByName(pProp->aName) )
{
- if ( ( rProp.second.nFlags & beans::PropertyAttribute::READONLY ) != beans::PropertyAttribute::READONLY )
+ if ( ( pProp->nFlags & beans::PropertyAttribute::READONLY ) != beans::PropertyAttribute::READONLY )
{
- const SfxPoolItem* pItem = _rItemSet.GetItem(rProp.second.nWID);
+ const SfxPoolItem* pItem = _rItemSet.GetItem(pProp->nWID);
if ( pItem )
{
uno::Any aValue;
- pItem->QueryValue(aValue,rProp.second.nMemberId);
+ pItem->QueryValue(aValue, pProp->nMemberId);
try
{
- _xShape->setPropertyValue(OUString(rProp.first), aValue);
+ _xShape->setPropertyValue(pProp->aName, aValue);
}
catch(uno::Exception&)
{ // shapes have a bug so we ignore this one.