summaryrefslogtreecommitdiff
path: root/sw/source/core/access/accpara.cxx
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 /sw/source/core/access/accpara.cxx
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 'sw/source/core/access/accpara.cxx')
-rw-r--r--sw/source/core/access/accpara.cxx18
1 files changed, 9 insertions, 9 deletions
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 )