Commits

Anonymous committed efefcec

#i10000# corrected Version by OJ

  • Participants
  • Parent commits d9199ba

Comments (0)

Files changed (1)

File framework/source/accelerators/acceleratorconfiguration.cxx

     namespace fpc = ::framework::pattern::configuration;
 #endif
 
-    ::rtl::OUString lcl_getKeyString(const css::awt::KeyEvent& aKeyEvent)
+    ::rtl::OUString lcl_getKeyString(KeyMapping& _rKeyMapping,const css::awt::KeyEvent& aKeyEvent)
     {
-        KeyMapping aKeyMapping;
 	    const sal_Int32 nBeginIndex = 4; // "KEY_" is the prefix of a identifier...
-	    ::rtl::OUStringBuffer sKeyBuffer((aKeyMapping.mapCodeToIdentifier(aKeyEvent.KeyCode)).copy(nBeginIndex));
+	    ::rtl::OUStringBuffer sKeyBuffer((_rKeyMapping.mapCodeToIdentifier(aKeyEvent.KeyCode)).copy(nBeginIndex));
     	
 	    if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT )
 		    sKeyBuffer.appendAscii("_SHIFT");
                                 , m_pPrimaryWriteCache(0                        )
                                 , m_pSecondaryWriteCache(0                      )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::XCUBasedAcceleratorConfiguration" );
     static const ::rtl::OUString CFG_ENTRY_ACCELERATORS(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Accelerators"));
     m_xCfg = css::uno::Reference< css::container::XNameAccess > ( 
 			 ::comphelper::ConfigurationHelper::openConfig( m_xSMGR, CFG_ENTRY_ACCELERATORS, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ), 
 css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfiguration::getAllKeyEvents()
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::getAllKeyEvents" );
 	// SAFE -> ----------------------------------
 	ReadGuard aReadLock(m_aLock);
 
 	throw(css::container::NoSuchElementException,
 		  css::uno::RuntimeException            )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::getCommandByKeyEvent" );
 	// SAFE -> ----------------------------------
 	ReadGuard aReadLock(m_aLock);
 
 													throw(css::lang::IllegalArgumentException,
 													css::uno::RuntimeException         )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::setKeyEvent" );
 	RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::setKeyEvent" );
 
 	if (
 	throw(css::container::NoSuchElementException,
 		  css::uno::RuntimeException            )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::removeKeyEvent" );
 	// SAFE -> ----------------------------------
 	WriteGuard aWriteLock(m_aLock);
 
 		css::container::NoSuchElementException,
 		css::uno::RuntimeException            )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::getKeyEventsByCommand" );
 	if (!sCommand.getLength())
 		throw css::lang::IllegalArgumentException(
 				::rtl::OUString::createFromAscii("Empty command strings are not allowed here."),
 	throw(css::lang::IllegalArgumentException   ,
 		css::uno::RuntimeException            )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::getPreferredKeyEventsForCommandList" );
-	// SAFE -> ----------------------------------
+    // SAFE -> ----------------------------------
 	ReadGuard aReadLock(m_aLock);
 
 	sal_Int32                           i              = 0;
 		css::container::NoSuchElementException,
 		css::uno::RuntimeException            )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::removeCommandFromAllKeyEvents" );
 	if (!sCommand.getLength())
 		throw css::lang::IllegalArgumentException(
 				::rtl::OUString::createFromAscii("Empty command strings are not allowed here."),
 	throw(css::uno::Exception       ,
 		css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::reload" );
     RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::reload()" );
 
 	// SAFE -> ----------------------------------
 	throw(css::uno::Exception       ,
 		  css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::reload" );
     RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::store()" );
 
     // SAFE -> ----------------------------------
 	throw(css::uno::Exception       ,
 	  css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::storeToStorage" );
     // use m_aCache + old AcceleratorXMLWriter to store data directly on storage given as parameter ...  
     if (!xStorage.is())
         return;
 ::sal_Bool SAL_CALL XCUBasedAcceleratorConfiguration::isModified()
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::isModified" );
 	return sal_False;
 }
 
 ::sal_Bool SAL_CALL XCUBasedAcceleratorConfiguration::isReadOnly()
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::isReadOnly" );
 	return sal_False;
 }
 
 void SAL_CALL XCUBasedAcceleratorConfiguration::setStorage(const css::uno::Reference< css::embed::XStorage >& /*xStorage*/)
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::setStorage" );
 	LOG_WARNING("XCUBasedAcceleratorConfiguration::setStorage()", "TODO implement this HACK .-)")
 }
 
 ::sal_Bool SAL_CALL XCUBasedAcceleratorConfiguration::hasStorage()
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::hasStorage" );
 	LOG_WARNING("XCUBasedAcceleratorConfiguration::hasStorage()", "TODO implement this HACK .-)")
 		return sal_False;
 }
 void SAL_CALL XCUBasedAcceleratorConfiguration::addConfigurationListener(const css::uno::Reference< css::ui::XUIConfigurationListener >& /*xListener*/)
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::addConfigurationListener" );
 	LOG_WARNING("XCUBasedAcceleratorConfiguration::addConfigurationListener()", "TODO implement me")
 }
 
 void SAL_CALL XCUBasedAcceleratorConfiguration::removeConfigurationListener(const css::uno::Reference< css::ui::XUIConfigurationListener >& /*xListener*/)
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::removeConfigurationListener" );
 	LOG_WARNING("XCUBasedAcceleratorConfiguration::removeConfigurationListener()", "TODO implement me")
 }
 
 void SAL_CALL XCUBasedAcceleratorConfiguration::reset()
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::reset" );
 	css::uno::Reference< css::container::XNamed > xNamed(m_xCfg, css::uno::UNO_QUERY);
 	::rtl::OUString sConfig = xNamed->getName();
 	if ( sConfig.equalsAscii("Global") )
 void SAL_CALL XCUBasedAcceleratorConfiguration::addResetListener(const css::uno::Reference< css::form::XResetListener >& /*xListener*/)
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::reload" );
 	LOG_WARNING("XCUBasedAcceleratorConfiguration::addResetListener()", "TODO implement me")
 }
 
 void SAL_CALL XCUBasedAcceleratorConfiguration::removeResetListener(const css::uno::Reference< css::form::XResetListener >& /*xListener*/)
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::removeResetListener" );
 	LOG_WARNING("XCUBasedAcceleratorConfiguration::removeResetListener()", "TODO implement me")
 }
 
 void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util::ChangesEvent& aEvent)
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::changesOccurred" );
 	RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::changesOccurred()" );
 
 	css::uno::Reference< css::container::XHierarchicalNameAccess > xHAccess;
 void SAL_CALL XCUBasedAcceleratorConfiguration::disposing(const css::lang::EventObject& /*aSource*/)
 	throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::changesOccurred" );
 }
 
 //----------------------------------------------- 
 void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const css::uno::Reference< css::container::XNameAccess >& xCfg )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::impl_ts_load" );
     AcceleratorCache aReadCache = AcceleratorCache();
     css::uno::Reference< css::container::XNameAccess > xAccess;
     if (m_sGlobalOrModules.equalsAscii("Global"))
 //----------------------------------------------- 
 void XCUBasedAcceleratorConfiguration::impl_ts_save(sal_Bool bPreferred, const css::uno::Reference< css::container::XNameAccess >& /*xCfg*/)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::impl_ts_save" );
     if (bPreferred)
     {
         AcceleratorCache::TKeyList::const_iterator pIt;
 //----------------------------------------------- 
 void XCUBasedAcceleratorConfiguration::insertKeyToConfiguration( const css::awt::KeyEvent& aKeyEvent, const ::rtl::OUString& sCommand, const sal_Bool bPreferred )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::insertKeyToConfiguration" );
     css::uno::Reference< css::container::XNameAccess > xAccess;
     css::uno::Reference< css::container::XNameContainer > xContainer;
     css::uno::Reference< css::lang::XSingleServiceFactory > xFac;
         xModules->getByName(m_sModuleCFG) >>= xContainer;
     }
 
