Commits

Anonymous committed 0c603f7

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

Comments (0)

Files changed (1)

framework/source/accelerators/acceleratorconfiguration.cxx

         {
             ::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) )
         {
             ::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);
         }
 	}
         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())
             ::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 )
             if (sCommand.getLength()<1)
                 continue;
 
-            KeyMapping aKeyMapping;
             css::awt::KeyEvent aKeyEvent;
 
             sal_Int32 nIndex = 0;