From 6c934d0feb6a391fda0939e8db5d12aafeb93cc6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 12 Apr 2021 09:21:42 +0200 Subject: 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 --- sw/source/core/access/accpara.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sw/source/core/access/accpara.cxx') diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 3939e274021e..63378702ad18 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1488,16 +1488,16 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl( { const SfxItemPropertyMap& rPropMap = aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_CURSOR )->getPropertyMap(); - for ( const auto& rPair : rPropMap.getPropertyEntries() ) + for ( const auto pEntry : rPropMap.getPropertyEntries() ) { - const SfxPoolItem* pItem = pSet->GetItem( rPair.second.nWID ); + const SfxPoolItem* pItem = pSet->GetItem( pEntry->nWID ); if ( pItem ) { uno::Any aVal; - pItem->QueryValue( aVal, rPair.second.nMemberId ); + pItem->QueryValue( aVal, pEntry->nMemberId ); PropertyValue rPropVal; - rPropVal.Name = rPair.first; + rPropVal.Name = pEntry->aName; rPropVal.Value = aVal; rPropVal.Handle = -1; rPropVal.State = beans::PropertyState_DEFAULT_VALUE; @@ -1680,18 +1680,18 @@ void SwAccessibleParagraph::_getRunAttributesImpl( const SfxItemPropertyMap& rPropMap = aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_CURSOR )->getPropertyMap(); - for ( const auto& rPair : rPropMap.getPropertyEntries() ) + for ( const auto pEntry : rPropMap.getPropertyEntries() ) { const SfxPoolItem* pItem( nullptr ); // #i82637# - Found character attributes, whose value equals the value of // the corresponding default character attributes, are excluded. - if ( aSet.GetItemState( rPair.second.nWID, true, &pItem ) == SfxItemState::SET ) + if ( aSet.GetItemState( pEntry->nWID, true, &pItem ) == SfxItemState::SET ) { uno::Any aVal; - pItem->QueryValue( aVal, rPair.second.nMemberId ); + pItem->QueryValue( aVal, pEntry->nMemberId ); PropertyValue rPropVal; - rPropVal.Name = rPair.first; + rPropVal.Name = pEntry->aName; rPropVal.Value = aVal; rPropVal.Handle = -1; rPropVal.State = PropertyState_DIRECT_VALUE; @@ -1776,7 +1776,7 @@ void SwAccessibleParagraph::_getSupplementalAttributesImpl( { const SfxItemPropertyMapEntry* pPropMap( aSwMapProvider.GetPropertyMapEntries( PROPERTY_MAP_ACCESSIBILITY_TEXT_ATTRIBUTE ) ); - while ( !pPropMap->aName.empty() ) + while ( !pPropMap->aName.isEmpty() ) { const SfxPoolItem* pItem = pSet->GetItem( pPropMap->nWID ); if ( pItem ) -- cgit v1.2.3