Kaydet (Commit) 89fed427 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, convert to getProcessComponentContext

Change-Id: I59632fb1fe1d0e200fc42240ab1551a46801822e
üst 5c5bf140
...@@ -633,9 +633,11 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString& ...@@ -633,9 +633,11 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString&
return E_UNSUPPORTED_CONTENT; return E_UNSUPPORTED_CONTENT;
} }
// following operatons can work on an internal type name only :-( // following operations can work on an internal type name only :-(
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
css::uno::Reference< css::document::XTypeDetection > xDetect(xSMGR->createInstance(SERVICENAME_TYPEDETECTION), css::uno::UNO_QUERY); css::uno::Reference< css::document::XTypeDetection > xDetect(
xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_TYPEDETECTION, xContext),
css::uno::UNO_QUERY);
::rtl::OUString sType = xDetect->queryTypeByURL(sURL); ::rtl::OUString sType = xDetect->queryTypeByURL(sURL);
...@@ -665,7 +667,9 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString& ...@@ -665,7 +667,9 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString&
lQuery[0].Name = sPROP_TYPES; lQuery[0].Name = sPROP_TYPES;
lQuery[0].Value <<= lTypesReg; 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); xSet = xContainer->createSubSetEnumerationByProperties(lQuery);
// at least one registered frame loader is enough! // at least one registered frame loader is enough!
if (xSet->hasMoreElements()) if (xSet->hasMoreElements())
...@@ -680,7 +684,9 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString& ...@@ -680,7 +684,9 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString&
lQuery[0].Name = sPROP_TYPES; lQuery[0].Name = sPROP_TYPES;
lQuery[0].Value <<= lTypesReg; 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); xSet = xContainer->createSubSetEnumerationByProperties(lQuery);
// at least one registered content handler is enough! // at least one registered content handler is enough!
if (xSet->hasMoreElements()) if (xSet->hasMoreElements())
...@@ -690,7 +696,7 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString& ...@@ -690,7 +696,7 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString&
// (v) Last but not least the UCB is used inside office to // (v) Last but not least the UCB is used inside office to
// load contents. He has a special configuration to know // load contents. He has a special configuration to know
// which URL schemata can be used inside office. // 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()) if (xUCB->queryContentProvider(sURL).is())
return E_CAN_BE_LOADED; return E_CAN_BE_LOADED;
......
...@@ -313,8 +313,10 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na ...@@ -313,8 +313,10 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na
aSeq[0] <<= bQuickstart; aSeq[0] <<= bQuickstart;
aSeq[1] <<= bAutostart; aSeq[1] <<= bAutostart;
Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance( Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
::rtl::OUString("com.sun.star.office.Quickstart")),UNO_QUERY ); Reference < XInitialization > xQuickstart(
xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Quickstart", xContext),
UNO_QUERY );
if ( xQuickstart.is() ) if ( xQuickstart.is() )
xQuickstart->initialize( aSeq ); xQuickstart->initialize( aSeq );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment