diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-27 15:15:03 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-28 08:10:24 +0200 |
commit | 052de9c16bc4018d2ae3edc6282267e04d3956ac (patch) | |
tree | c3613a6381e0b07aaac11d4340404b6275930719 /framework/source/accelerators | |
parent | 8f3cec9d7a50f33c7be5191656720e463712dd83 (diff) |
fdo#46808, Convert some XMultiServiceFactory to XComponentContext
Change-Id: I7223d8e2c962ca90eda08119ed73a034d334329d
Diffstat (limited to 'framework/source/accelerators')
5 files changed, 44 insertions, 44 deletions
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 01a43399b8dc..cfb5618722a0 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -104,10 +104,10 @@ DEFINE_XTYPEPROVIDER_6(XMLBasedAcceleratorConfiguration , css::ui::XUIConfiguration ) //----------------------------------------------- -XMLBasedAcceleratorConfiguration::XMLBasedAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR) +XMLBasedAcceleratorConfiguration::XMLBasedAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext) : ThreadHelpBase (&Application::GetSolarMutex()) - , m_xSMGR (xSMGR ) - , m_aPresetHandler(xSMGR ) + , m_xContext (xContext ) + , m_aPresetHandler(xContext ) , m_pWriteCache (0 ) { } @@ -485,7 +485,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_load(const css::uno::Reference< c // SAFE -> ---------------------------------- WriteGuard aWriteLock(m_aLock); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; if (m_pWriteCache) { // be aware of reentrance problems - use temp variable for calling delete ... :-) @@ -515,7 +515,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_load(const css::uno::Reference< c css::uno::Reference< css::xml::sax::XDocumentHandler > xFilter (static_cast< ::cppu::OWeakObject* >(pFilter), css::uno::UNO_QUERY_THROW); // connect parser, filter and stream - css::uno::Reference< css::xml::sax::XParser > xParser = css::xml::sax::Parser::create(comphelper::getComponentContext(xSMGR)); + css::uno::Reference< css::xml::sax::XParser > xParser = css::xml::sax::Parser::create(xContext); xParser->setDocumentHandler(xFilter); css::xml::sax::InputSource aSource; @@ -540,7 +540,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_save(const css::uno::Reference< c aCache.takeOver(*m_pWriteCache); else aCache.takeOver(m_aReadCache); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -554,7 +554,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_save(const css::uno::Reference< c xSeek->seek(0); // combine writer/cache/stream etcpp. - css::uno::Reference< css::xml::sax::XWriter > xWriter = css::xml::sax::Writer::create(comphelper::getComponentContext(xSMGR)); + css::uno::Reference< css::xml::sax::XWriter > xWriter = css::xml::sax::Writer::create(xContext); xWriter->setOutputStream(xStream); // write into the stream @@ -611,11 +611,11 @@ OUString XMLBasedAcceleratorConfiguration::impl_ts_getLocale() const { // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- - css::uno::Reference< css::uno::XInterface > xCFG = fpc::ConfigurationHelper::openConfig( comphelper::getComponentContext(xSMGR), + css::uno::Reference< css::uno::XInterface > xCFG = fpc::ConfigurationHelper::openConfig( xContext, "/org.openoffice.Setup", "L10N", fpc::ConfigurationHelper::E_READONLY); css::uno::Reference< css::beans::XPropertySet > xProp (xCFG, css::uno::UNO_QUERY_THROW); OUString sISOLocale; @@ -656,15 +656,15 @@ DEFINE_XINTERFACE_8(XCUBasedAcceleratorConfiguration , css::ui::XUIConfiguration ) //----------------------------------------------- -XCUBasedAcceleratorConfiguration::XCUBasedAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR) +XCUBasedAcceleratorConfiguration::XCUBasedAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext) : ThreadHelpBase (&Application::GetSolarMutex()) - , m_xSMGR (xSMGR ) + , m_xContext (xContext ) , m_pPrimaryWriteCache(0 ) , m_pSecondaryWriteCache(0 ) { const OUString CFG_ENTRY_ACCELERATORS("org.openoffice.Office.Accelerators"); m_xCfg = css::uno::Reference< css::container::XNameAccess > ( - ::comphelper::ConfigurationHelper::openConfig( comphelper::getComponentContext(m_xSMGR), CFG_ENTRY_ACCELERATORS, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ), + ::comphelper::ConfigurationHelper::openConfig( m_xContext, CFG_ENTRY_ACCELERATORS, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ), css::uno::UNO_QUERY ); } @@ -1105,7 +1105,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R if (xSeek.is()) xSeek->seek(0); - css::uno::Reference< css::xml::sax::XWriter > xWriter = css::xml::sax::Writer::create(comphelper::getComponentContext(m_xSMGR)); + css::uno::Reference< css::xml::sax::XWriter > xWriter = css::xml::sax::Writer::create(m_xContext); xWriter->setOutputStream(xOut); // write into the stream @@ -1166,14 +1166,14 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::reset() if ( sConfig == "Global" ) { m_xCfg = css::uno::Reference< css::container::XNameAccess > ( - ::comphelper::ConfigurationHelper::openConfig( comphelper::getComponentContext(m_xSMGR), CFG_ENTRY_GLOBAL, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ), + ::comphelper::ConfigurationHelper::openConfig( m_xContext, CFG_ENTRY_GLOBAL, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ), css::uno::UNO_QUERY ); XCUBasedAcceleratorConfiguration::reload(); } else if ( sConfig == "Modules" ) { m_xCfg = css::uno::Reference< css::container::XNameAccess > ( - ::comphelper::ConfigurationHelper::openConfig( comphelper::getComponentContext(m_xSMGR), CFG_ENTRY_MODULES, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ), + ::comphelper::ConfigurationHelper::openConfig( m_xContext, CFG_ENTRY_MODULES, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ), css::uno::UNO_QUERY ); XCUBasedAcceleratorConfiguration::reload(); } @@ -1672,11 +1672,11 @@ OUString XCUBasedAcceleratorConfiguration::impl_ts_getLocale() const { // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- - css::uno::Reference< css::uno::XInterface > xCFG = fpc::ConfigurationHelper::openConfig( comphelper::getComponentContext(xSMGR), + css::uno::Reference< css::uno::XInterface > xCFG = fpc::ConfigurationHelper::openConfig( xContext, "/org.openoffice.Setup", "L10N", fpc::ConfigurationHelper::E_READONLY); css::uno::Reference< css::beans::XPropertySet > xProp (xCFG, css::uno::UNO_QUERY_THROW); OUString sISOLocale; diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx index b28c47893cfc..2feca7985faf 100644 --- a/framework/source/accelerators/documentacceleratorconfiguration.cxx +++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx @@ -66,10 +66,10 @@ DEFINE_XTYPEPROVIDER_2_WITH_BASECLASS(DocumentAcceleratorConfiguration , css::lang::XInitialization) // css::ui::XUIConfigurationStorage) -DEFINE_XSERVICEINFO_MULTISERVICE(DocumentAcceleratorConfiguration , - ::cppu::OWeakObject , - SERVICENAME_DOCUMENTACCELERATORCONFIGURATION , - IMPLEMENTATIONNAME_DOCUMENTACCELERATORCONFIGURATION) +DEFINE_XSERVICEINFO_MULTISERVICE_2(DocumentAcceleratorConfiguration , + ::cppu::OWeakObject , + SERVICENAME_DOCUMENTACCELERATORCONFIGURATION , + IMPLEMENTATIONNAME_DOCUMENTACCELERATORCONFIGURATION) DEFINE_INIT_SERVICE(DocumentAcceleratorConfiguration, { @@ -82,8 +82,8 @@ DEFINE_INIT_SERVICE(DocumentAcceleratorConfiguration, ) //----------------------------------------------- -DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR) - : XMLBasedAcceleratorConfiguration(xSMGR) +DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext) + : XMLBasedAcceleratorConfiguration(xContext) { } diff --git a/framework/source/accelerators/globalacceleratorconfiguration.cxx b/framework/source/accelerators/globalacceleratorconfiguration.cxx index cc9a36ff2af8..1bc6c0388d83 100644 --- a/framework/source/accelerators/globalacceleratorconfiguration.cxx +++ b/framework/source/accelerators/globalacceleratorconfiguration.cxx @@ -52,10 +52,10 @@ DEFINE_XTYPEPROVIDER_2_WITH_BASECLASS(GlobalAcceleratorConfiguration, css::lang::XServiceInfo , css::lang::XInitialization) -DEFINE_XSERVICEINFO_MULTISERVICE(GlobalAcceleratorConfiguration , - ::cppu::OWeakObject , - DECLARE_ASCII("com.sun.star.ui.GlobalAcceleratorConfiguration"), - IMPLEMENTATIONNAME_GLOBALACCELERATORCONFIGURATION) +DEFINE_XSERVICEINFO_MULTISERVICE_2(GlobalAcceleratorConfiguration , + ::cppu::OWeakObject , + DECLARE_ASCII("com.sun.star.ui.GlobalAcceleratorConfiguration"), + IMPLEMENTATIONNAME_GLOBALACCELERATORCONFIGURATION) DEFINE_INIT_SERVICE(GlobalAcceleratorConfiguration, { @@ -69,8 +69,8 @@ DEFINE_INIT_SERVICE(GlobalAcceleratorConfiguration, ) //----------------------------------------------- -GlobalAcceleratorConfiguration::GlobalAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR) - : XCUBasedAcceleratorConfiguration(xSMGR) +GlobalAcceleratorConfiguration::GlobalAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext) + : XCUBasedAcceleratorConfiguration(xContext) { } diff --git a/framework/source/accelerators/moduleacceleratorconfiguration.cxx b/framework/source/accelerators/moduleacceleratorconfiguration.cxx index 45305ed0bb4c..8717e9144692 100644 --- a/framework/source/accelerators/moduleacceleratorconfiguration.cxx +++ b/framework/source/accelerators/moduleacceleratorconfiguration.cxx @@ -59,10 +59,10 @@ DEFINE_XTYPEPROVIDER_2_WITH_BASECLASS(ModuleAcceleratorConfiguration, css::lang::XServiceInfo , css::lang::XInitialization ) -DEFINE_XSERVICEINFO_MULTISERVICE(ModuleAcceleratorConfiguration , - ::cppu::OWeakObject , - SERVICENAME_MODULEACCELERATORCONFIGURATION , - IMPLEMENTATIONNAME_MODULEACCELERATORCONFIGURATION) +DEFINE_XSERVICEINFO_MULTISERVICE_2(ModuleAcceleratorConfiguration , + ::cppu::OWeakObject , + SERVICENAME_MODULEACCELERATORCONFIGURATION , + IMPLEMENTATIONNAME_MODULEACCELERATORCONFIGURATION) DEFINE_INIT_SERVICE(ModuleAcceleratorConfiguration, { @@ -75,8 +75,8 @@ DEFINE_INIT_SERVICE(ModuleAcceleratorConfiguration, ) //----------------------------------------------- -ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR) - : XCUBasedAcceleratorConfiguration(xSMGR) +ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext) + : XCUBasedAcceleratorConfiguration(xContext) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration" ); } diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx index 7735ea59d41d..6c6539d1f6ae 100644 --- a/framework/source/accelerators/presethandler.cxx +++ b/framework/source/accelerators/presethandler.cxx @@ -97,9 +97,9 @@ OUString PresetHandler::RESOURCETYPE_STATUSBAR() } //----------------------------------------------- -PresetHandler::PresetHandler(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) +PresetHandler::PresetHandler(const css::uno::Reference< css::uno::XComponentContext >& xContext) : ThreadHelpBase (&Application::GetSolarMutex() ) - , m_xSMGR (xSMGR ) + , m_xContext (xContext ) , m_aSharedStorages ( ) , m_lDocumentStorages() , m_aLanguageTag (LANGUAGE_USER_PRIV_NOTRANSLATE) @@ -111,7 +111,7 @@ PresetHandler::PresetHandler(const PresetHandler& rCopy) : ThreadHelpBase (&Application::GetSolarMutex() ) , m_aLanguageTag( rCopy.m_aLanguageTag) { - m_xSMGR = rCopy.m_xSMGR; + m_xContext = rCopy.m_xContext; m_eConfigType = rCopy.m_eConfigType; m_sResourceType = rCopy.m_sResourceType; m_sModule = rCopy.m_sModule; @@ -222,12 +222,12 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- css::uno::Reference< css::util::XPathSettings > xPathSettings = - css::util::PathSettings::create( comphelper::getComponentContext(xSMGR) ); + css::util::PathSettings::create( xContext ); OUString sShareLayer = xPathSettings->getBasePathShareLayer(); @@ -252,7 +252,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag lArgs[0] <<= sShareLayer; lArgs[1] <<= css::embed::ElementModes::READ | css::embed::ElementModes::NOCREATE; - css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory = css::embed::FileSystemStorageFactory::create( comphelper::getComponentContext(xSMGR) ); + css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory = css::embed::FileSystemStorageFactory::create( xContext ); css::uno::Reference< css::embed::XStorage > xStorage; try @@ -280,12 +280,12 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- css::uno::Reference< css::util::XPathSettings > xPathSettings = - css::util::PathSettings::create( comphelper::getComponentContext(xSMGR) ); + css::util::PathSettings::create( xContext ); OUString sUserLayer = xPathSettings->getBasePathUserLayer(); @@ -300,7 +300,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag lArgs[0] <<= sUserLayer; lArgs[1] <<= css::embed::ElementModes::READWRITE; - css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory = css::embed::FileSystemStorageFactory::create( comphelper::getComponentContext(xSMGR) ); + css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory = css::embed::FileSystemStorageFactory::create( xContext ); css::uno::Reference< css::embed::XStorage > xStorage; try |