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 --- linguistic/source/lngopt.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'linguistic/source') diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index f7d7e4c0bf29..ac9f0678ffaf 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -220,7 +220,7 @@ void SAL_CALL LinguProps::setPropertyValue( { MutexGuard aGuard( GetLinguMutex() ); - const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName ); + const SfxItemPropertyMapEntry* pCur = aPropertyMap.getByName( rPropertyName ); if (pCur) { Any aOld( aConfig.GetProperty( pCur->nWID ) ); @@ -239,7 +239,7 @@ Any SAL_CALL LinguProps::getPropertyValue( const OUString& rPropertyName ) Any aRet; - const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName ); + const SfxItemPropertyMapEntry* pCur = aPropertyMap.getByName( rPropertyName ); if(pCur) { aRet = aConfig.GetProperty( pCur->nWID ); @@ -256,7 +256,7 @@ void SAL_CALL LinguProps::addPropertyChangeListener( if (!bDisposing && rxListener.is()) { - const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName ); + const SfxItemPropertyMapEntry* pCur = aPropertyMap.getByName( rPropertyName ); if(pCur) aPropListeners.addInterface( pCur->nWID, rxListener ); } @@ -270,7 +270,7 @@ void SAL_CALL LinguProps::removePropertyChangeListener( if (!bDisposing && rxListener.is()) { - const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName ); + const SfxItemPropertyMapEntry* pCur = aPropertyMap.getByName( rPropertyName ); if(pCur) aPropListeners.removeInterface( pCur->nWID, rxListener ); } @@ -319,9 +319,9 @@ Sequence< PropertyValue > SAL_CALL std::vector aProps; aProps.reserve(aPropertyMap.getPropertyEntries().size()); - for(auto & rPair : aPropertyMap.getPropertyEntries()) - aProps.push_back(PropertyValue(OUString(rPair.first), rPair.second.nWID, - aConfig.GetProperty(rPair.second.nWID), + for(auto pEntry : aPropertyMap.getPropertyEntries()) + aProps.push_back(PropertyValue(pEntry->aName, pEntry->nWID, + aConfig.GetProperty(pEntry->nWID), css::beans::PropertyState_DIRECT_VALUE)); return comphelper::containerToSequence(aProps); } -- cgit