summaryrefslogtreecommitdiff
path: root/linguistic
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 /linguistic
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 'linguistic')
-rw-r--r--linguistic/source/lngopt.cxx14
1 files changed, 7 insertions, 7 deletions
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<PropertyValue> 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);
}