diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-10-18 21:24:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-19 09:28:38 +0200 |
commit | c1c6eea1c11d9711e101fc76efa0ec4460e8e448 (patch) | |
tree | 079d47b487d4bc6c948d04796e41211b908d1870 /framework | |
parent | b7e7fee238dc250e7ab6e8e8fef4a6b15430c90c (diff) |
Following 3abbb1486f09b377084c3232a921772302ab34ec
Not need to use Sequences here
Change-Id: I2507566f5939dbdcb5d2ab420f16a55d4cc403b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123765
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/accelerators/acceleratorconfiguration.cxx | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index efa200556fda..2f1d6000fd28 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -1010,29 +1010,28 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( bool bPreferred, const css: OUString sKeyCommand = sKey.getToken(0, '_', nIndex); aKeyEvent.KeyCode = KeyMapping::get().mapIdentifierToCode("KEY_" + sKeyCommand); - css::uno::Sequence< OUString > sToken(4); const sal_Int32 nToken = 4; bool bValid = true; - sal_Int32 k; - for (k=0; k<nToken; ++k) + sal_Int32 k=0; + for (OUString sToken; k<nToken; ++k) { if (nIndex < 0) break; - sToken[k] = sKey.getToken(0, '_', nIndex); - if (sToken[k].isEmpty()) + sToken = sKey.getToken(0, '_', nIndex); + if (sToken.isEmpty()) { bValid = false; break; } - if ( sToken[k] == "SHIFT" ) + if ( sToken == "SHIFT" ) aKeyEvent.Modifiers |= css::awt::KeyModifier::SHIFT; - else if ( sToken[k] == "MOD1" ) + else if ( sToken == "MOD1" ) aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD1; - else if ( sToken[k] == "MOD2" ) + else if ( sToken == "MOD2" ) aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD2; - else if ( sToken[k] == "MOD3" ) + else if ( sToken == "MOD3" ) aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD3; else { @@ -1224,21 +1223,21 @@ void XCUBasedAcceleratorConfiguration::reloadChanged( const OUString& sPrimarySe sKeyIdentifier = sKey.getToken(0, '_', nIndex); aKeyEvent.KeyCode = KeyMapping::get().mapIdentifierToCode("KEY_"+sKeyIdentifier); - css::uno::Sequence< OUString > sToken(4); - const sal_Int32 nToken = 4; - for (sal_Int32 i=0; i<nToken; ++i) + const int nToken = 4; + sal_Int32 i = 0; + for (OUString sToken; i<nToken; ++i) { if ( nIndex < 0 ) break; - sToken[i] = sKey.getToken(0, '_', nIndex); - if ( sToken[i] == "SHIFT" ) + sToken = sKey.getToken(0, '_', nIndex); + if ( sToken == "SHIFT" ) aKeyEvent.Modifiers |= css::awt::KeyModifier::SHIFT; - else if ( sToken[i] == "MOD1" ) + else if ( sToken == "MOD1" ) aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD1; - else if ( sToken[i] == "MOD2" ) + else if ( sToken == "MOD2" ) aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD2; - else if ( sToken[i] == "MOD3" ) + else if ( sToken == "MOD3" ) aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD3; } |