little optimization in accelerators

remove double calls

Change-Id: I4242067bdc0fdcc5184d555bb293f17d66965fb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147094
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
This commit is contained in:
Juergen Funk
2023-02-15 12:25:10 +01:00
committed by Samuel Mehrbrodt
parent c6dffdf014
commit 038f0b06a2
2 changed files with 2 additions and 4 deletions

View File

@@ -116,7 +116,6 @@ void AcceleratorCache::removeCommand(const OUString& sCommand)
{
removeKey(lKey);
}
m_lCommand2Keys.erase(sCommand);
}
} // namespace framework

View File

@@ -614,10 +614,9 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeKeyEvent(const css::awt::K
if (rPrimaryCache.hasKey(aKeyEvent))
{
OUString sDelCommand = rPrimaryCache.getCommandByKey(aKeyEvent);
if (!sDelCommand.isEmpty())
OUString sOriginalCommand = rPrimaryCache.getCommandByKey(aKeyEvent);
if (!sOriginalCommand.isEmpty())
{
OUString sOriginalCommand = rPrimaryCache.getCommandByKey(aKeyEvent);
if (rSecondaryCache.hasCommand(sOriginalCommand))
{
AcceleratorCache::TKeyList lSecondaryKeys = rSecondaryCache.getKeysByCommand(sOriginalCommand);