diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-13 12:47:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-17 14:28:21 +0200 |
commit | 369e3fdcdafdb112a6963fb86fa4d4d0edb29c00 (patch) | |
tree | 9b7b52b0524feee2c6cfcaf5e5fb440816520fde /i18npool/source/transliteration | |
parent | 9486e6c45f5e15e07f4717fdbaaf30afe6ed86b9 (diff) |
fdo#46808, Adapt i18n::LocaleData UNO service to new style
The implementation of the LocaleData implements the optional XLocaleData4,
so rather than creating a new interface for the new-style service, we simply
make the service implement XLocaleData4, which in turn implements
XLocaleData3, XLocaleData2, XLocaleData.
Change-Id: I3e9a48b031be6b2aa5e04b376b3940b942add85a
Diffstat (limited to 'i18npool/source/transliteration')
-rw-r--r-- | i18npool/source/transliteration/transliterationImpl.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx index d6b1e144d972..af5ca8f0bdbf 100644 --- a/i18npool/source/transliteration/transliterationImpl.cxx +++ b/i18npool/source/transliteration/transliterationImpl.cxx @@ -21,9 +21,11 @@ #include "transliterationImpl.hxx" #include "servicename.hxx" +#include <com/sun/star/i18n/LocaleData.hpp> #include <com/sun/star/i18n/TransliterationType.hpp> #include <com/sun/star/lang/XComponent.hpp> +#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include <rtl/instance.hxx> #include <rtl/string.h> @@ -136,25 +138,17 @@ static struct TMlist { }; // Constructor/Destructor -TransliterationImpl::TransliterationImpl(const Reference <XMultiServiceFactory>& xMSF) : xSMgr(xMSF) +TransliterationImpl::TransliterationImpl(const Reference <XComponentContext>& xContext) : mxContext(xContext) { numCascade = 0; caseignoreOnly = sal_True; - if ( xMSF.is() ) - { - Reference < XInterface > xI= - xMSF->createInstance(OUString("com.sun.star.i18n.LocaleData")); - if ( xI.is() ) { - Any x = xI->queryInterface( ::getCppuType( (const uno::Reference< i18n::XLocaleData >*)0) ); - x >>= localedata; - } - } + mxLocaledata.set(LocaleData::create(xContext)); } TransliterationImpl::~TransliterationImpl() { - localedata.clear(); + mxLocaledata.clear(); clear(); } @@ -261,7 +255,7 @@ TransliterationImpl::loadModulesByImplNames(const Sequence< OUString >& implName Sequence<OUString> SAL_CALL TransliterationImpl::getAvailableModules( const Locale& rLocale, sal_Int16 sType ) throw(RuntimeException) { - const Sequence<OUString> &translist = localedata->getTransliterations(rLocale); + const Sequence<OUString> &translist = mxLocaledata->getTransliterations(rLocale); Sequence<OUString> r(translist.getLength()); Reference<XExtendedTransliteration> body; sal_Int32 n = 0; @@ -597,7 +591,7 @@ void TransliterationImpl::loadBody( OUString &implName, Reference<XExtendedTrans if (implName != lastTransBody.Name) { lastTransBody.Body.set( - xSMgr->createInstance(implName), UNO_QUERY_THROW); + mxContext->getServiceManager()->createInstanceWithContext(implName, mxContext), UNO_QUERY_THROW); lastTransBody.Name = implName; } body = lastTransBody.Body; |