-    const ::rtl::OUString sKey = lcl_getKeyString(aKeyEvent);
+    const ::rtl::OUString sKey = lcl_getKeyString(m_rKeyMapping,aKeyEvent);
 	css::uno::Reference< css::container::XNameAccess > xKey;
 	css::uno::Reference< css::container::XNameContainer > xCommand;
 	if ( !xContainer->hasByName(sKey) )
 //----------------------------------------------- 
 void XCUBasedAcceleratorConfiguration::removeKeyFromConfiguration( const css::awt::KeyEvent& aKeyEvent, const sal_Bool bPreferred )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::removeKeyFromConfiguration" );
     css::uno::Reference< css::container::XNameAccess > xAccess;
     css::uno::Reference< css::container::XNameContainer > xContainer;
 
         xModules->getByName(m_sModuleCFG) >>= xContainer;
     }
 
-    const ::rtl::OUString sKey = lcl_getKeyString(aKeyEvent);
+    const ::rtl::OUString sKey = lcl_getKeyString(m_rKeyMapping,aKeyEvent);
 	xContainer->removeByName(sKey);
 }
 
 //----------------------------------------------- 
 void XCUBasedAcceleratorConfiguration::reloadChanged( const ::rtl::OUString& sPrimarySecondary, const ::rtl::OUString& sGlobalModules, const ::rtl::OUString& sModule, const ::rtl::OUString& sKey )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::reloadChanged" );
     css::uno::Reference< css::container::XNameAccess > xAccess;
     css::uno::Reference< css::container::XNameContainer > xContainer;
 
 //-----------------------------------------------    
 AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bPreferred, sal_Bool bWriteAccessRequested)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::impl_getCFG" );
     // SAFE -> ----------------------------------
     WriteGuard aWriteLock(m_aLock);
 
 //-----------------------------------------------    
 ::comphelper::Locale XCUBasedAcceleratorConfiguration::impl_ts_getLocale() const
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::impl_ts_getLocale" );
 	static ::rtl::OUString LOCALE_PACKAGE = ::rtl::OUString::createFromAscii("/org.openoffice.Setup");
 	static ::rtl::OUString LOCALE_PATH    = ::rtl::OUString::createFromAscii("L10N"                 );
 	static ::rtl::OUString LOCALE_KEY     = ::rtl::OUString::createFromAscii("ooLocale"             );