diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-09-09 11:10:21 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-09-09 11:10:21 +0000 |
commit | ffb423afc7dbcc6cf15860425a10b39df8a19a47 (patch) | |
tree | e808dafa26ab39afbf655e15ab00b039d6fb7b24 | |
parent | 36bff0ce9171dcb81e9c733e2c03fbe06ae1225a (diff) |
#i10000# corrected Version by OJ
-rw-r--r-- | framework/source/accelerators/acceleratorconfiguration.cxx | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 4a9fadb87e..5788a30fa1 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -111,11 +111,10 @@ namespace framework 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"); @@ -708,7 +707,6 @@ XCUBasedAcceleratorConfiguration::XCUBasedAcceleratorConfiguration(const css::un , 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 ), @@ -724,7 +722,6 @@ XCUBasedAcceleratorConfiguration::~XCUBasedAcceleratorConfiguration() 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); @@ -747,7 +744,6 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfigurati throw(css::container::NoSuchElementException, css::uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::getCommandByKeyEvent" ); // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); @@ -773,7 +769,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setKeyEvent(const css::awt::KeyE 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 ( @@ -860,7 +855,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeKeyEvent(const css::awt::K throw(css::container::NoSuchElementException, css::uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::removeKeyEvent" ); // SAFE -> ---------------------------------- WriteGuard aWriteLock(m_aLock); @@ -905,7 +899,6 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfigurati 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."), @@ -959,7 +952,6 @@ css::uno::Sequence< css::uno::Any > SAL_CALL XCUBasedAcceleratorConfiguration::g throw(css::lang::IllegalArgumentException , css::uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "XCUBasedAcceleratorConfiguration::getPreferredKeyEventsForCommandList" ); // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); @@ -1004,7 +996,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeCommandFromAllKeyEvents(co 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."), @@ -1036,7 +1027,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::reload() 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 -> ---------------------------------- @@ -1078,7 +1068,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::store() 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 -> ---------------------------------- @@ -1108,7 +1097,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R 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; @@ -1175,7 +1163,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R ::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; } @@ -1183,7 +1170,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R ::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; } @@ -1191,7 +1177,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R 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 .-)") } @@ -1199,7 +1184,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setStorage(const css::uno::Refer ::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; } @@ -1208,7 +1192,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setStorage(const css::uno::Refer 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") } @@ -1216,7 +1199,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::addConfigurationListener(const c 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") } @@ -1224,7 +1206,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeConfigurationListener(cons 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") ) @@ -1247,7 +1228,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::reset() 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") } @@ -1255,7 +1235,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::addResetListener(const css::uno: 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") } @@ -1263,7 +1242,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeResetListener(const css::u 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; @@ -1318,13 +1296,11 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util: 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")) @@ -1435,7 +1411,6 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const //----------------------------------------------- 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; @@ -1529,7 +1504,6 @@ void XCUBasedAcceleratorConfiguration::impl_ts_save(sal_Bool bPreferred, const c //----------------------------------------------- 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; @@ -1555,7 +1529,7 @@ void XCUBasedAcceleratorConfiguration::insertKeyToConfiguration( const css::awt: 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) ) @@ -1577,7 +1551,6 @@ void XCUBasedAcceleratorConfiguration::insertKeyToConfiguration( const css::awt: //----------------------------------------------- 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; @@ -1597,14 +1570,13 @@ void XCUBasedAcceleratorConfiguration::removeKeyFromConfiguration( const css::aw 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; @@ -1676,7 +1648,6 @@ void XCUBasedAcceleratorConfiguration::reloadChanged( const ::rtl::OUString& sPr //----------------------------------------------- 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); @@ -1726,7 +1697,6 @@ AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bPrefer //----------------------------------------------- ::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" ); |