diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-13 15:13:34 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-14 08:08:26 +0200 |
commit | 0fd6fc3776ada4682e7286f9a0aaaf4c07b42643 (patch) | |
tree | e09685e233909aa2220f224664b68acc2443992b /linguistic/source/thesdsp.cxx | |
parent | 0394cb37a2d378511f265004b285fd93df37e5ca (diff) |
fdo#46808, Convert some XMultiServiceFactory to XComponentContext
Change-Id: Ia66283321d4d18d929b2e3406ad420627f73a3fd
Diffstat (limited to 'linguistic/source/thesdsp.cxx')
-rw-r--r-- | linguistic/source/thesdsp.cxx | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index a734d89271cd..c8d31cadc5f2 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.cxx @@ -158,44 +158,43 @@ Sequence< Reference< XMeaning > > SAL_CALL const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray(); Reference< XThesaurus > *pRef = pEntry->aSvcRefs.getArray(); - Reference< XMultiServiceFactory > xMgr( - comphelper::getProcessServiceFactory() ); - if (xMgr.is()) - { - // build service initialization argument - Sequence< Any > aArgs(1); - aArgs.getArray()[0] <<= GetPropSet(); + Reference< XComponentContext > xContext( + comphelper::getProcessComponentContext() ); + + // build service initialization argument + Sequence< Any > aArgs(1); + aArgs.getArray()[0] <<= GetPropSet(); - while (i < nLen && aMeanings.getLength() == 0) + while (i < nLen && aMeanings.getLength() == 0) + { + // create specific service via it's implementation name + Reference< XThesaurus > xThes; + try { - // create specific service via it's implementation name - Reference< XThesaurus > xThes; - try - { - xThes = Reference< XThesaurus >( - xMgr->createInstanceWithArguments( - pImplNames[i], aArgs ), UNO_QUERY ); - } - catch (uno::Exception &) - { - DBG_ASSERT( 0, "createInstanceWithArguments failed" ); - } - pRef[i] = xThes; - - if (xThes.is() && xThes->hasLocale( rLocale )) - aMeanings = xThes->queryMeanings( aChkWord, rLocale, rProperties ); - - pEntry->nLastTriedSvcIndex = (sal_Int16) i; - ++i; + xThes = Reference< XThesaurus >( + xContext->getServiceManager()->createInstanceWithArgumentsAndContext( + pImplNames[i], aArgs, xContext ), + UNO_QUERY ); } - - // if language is not supported by any of the services - // remove it from the list. - if (i == nLen && aMeanings.getLength() == 0) + catch (uno::Exception &) { - if (!SvcListHasLanguage( pEntry->aSvcRefs, rLocale )) - aSvcMap.erase( nLanguage ); + DBG_ASSERT( 0, "createInstanceWithArguments failed" ); } + pRef[i] = xThes; + + if (xThes.is() && xThes->hasLocale( rLocale )) + aMeanings = xThes->queryMeanings( aChkWord, rLocale, rProperties ); + + pEntry->nLastTriedSvcIndex = (sal_Int16) i; + ++i; + } + + // if language is not supported by any of the services + // remove it from the list. + if (i == nLen && aMeanings.getLength() == 0) + { + if (!SvcListHasLanguage( pEntry->aSvcRefs, rLocale )) + aSvcMap.erase( nLanguage ); } } } |