summaryrefslogtreecommitdiff
path: root/lingucomponent
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-26 14:24:46 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-30 11:02:39 +0100
commit43d9f35c2665e55cfb5ee911a554ef71933ad4d1 (patch)
treed3b5d69db549ae13f0bc2a29c6905fe4235f4737 /lingucomponent
parent273ee9838cb87d6cf910a92969592709eba650f9 (diff)
fdo#46808, Adapt linguistic2::LinguServiceManager UNO service to new style
Create a merged XLinguServiceManager2 interface for this service to implement. Which is backwards-compatible, but does not require creating a new service. Change-Id: I297bada1066cd74809108641b56ee4d5898112ec
Diffstat (limited to 'lingucomponent')
-rw-r--r--lingucomponent/source/thesaurus/libnth/nthesimp.cxx16
1 files changed, 5 insertions, 11 deletions
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index b5869c95991d..981dce45743e 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -22,6 +22,7 @@
#include <cppuhelper/factory.hxx> // helper for factories
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/linguistic2/LinguServiceManager.hpp>
#include <i18npool/mslangid.hxx>
#include <tools/debug.hxx>
#include <comphelper/processfactory.hxx>
@@ -66,17 +67,10 @@ using ::rtl::OUStringToOString;
///////////////////////////////////////////////////////////////////////////
-static uno::Reference< XLinguServiceManager > GetLngSvcMgr_Impl()
+static uno::Reference< XLinguServiceManager2 > GetLngSvcMgr_Impl()
{
- uno::Reference< XLinguServiceManager > xRes;
- uno::Reference< XMultiServiceFactory > xMgr(
- comphelper::getProcessServiceFactory() );
- if (xMgr.is())
- {
- xRes = uno::Reference< XLinguServiceManager > ( xMgr->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.linguistic2.LinguServiceManager" ) ) ), UNO_QUERY ) ;
- }
+ uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ uno::Reference< XLinguServiceManager2 > xRes = LinguServiceManager::create( xContext ) ;
return xRes;
}
@@ -306,7 +300,7 @@ Sequence < Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL Thes
uno::Sequence< Reference< XMeaning > > aMeanings( 1 );
uno::Sequence< Reference< XMeaning > > noMeanings( 0 );
- uno::Reference< XLinguServiceManager > xLngSvcMgr( GetLngSvcMgr_Impl() );
+ uno::Reference< XLinguServiceManager2 > xLngSvcMgr( GetLngSvcMgr_Impl() );
uno::Reference< XSpellChecker1 > xSpell;
OUString rTerm(qTerm);