diff options
author | Juergen Funk <juergen.funk_ml@cib.de> | 2023-02-15 12:25:10 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2023-03-20 11:37:40 +0000 |
commit | 038f0b06a2d7d90e7ea19f2233f2892d9c78a08c (patch) | |
tree | c1deeafc27a3eb03c4439d60528b5ab727c4d0b2 | |
parent | c6dffdf014127af23b0b20b1015a4b6fdf0e1ac9 (diff) |
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>
-rw-r--r-- | framework/source/accelerators/acceleratorcache.cxx | 1 | ||||
-rw-r--r-- | framework/source/accelerators/acceleratorconfiguration.cxx | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/framework/source/accelerators/acceleratorcache.cxx b/framework/source/accelerators/acceleratorcache.cxx index 0163654d4bf7..c0b819a2a9e8 100644 --- a/framework/source/accelerators/acceleratorcache.cxx +++ b/framework/source/accelerators/acceleratorcache.cxx @@ -116,7 +116,6 @@ void AcceleratorCache::removeCommand(const OUString& sCommand) { removeKey(lKey); } - m_lCommand2Keys.erase(sCommand); } } // namespace framework diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 3507314a9a6e..48e0d362026e 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -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); |