summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-04-01 16:11:30 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-04-01 16:11:30 +0000
commit45cc745d57979346e6db98cc1c0e63ea3325a80f (patch)
treeaaf33ef7d6025126dd1e018cbdbe43f14665d3d0 /framework/source
parent7fafea425a1f608671c8818357cd7dc07eba6774 (diff)
CWS-TOOLING: integrate CWS fwk106_DEV300
2009-03-16 14:18:23 +0100 cd r269538 : #i100172#,#i100177# Move sDefaultLocale out of loop. Make variables const. 2009-03-16 13:37:17 +0100 cd r269531 : #i100172#,#i100177# Move complex objects outside the loop to fix performance problems
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/accelerators/acceleratorconfiguration.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index a2c52e9c83..ea2b1208c0 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -1205,8 +1205,8 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util:
{
::rtl::OUString sModule;
sKey = ::utl::extractFirstFromConfigurationPath(sPath);
- if ( sKey.getLength() )
- reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey);
+ if ( sKey.getLength() )
+ reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey);
}
else if ( sGlobalModules.equals(CFG_ENTRY_MODULES) )
{
@@ -1214,7 +1214,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util:
::rtl::OUString sDropModule = ::rtl::OUString::createFromAscii("Module['") + sModule + ::rtl::OUString::createFromAscii("']");
sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sDropModule);
sKey = ::utl::extractFirstFromConfigurationPath(sPath);
- if ( sKey.getLength() )
+ if ( sKey.getLength() )
reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey);
}
}
@@ -1242,6 +1242,10 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const
xModules->getByName(m_sModuleCFG) >>= xAccess;
}
+ static KeyMapping aKeyMapping;
+ const ::rtl::OUString sIsoLang = impl_ts_getLocale().toISO();
+ const ::rtl::OUString sDefaultLocale = ::rtl::OUString::createFromAscii("en-US");
+
css::uno::Reference< css::container::XNameAccess > xKey;
css::uno::Reference< css::container::XNameAccess > xCommand;
if (xAccess.is())
@@ -1263,13 +1267,12 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const
::std::vector< ::rtl::OUString >::const_iterator pFound;
for ( pFound = aLocales.begin(); pFound != aLocales.end(); ++pFound )
{
- if ( *pFound == impl_ts_getLocale().toISO() )
+ if ( *pFound == sIsoLang )
break;
}
if ( pFound == aLocales.end() )
{
- ::rtl::OUString sDefaultLocale = ::rtl::OUString::createFromAscii("en-US");
for ( pFound = aLocales.begin(); pFound != aLocales.end(); ++pFound )
{
if ( *pFound == sDefaultLocale )
@@ -1286,7 +1289,6 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const
if (sCommand.getLength()<1)
continue;
- KeyMapping aKeyMapping;
css::awt::KeyEvent aKeyEvent;
sal_Int32 nIndex = 0;