summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2021-06-15 09:02:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-06-15 10:21:58 +0200
commit2bccb7e67b637c6312a0df610f870c8621eb296f (patch)
tree3e74571e899f4f2a3374ff64ade4c1ba804efc08 /framework
parent86dc8e1f6273354eaf663299a028d896ad88cc9b (diff)
remove some unnecessary LanguageType copies
Change-Id: Iec4374627c931ccecf05a712682ed18ef90bf359 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117208 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uiconfiguration/uicategorydescription.cxx8
-rw-r--r--framework/source/uielement/uicommanddescription.cxx26
2 files changed, 17 insertions, 17 deletions
diff --git a/framework/source/uiconfiguration/uicategorydescription.cxx b/framework/source/uiconfiguration/uicategorydescription.cxx
index 218032c5238e..1e747fa13255 100644
--- a/framework/source/uiconfiguration/uicategorydescription.cxx
+++ b/framework/source/uiconfiguration/uicategorydescription.cxx
@@ -365,18 +365,18 @@ public:
UICategoryDescription::UICategoryDescription( const Reference< XComponentContext >& rxContext ) :
UICommandDescription(rxContext,true)
{
- LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
+ const LanguageTag& rCurrentLanguage = SvtSysLocale().GetUILanguageTag();
Reference< XNameAccess > xEmpty;
OUString aGenericCategories( "GenericCategories" );
- m_xGenericUICommands[aCurrentLanguage] = new ConfigurationAccess_UICategory( aGenericCategories, xEmpty, rxContext );
+ m_xGenericUICommands[rCurrentLanguage] = new ConfigurationAccess_UICategory( aGenericCategories, xEmpty, rxContext );
// insert generic categories mappings
m_aModuleToCommandFileMap.emplace( OUString("generic"), aGenericCategories );
- auto& rMap = m_aUICommandsHashMap[aCurrentLanguage];
+ auto& rMap = m_aUICommandsHashMap[rCurrentLanguage];
UICommandsHashMap::iterator pCatIter = rMap.find( aGenericCategories );
if ( pCatIter != rMap.end() )
- pCatIter->second = m_xGenericUICommands[aCurrentLanguage];
+ pCatIter->second = m_xGenericUICommands[rCurrentLanguage];
impl_fillElements("ooSetupFactoryCmdCategoryConfigRef");
}
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx
index 4d9fccf5af41..ca9d929435f8 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -574,17 +574,17 @@ UICommandDescription::UICommandDescription(const Reference< XComponentContext >&
, m_aPrivateResourceURL(PRIVATE_RESOURCE_URL)
, m_xContext(rxContext)
{
- LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
+ const LanguageTag& rCurrentLanguage = SvtSysLocale().GetUILanguageTag();
- ensureGenericUICommandsForLanguage(aCurrentLanguage);
+ ensureGenericUICommandsForLanguage(rCurrentLanguage);
impl_fillElements("ooSetupFactoryCommandConfigRef");
// insert generic commands
- auto& rMap = m_aUICommandsHashMap[aCurrentLanguage];
+ auto& rMap = m_aUICommandsHashMap[rCurrentLanguage];
UICommandsHashMap::iterator pIter = rMap.find( "GenericCommands" );
if ( pIter != rMap.end() )
- pIter->second = m_xGenericUICommands[aCurrentLanguage];
+ pIter->second = m_xGenericUICommands[rCurrentLanguage];
}
UICommandDescription::UICommandDescription(const Reference< XComponentContext >& rxContext, bool)
@@ -624,8 +624,8 @@ void UICommandDescription::impl_fillElements(const char* _pName)
m_aModuleToCommandFileMap.emplace( aModuleIdentifier, aCommandStr );
// Create second mapping Command File ==> commands instance
- LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
- auto& rMap = m_aUICommandsHashMap[aCurrentLanguage];
+ const LanguageTag& rCurrentLanguage = SvtSysLocale().GetUILanguageTag();
+ auto& rMap = m_aUICommandsHashMap[rCurrentLanguage];
UICommandsHashMap::iterator pIter = rMap.find( aCommandStr );
if ( pIter == rMap.end() )
rMap.emplace( aCommandStr, Reference< XNameAccess >() );
@@ -635,7 +635,7 @@ void UICommandDescription::impl_fillElements(const char* _pName)
Any SAL_CALL UICommandDescription::getByName( const OUString& aName )
{
- LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
+ const LanguageTag& rCurrentLanguage = SvtSysLocale().GetUILanguageTag();
Any a;
osl::MutexGuard g(rBHelper.rMutex);
@@ -644,11 +644,11 @@ Any SAL_CALL UICommandDescription::getByName( const OUString& aName )
if ( pM2CIter != m_aModuleToCommandFileMap.end() )
{
OUString aCommandFile( pM2CIter->second );
- auto pMapIter = m_aUICommandsHashMap.find( aCurrentLanguage );
+ auto pMapIter = m_aUICommandsHashMap.find( rCurrentLanguage );
if ( pMapIter == m_aUICommandsHashMap.end() )
impl_fillElements("ooSetupFactoryCommandConfigRef");
- auto& rMap = m_aUICommandsHashMap[aCurrentLanguage];
+ auto& rMap = m_aUICommandsHashMap[rCurrentLanguage];
UICommandsHashMap::iterator pIter = rMap.find( aCommandFile );
if ( pIter != rMap.end() )
{
@@ -656,10 +656,10 @@ Any SAL_CALL UICommandDescription::getByName( const OUString& aName )
a <<= pIter->second;
else
{
- ensureGenericUICommandsForLanguage(aCurrentLanguage);
+ ensureGenericUICommandsForLanguage(rCurrentLanguage);
Reference< XNameAccess > xUICommands = new ConfigurationAccess_UICommand( aCommandFile,
- m_xGenericUICommands[aCurrentLanguage],
+ m_xGenericUICommands[rCurrentLanguage],
m_xContext );
pIter->second = xUICommands;
a <<= xUICommands;
@@ -668,10 +668,10 @@ Any SAL_CALL UICommandDescription::getByName( const OUString& aName )
}
else if ( !m_aPrivateResourceURL.isEmpty() && aName.startsWith( m_aPrivateResourceURL ) )
{
- ensureGenericUICommandsForLanguage(aCurrentLanguage);
+ ensureGenericUICommandsForLanguage(rCurrentLanguage);
// special keys to retrieve information about a set of commands
- return m_xGenericUICommands[aCurrentLanguage]->getByName( aName );
+ return m_xGenericUICommands[rCurrentLanguage]->getByName( aName );
}
else
{