diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-31 11:12:57 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-02-11 08:02:16 +0200 |
commit | 89fed427f080862cf9615e2b2b57faefb639d6ce (patch) | |
tree | bc666abf45d9421a35906b364d575d65f0365b7a | |
parent | 5c5bf140ae8b80f64e0853c05e503cf9a04ff085 (diff) |
fdo#46808, convert to getProcessComponentContext
Change-Id: I59632fb1fe1d0e200fc42240ab1551a46801822e
-rw-r--r-- | framework/source/loadenv/loadenv.cxx | 18 | ||||
-rw-r--r-- | framework/source/services/license.cxx | 6 |
2 files changed, 16 insertions, 8 deletions
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 1784199e0bd9..d3c82282dfed 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -633,9 +633,11 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString& return E_UNSUPPORTED_CONTENT; } - // following operatons can work on an internal type name only :-( - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); - css::uno::Reference< css::document::XTypeDetection > xDetect(xSMGR->createInstance(SERVICENAME_TYPEDETECTION), css::uno::UNO_QUERY); + // following operations can work on an internal type name only :-( + css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + css::uno::Reference< css::document::XTypeDetection > xDetect( + xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_TYPEDETECTION, xContext), + css::uno::UNO_QUERY); ::rtl::OUString sType = xDetect->queryTypeByURL(sURL); @@ -665,7 +667,9 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString& lQuery[0].Name = sPROP_TYPES; lQuery[0].Value <<= lTypesReg; - xContainer = css::uno::Reference< css::container::XContainerQuery >(xSMGR->createInstance(SERVICENAME_FRAMELOADERFACTORY), css::uno::UNO_QUERY); + xContainer = css::uno::Reference< css::container::XContainerQuery >( + xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FRAMELOADERFACTORY, xContext), + css::uno::UNO_QUERY); xSet = xContainer->createSubSetEnumerationByProperties(lQuery); // at least one registered frame loader is enough! if (xSet->hasMoreElements()) @@ -680,7 +684,9 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString& lQuery[0].Name = sPROP_TYPES; lQuery[0].Value <<= lTypesReg; - xContainer = css::uno::Reference< css::container::XContainerQuery >(xSMGR->createInstance(SERVICENAME_CONTENTHANDLERFACTORY), css::uno::UNO_QUERY); + xContainer = css::uno::Reference< css::container::XContainerQuery >( + xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_CONTENTHANDLERFACTORY, xContext), + css::uno::UNO_QUERY); xSet = xContainer->createSubSetEnumerationByProperties(lQuery); // at least one registered content handler is enough! if (xSet->hasMoreElements()) @@ -690,7 +696,7 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString& // (v) Last but not least the UCB is used inside office to // load contents. He has a special configuration to know // which URL schemata can be used inside office. - css::uno::Reference< css::ucb::XUniversalContentBroker > xUCB(css::ucb::UniversalContentBroker::create(comphelper::getComponentContext(xSMGR))); + css::uno::Reference< css::ucb::XUniversalContentBroker > xUCB(css::ucb::UniversalContentBroker::create(xContext)); if (xUCB->queryContentProvider(sURL).is()) return E_CAN_BE_LOADED; diff --git a/framework/source/services/license.cxx b/framework/source/services/license.cxx index f62c7c5ff2ae..82594b6a91a2 100644 --- a/framework/source/services/license.cxx +++ b/framework/source/services/license.cxx @@ -313,8 +313,10 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na aSeq[0] <<= bQuickstart; aSeq[1] <<= bAutostart; - Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString("com.sun.star.office.Quickstart")),UNO_QUERY ); + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + Reference < XInitialization > xQuickstart( + xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Quickstart", xContext), + UNO_QUERY ); if ( xQuickstart.is() ) xQuickstart->initialize( aSeq ); |