diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-08 11:24:30 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-01-15 09:56:02 +0200 |
commit | 549578a4ea996260437b355c39896593afc60726 (patch) | |
tree | 661c536084db8ce176348be2b2539e2d1d72d6ee /i18npool | |
parent | f6c759a6e5ead55b857e5d4898aa423b7616e816 (diff) |
fdo#46808, Convert services in i18npool to XComponentContext
Change-Id: I3aeaca995bc9a3d865b6955aa47cee4d9eb07750
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/inc/calendarImpl.hxx | 5 | ||||
-rw-r--r-- | i18npool/inc/characterclassificationImpl.hxx | 5 | ||||
-rw-r--r-- | i18npool/inc/indexentrysupplier.hxx | 5 | ||||
-rw-r--r-- | i18npool/inc/inputsequencechecker.hxx | 4 | ||||
-rw-r--r-- | i18npool/inc/ordinalsuffix.hxx | 4 | ||||
-rw-r--r-- | i18npool/inc/textconversion.hxx | 5 | ||||
-rw-r--r-- | i18npool/inc/textconversionImpl.hxx | 5 | ||||
-rw-r--r-- | i18npool/source/calendar/calendarImpl.cxx | 9 | ||||
-rw-r--r-- | i18npool/source/characterclassification/characterclassificationImpl.cxx | 8 | ||||
-rw-r--r-- | i18npool/source/indexentry/indexentrysupplier.cxx | 8 | ||||
-rw-r--r-- | i18npool/source/inputchecker/inputsequencechecker.cxx | 9 | ||||
-rw-r--r-- | i18npool/source/ordinalsuffix/ordinalsuffix.cxx | 4 | ||||
-rw-r--r-- | i18npool/source/registerservices/registerservices.cxx | 83 | ||||
-rw-r--r-- | i18npool/source/textconversion/textconversionImpl.cxx | 14 | ||||
-rw-r--r-- | i18npool/source/textconversion/textconversion_ko.cxx | 10 | ||||
-rw-r--r-- | i18npool/source/textconversion/textconversion_zh.cxx | 7 | ||||
-rw-r--r-- | i18npool/source/transliteration/transliteration_body.cxx | 4 |
17 files changed, 89 insertions, 100 deletions
diff --git a/i18npool/inc/calendarImpl.hxx b/i18npool/inc/calendarImpl.hxx index 16753bb1b1e1..baf0b600c71f 100644 --- a/i18npool/inc/calendarImpl.hxx +++ b/i18npool/inc/calendarImpl.hxx @@ -25,6 +25,7 @@ #include <com/sun/star/i18n/CalendarDisplayIndex.hpp> #include <cppuhelper/implbase2.hxx> // helper for implementations #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <vector> // ---------------------------------------------------- @@ -43,7 +44,7 @@ public: // Constructors CalendarImpl() {}; - CalendarImpl(const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF); + CalendarImpl(const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext); /** * Destructor @@ -96,7 +97,7 @@ private: com::sun::star::uno::Reference < com::sun::star::i18n::XCalendar3 > xCalendar; }; std::vector<lookupTableItem*> lookupTable; - com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF; + com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext; com::sun::star::uno::Reference < com::sun::star::i18n::XCalendar3 > xCalendar; }; diff --git a/i18npool/inc/characterclassificationImpl.hxx b/i18npool/inc/characterclassificationImpl.hxx index ec91f4c60761..2c7d34bbeb47 100644 --- a/i18npool/inc/characterclassificationImpl.hxx +++ b/i18npool/inc/characterclassificationImpl.hxx @@ -24,6 +24,7 @@ #include <vector> #include <com/sun/star/i18n/KCharacterType.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> namespace com { namespace sun { namespace star { namespace i18n { @@ -35,7 +36,7 @@ class CharacterClassificationImpl : public cppu::WeakImplHelper2 { public: - CharacterClassificationImpl( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ); + CharacterClassificationImpl( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext ); virtual ~CharacterClassificationImpl(); virtual rtl::OUString SAL_CALL toUpper( const rtl::OUString& Text, @@ -95,7 +96,7 @@ private: std::vector<lookupTableItem*> lookupTable; lookupTableItem *cachedItem; - com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF; + com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext; com::sun::star::uno::Reference < XCharacterClassification > xUCI; com::sun::star::uno::Reference < XCharacterClassification > SAL_CALL diff --git a/i18npool/inc/indexentrysupplier.hxx b/i18npool/inc/indexentrysupplier.hxx index 981c18e67fdc..698e93df19ea 100644 --- a/i18npool/inc/indexentrysupplier.hxx +++ b/i18npool/inc/indexentrysupplier.hxx @@ -22,6 +22,7 @@ #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp> #include <cppuhelper/implbase2.hxx> // helper for implementations #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> namespace com { namespace sun { namespace star { namespace i18n { @@ -35,7 +36,7 @@ class IndexEntrySupplier : public cppu::WeakImplHelper2 > { public: - IndexEntrySupplier( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ); + IndexEntrySupplier( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext ); // Methods virtual com::sun::star::uno::Sequence < com::sun::star::lang::Locale > SAL_CALL getLocaleList() @@ -87,7 +88,7 @@ public: private: rtl::OUString aServiceName; com::sun::star::uno::Reference < com::sun::star::i18n::XExtendedIndexEntrySupplier > xIES; - com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF; + com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext; sal_Bool SAL_CALL createLocaleSpecificIndexEntrySupplier(const rtl::OUString& name) throw( com::sun::star::uno::RuntimeException ); com::sun::star::uno::Reference < com::sun::star::i18n::XExtendedIndexEntrySupplier > SAL_CALL getLocaleSpecificIndexEntrySupplier( const com::sun::star::lang::Locale& rLocale, const rtl::OUString& rSortAlgorithm) throw (com::sun::star::uno::RuntimeException); diff --git a/i18npool/inc/inputsequencechecker.hxx b/i18npool/inc/inputsequencechecker.hxx index e04b684d4bfc..780ffe8d402f 100644 --- a/i18npool/inc/inputsequencechecker.hxx +++ b/i18npool/inc/inputsequencechecker.hxx @@ -39,7 +39,7 @@ class InputSequenceCheckerImpl : public cppu::WeakImplHelper2 > { public: - InputSequenceCheckerImpl( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ); + InputSequenceCheckerImpl( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext ); InputSequenceCheckerImpl(); ~InputSequenceCheckerImpl(); @@ -70,7 +70,7 @@ private : std::vector<lookupTableItem*> lookupTable; lookupTableItem *cachedItem; - com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF; + com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext; com::sun::star::uno::Reference< com::sun::star::i18n::XExtendedInputSequenceChecker >& SAL_CALL getInputSequenceChecker(sal_Char* rLanguage) throw (com::sun::star::uno::RuntimeException); diff --git a/i18npool/inc/ordinalsuffix.hxx b/i18npool/inc/ordinalsuffix.hxx index 25320501141e..fb746be4bd6f 100644 --- a/i18npool/inc/ordinalsuffix.hxx +++ b/i18npool/inc/ordinalsuffix.hxx @@ -32,7 +32,7 @@ class OrdinalSuffix : public cppu::WeakImplHelper2 > { public: - OrdinalSuffix(const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF); + OrdinalSuffix(); virtual ~OrdinalSuffix(); // XOrdinalSuffix @@ -43,8 +43,6 @@ class OrdinalSuffix : public cppu::WeakImplHelper2 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw(com::sun::star::uno::RuntimeException); virtual com::sun::star::uno::Sequence < rtl::OUString > SAL_CALL getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException); - private: - com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > _xServiceManager; }; } } } } diff --git a/i18npool/inc/textconversion.hxx b/i18npool/inc/textconversion.hxx index 735b0008da96..7e8535d6392c 100644 --- a/i18npool/inc/textconversion.hxx +++ b/i18npool/inc/textconversion.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/i18n/XExtendedTextConversion.hpp> #include <com/sun/star/linguistic2/XConversionDictionary.hpp> #include <com/sun/star/linguistic2/XConversionDictionaryList.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase2.hxx> // helper for implementations #include <osl/module.h> @@ -101,7 +102,7 @@ typedef struct { class TextConversion_ko : public TextConversion { public: - TextConversion_ko( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ); + TextConversion_ko( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext ); // Methods com::sun::star::i18n::TextConversionResult SAL_CALL @@ -157,7 +158,7 @@ typedef struct { class TextConversion_zh : public TextConversion { public: - TextConversion_zh( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ); + TextConversion_zh( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext ); // Methods com::sun::star::i18n::TextConversionResult SAL_CALL diff --git a/i18npool/inc/textconversionImpl.hxx b/i18npool/inc/textconversionImpl.hxx index 9fa94d6b63c6..a7fd9233c880 100644 --- a/i18npool/inc/textconversionImpl.hxx +++ b/i18npool/inc/textconversionImpl.hxx @@ -22,6 +22,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/i18n/XExtendedTextConversion.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase2.hxx> // helper for implementations namespace com { namespace sun { namespace star { namespace i18n { @@ -36,7 +37,7 @@ class TextConversionImpl : public cppu::WeakImplHelper2 > { public: - TextConversionImpl( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ) : xMSF(rxMSF) {}; + TextConversionImpl( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext ) : m_xContext(rxContext) {}; // Methods com::sun::star::i18n::TextConversionResult SAL_CALL @@ -80,7 +81,7 @@ public: private : com::sun::star::lang::Locale aLocale; com::sun::star::uno::Reference < com::sun::star::i18n::XExtendedTextConversion > xTC; - com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF; + com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext; void SAL_CALL getLocaleSpecificTextConversion( const com::sun::star::lang::Locale& rLocale ) throw( com::sun::star::lang::NoSupportException ); diff --git a/i18npool/source/calendar/calendarImpl.cxx b/i18npool/source/calendar/calendarImpl.cxx index a78a4476f4f0..e7c76efae144 100644 --- a/i18npool/source/calendar/calendarImpl.cxx +++ b/i18npool/source/calendar/calendarImpl.cxx @@ -30,7 +30,7 @@ namespace com { namespace sun { namespace star { namespace i18n { #define ERROR RuntimeException() -CalendarImpl::CalendarImpl(const Reference< XMultiServiceFactory > &rxMSF) : xMSF(rxMSF) +CalendarImpl::CalendarImpl(const Reference< XComponentContext > &rxContext) : m_xContext(rxContext) { } @@ -71,16 +71,15 @@ CalendarImpl::loadCalendar(const OUString& uniqueID, const Locale& rLocale ) thr } if (i >= sal::static_int_cast<sal_Int32>(lookupTable.size())) { - Reference < XInterface > xI = xMSF->createInstance( - OUString("com.sun.star.i18n.Calendar_") + uniqueID); + Reference < XInterface > xI = m_xContext->getServiceManager()->createInstanceWithContext( + OUString("com.sun.star.i18n.Calendar_") + uniqueID, m_xContext); if ( ! xI.is() ) { // check if the calendar is defined in localedata, load gregorian calendar service. Sequence< Calendar2 > xC = LocaleData().getAllCalendars2(rLocale); for (i = 0; i < xC.getLength(); i++) { if (uniqueID == xC[i].Name) { - xI = xMSF->createInstance( - OUString("com.sun.star.i18n.Calendar_gregorian")); + xI = m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.i18n.Calendar_gregorian", m_xContext); break; } } diff --git a/i18npool/source/characterclassification/characterclassificationImpl.cxx b/i18npool/source/characterclassification/characterclassificationImpl.cxx index 76ae4703ba7b..6786449d25f9 100644 --- a/i18npool/source/characterclassification/characterclassificationImpl.cxx +++ b/i18npool/source/characterclassification/characterclassificationImpl.cxx @@ -30,7 +30,7 @@ using ::rtl::OUStringBuffer; namespace com { namespace sun { namespace star { namespace i18n { CharacterClassificationImpl::CharacterClassificationImpl( - const Reference < lang::XMultiServiceFactory >& rxMSF ) : xMSF( rxMSF ) + const Reference < uno::XComponentContext >& rxContext ) : m_xContext( rxContext ) { if (createLocaleSpecificCharacterClassification(OUString("Unicode"), Locale())) xUCI = cachedItem->xCI; @@ -140,8 +140,8 @@ sal_Bool SAL_CALL CharacterClassificationImpl::createLocaleSpecificCharacterClas } } - Reference < XInterface > xI = xMSF->createInstance( - OUString("com.sun.star.i18n.CharacterClassification_") + serviceName); + Reference < XInterface > xI = m_xContext->getServiceManager()->createInstanceWithContext( + OUString("com.sun.star.i18n.CharacterClassification_") + serviceName, m_xContext); Reference < XCharacterClassification > xCI; if ( xI.is() ) { @@ -161,7 +161,7 @@ CharacterClassificationImpl::getLocaleSpecificCharacterClassification(const Loca // reuse instance if locale didn't change if (cachedItem && cachedItem->equals(rLocale)) return cachedItem->xCI; - else if (xMSF.is()) { + else { for (size_t i = 0; i < lookupTable.size(); i++) { cachedItem = lookupTable[i]; if (cachedItem->equals(rLocale)) diff --git a/i18npool/source/indexentry/indexentrysupplier.cxx b/i18npool/source/indexentry/indexentrysupplier.cxx index 53fc96b9b180..9005d12e4f10 100644 --- a/i18npool/source/indexentry/indexentrysupplier.cxx +++ b/i18npool/source/indexentry/indexentrysupplier.cxx @@ -29,7 +29,7 @@ static const sal_Unicode under = sal_Unicode('_'); namespace com { namespace sun { namespace star { namespace i18n { -IndexEntrySupplier::IndexEntrySupplier( const Reference < XMultiServiceFactory >& rxMSF ) : xMSF( rxMSF ) +IndexEntrySupplier::IndexEntrySupplier( const Reference < XComponentContext >& rxContext ) : m_xContext( rxContext ) { } @@ -101,8 +101,8 @@ OUString SAL_CALL IndexEntrySupplier::getIndexCharacter( const OUString& rIndexE sal_Bool SAL_CALL IndexEntrySupplier::createLocaleSpecificIndexEntrySupplier(const OUString& name) throw( RuntimeException ) { - Reference < XInterface > xI = xMSF->createInstance( - OUString("com.sun.star.i18n.IndexEntrySupplier_") + name); + Reference < XInterface > xI = m_xContext->getServiceManager()->createInstanceWithContext( + OUString("com.sun.star.i18n.IndexEntrySupplier_") + name, m_xContext); if ( xI.is() ) { xI->queryInterface( ::getCppuType((const Reference< com::sun::star::i18n::XExtendedIndexEntrySupplier>*)0) ) >>= xIES; @@ -117,7 +117,7 @@ IndexEntrySupplier::getLocaleSpecificIndexEntrySupplier(const Locale& rLocale, c if (xIES.is() && rSortAlgorithm == aSortAlgorithm && rLocale.Language == aLocale.Language && rLocale.Country == aLocale.Country && rLocale.Variant == aLocale.Variant) return xIES; - else if (xMSF.is()) { + else { LocaleData ld; aLocale = rLocale; if (rSortAlgorithm.isEmpty()) diff --git a/i18npool/source/inputchecker/inputsequencechecker.cxx b/i18npool/source/inputchecker/inputsequencechecker.cxx index 0f8ca2305e0f..061a4c5e4e19 100644 --- a/i18npool/source/inputchecker/inputsequencechecker.cxx +++ b/i18npool/source/inputchecker/inputsequencechecker.cxx @@ -30,7 +30,7 @@ using namespace ::rtl; namespace com { namespace sun { namespace star { namespace i18n { -InputSequenceCheckerImpl::InputSequenceCheckerImpl( const Reference < XMultiServiceFactory >& rxMSF ) : xMSF( rxMSF ) +InputSequenceCheckerImpl::InputSequenceCheckerImpl( const Reference < XComponentContext >& rxContext ) : m_xContext( rxContext ) { serviceName = "com.sun.star.i18n.InputSequenceCheckerImpl"; cachedItem = NULL; @@ -110,16 +110,17 @@ InputSequenceCheckerImpl::getInputSequenceChecker(sal_Char* rLanguage) throw (Ru if (cachedItem && cachedItem->aLanguage == rLanguage) { return cachedItem->xISC; } - else if (xMSF.is()) { + else { for (size_t l = 0; l < lookupTable.size(); l++) { cachedItem = lookupTable[l]; if (cachedItem->aLanguage == rLanguage) return cachedItem->xISC; } - Reference < uno::XInterface > xI = xMSF->createInstance( + Reference < uno::XInterface > xI = m_xContext->getServiceManager()->createInstanceWithContext( OUString("com.sun.star.i18n.InputSequenceChecker_") + - OUString::createFromAscii(rLanguage)); + OUString::createFromAscii(rLanguage), + m_xContext); if ( xI.is() ) { Reference< XExtendedInputSequenceChecker > xISC; diff --git a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx index 558429aa57ae..9eca3a099e0b 100644 --- a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx +++ b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx @@ -35,9 +35,7 @@ using namespace ::rtl; namespace com { namespace sun { namespace star { namespace i18n { -OrdinalSuffix::OrdinalSuffix( - const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF) : - _xServiceManager( rxMSF ) +OrdinalSuffix::OrdinalSuffix() { } diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx index 5b9572abc2a6..3bcd871854a3 100644 --- a/i18npool/source/registerservices/registerservices.cxx +++ b/i18npool/source/registerservices/registerservices.cxx @@ -80,43 +80,34 @@ #include <ordinalsuffix.hxx> -#define IMPL_CREATEINSTANCE( ImplName ) \ - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > \ - SAL_CALL ImplName##_CreateInstance( \ - SAL_UNUSED_PARAMETER const ::com::sun::star::uno::Reference< \ - ::com::sun::star::lang::XMultiServiceFactory >& ) \ -{ \ - return ::com::sun::star::uno::Reference < \ - ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) \ - new ImplName ); \ -} +using namespace ::com::sun::star; -#define IMPL_CREATEINSTANCE_MSF( ImplName ) \ - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > \ - SAL_CALL ImplName##_CreateInstance( \ - const ::com::sun::star::uno::Reference< \ - ::com::sun::star::lang::XMultiServiceFactory >& rxMSF ) \ -{ \ - return ::com::sun::star::uno::Reference < \ - ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) \ - new ImplName( rxMSF ) ); \ +#define IMPL_CREATEINSTANCE( ImplName ) \ + uno::Reference< uno::XInterface > \ + SAL_CALL ImplName##_CreateInstance( \ + SAL_UNUSED_PARAMETER const uno::Reference< \ + lang::XMultiServiceFactory >& ) \ +{ \ + return uno::Reference < \ + uno::XInterface >( ( ::cppu::OWeakObject* ) \ + new ImplName ); \ } -#define IMPL_CREATEINSTANCE_CTX( ImplName ) \ - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > \ - SAL_CALL ImplName##_CreateInstance( \ - const ::com::sun::star::uno::Reference< \ - ::com::sun::star::lang::XMultiServiceFactory >& rxMSF ) \ -{ \ - return ::com::sun::star::uno::Reference < \ - ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) \ - new ImplName( comphelper::getComponentContext(rxMSF) ) ); \ +#define IMPL_CREATEINSTANCE_CTX( ImplName ) \ + uno::Reference< uno::XInterface > \ + SAL_CALL ImplName##_CreateInstance( \ + const uno::Reference< \ + lang::XMultiServiceFactory >& rxMSF ) \ +{ \ + return uno::Reference < \ + uno::XInterface >( ( ::cppu::OWeakObject* ) \ + new ImplName( comphelper::getComponentContext(rxMSF) ) ); \ } -typedef ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface > (SAL_CALL *FN_CreateInstance)( - const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& ); +typedef uno::Reference< + uno::XInterface > (SAL_CALL *FN_CreateInstance)( + const uno::Reference< + lang::XMultiServiceFactory >& ); #define IMPL_TRANSLITERATION_ITEM( implName ) \ { TRLT_SERVICELNAME_L10N, \ @@ -125,20 +116,20 @@ typedef ::com::sun::star::uno::Reference< // ------------------------------------------------------------------------------------- -using namespace ::com::sun::star::i18n; +using namespace i18n; IMPL_CREATEINSTANCE_CTX( NumberFormatCodeMapper ) IMPL_CREATEINSTANCE( NativeNumberSupplier ) IMPL_CREATEINSTANCE( LocaleData ) IMPL_CREATEINSTANCE_CTX( DefaultNumberingProvider ) -IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier ) +IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier ) IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_asian ) IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable ) IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_consonant ) IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable ) IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_consonant ) IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_Unicode ) -IMPL_CREATEINSTANCE_MSF( CalendarImpl ) +IMPL_CREATEINSTANCE_CTX( CalendarImpl ) IMPL_CREATEINSTANCE( Calendar_gregorian ) IMPL_CREATEINSTANCE( Calendar_hanja ) IMPL_CREATEINSTANCE( Calendar_gengou ) @@ -157,18 +148,18 @@ IMPL_CREATEINSTANCE_CTX( ChapterCollator ) IMPL_CREATEINSTANCE_CTX( CollatorImpl ) IMPL_CREATEINSTANCE( Collator_Unicode ) -IMPL_CREATEINSTANCE_MSF( CharacterClassificationImpl ) +IMPL_CREATEINSTANCE_CTX( CharacterClassificationImpl ) IMPL_CREATEINSTANCE_CTX( cclass_Unicode ) IMPL_CREATEINSTANCE_CTX( TransliterationImpl ) IMPL_CREATEINSTANCE( UnoScriptTypeDetector ) -IMPL_CREATEINSTANCE_MSF( InputSequenceCheckerImpl ) +IMPL_CREATEINSTANCE_CTX( InputSequenceCheckerImpl ) IMPL_CREATEINSTANCE( InputSequenceChecker_th ) IMPL_CREATEINSTANCE( InputSequenceChecker_hi ) -IMPL_CREATEINSTANCE_MSF( TextConversionImpl ) -IMPL_CREATEINSTANCE_MSF( TextConversion_ko ) -IMPL_CREATEINSTANCE_MSF( TextConversion_zh ) +IMPL_CREATEINSTANCE_CTX( TextConversionImpl ) +IMPL_CREATEINSTANCE_CTX( TextConversion_ko ) +IMPL_CREATEINSTANCE_CTX( TextConversion_zh ) IMPL_CREATEINSTANCE( Transliteration_u2l ) IMPL_CREATEINSTANCE( Transliteration_l2u ) @@ -286,7 +277,7 @@ IMPL_CREATEINSTANCE( halfwidthKatakanaToFullwidthKatakana ) IMPL_CREATEINSTANCE( fullwidthToHalfwidthLikeASC ) IMPL_CREATEINSTANCE( halfwidthToFullwidthLikeJIS ) -IMPL_CREATEINSTANCE_MSF( OrdinalSuffix ) +IMPL_CREATEINSTANCE( OrdinalSuffix ) static const struct InstancesArray { const sal_Char* pServiceNm; @@ -581,17 +572,15 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL i18npool_component_getFactory( const sal_Cha { void* pRet = NULL; - ::com::sun::star::lang::XMultiServiceFactory* pServiceManager = - reinterpret_cast< ::com::sun::star::lang::XMultiServiceFactory* > - ( _pServiceManager ); - ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XSingleServiceFactory > xFactory; + lang::XMultiServiceFactory* pServiceManager = + reinterpret_cast< lang::XMultiServiceFactory* >( _pServiceManager ); + uno::Reference< lang::XSingleServiceFactory > xFactory; for( const InstancesArray* pArr = aInstances; pArr->pServiceNm; ++pArr ) { if( 0 == rtl_str_compare( sImplementationName, pArr->pImplementationNm ) ) { - ::com::sun::star::uno::Sequence< ::rtl::OUString > aServiceNames(1); + uno::Sequence< ::rtl::OUString > aServiceNames(1); aServiceNames.getArray()[0] = ::rtl::OUString::createFromAscii( pArr->pServiceNm ); xFactory = ::cppu::createSingleFactory( diff --git a/i18npool/source/textconversion/textconversionImpl.cxx b/i18npool/source/textconversion/textconversionImpl.cxx index 213c70217a41..ab2ad1f2ea92 100644 --- a/i18npool/source/textconversion/textconversionImpl.cxx +++ b/i18npool/source/textconversion/textconversionImpl.cxx @@ -83,23 +83,23 @@ static inline sal_Bool operator != (const Locale& l1, const Locale& l2) { void SAL_CALL TextConversionImpl::getLocaleSpecificTextConversion(const Locale& rLocale) throw( NoSupportException ) { - if (xMSF.is() && rLocale != aLocale) { + if (rLocale != aLocale) { aLocale = rLocale; Reference < XInterface > xI; - xI = xMSF->createInstance( - OUString("com.sun.star.i18n.TextConversion_") + aLocale.Language); + xI = m_xContext->getServiceManager()->createInstanceWithContext( + OUString("com.sun.star.i18n.TextConversion_") + aLocale.Language, m_xContext); if ( ! xI.is() ) - xI = xMSF->createInstance( + xI = m_xContext->getServiceManager()->createInstanceWithContext( OUString("com.sun.star.i18n.TextConversion_") + aLocale.Language + - OUString("_") + aLocale.Country); + OUString("_") + aLocale.Country, m_xContext); if ( ! xI.is() ) - xI = xMSF->createInstance( + xI = m_xContext->getServiceManager()->createInstanceWithContext( OUString("com.sun.star.i18n.TextConversion_") + aLocale.Language + OUString("_") + aLocale.Country + - OUString("_") + aLocale.Variant); + OUString("_") + aLocale.Variant, m_xContext); if (xI.is()) xI->queryInterface( getCppuType((const Reference< XTextConversion>*)0) ) >>= xTC; diff --git a/i18npool/source/textconversion/textconversion_ko.cxx b/i18npool/source/textconversion/textconversion_ko.cxx index dfb21e0bb6bb..84534296882d 100644 --- a/i18npool/source/textconversion/textconversion_ko.cxx +++ b/i18npool/source/textconversion/textconversion_ko.cxx @@ -40,18 +40,18 @@ namespace com { namespace sun { namespace star { namespace i18n { #define SCRIPT_HANJA 1 #define SCRIPT_HANGUL 2 -TextConversion_ko::TextConversion_ko( const Reference < XMultiServiceFactory >& xMSF ) +TextConversion_ko::TextConversion_ko( const Reference < XComponentContext >& xContext ) { Reference < XInterface > xI; - xI = xMSF->createInstance( - OUString("com.sun.star.i18n.ConversionDictionary_ko")); + xI = xContext->getServiceManager()->createInstanceWithContext( + OUString("com.sun.star.i18n.ConversionDictionary_ko"), xContext); if ( xI.is() ) xI->queryInterface( getCppuType((const Reference< XConversionDictionary>*)0) ) >>= xCD; - xI = xMSF->createInstance( - OUString("com.sun.star.linguistic2.ConversionDictionaryList")); + xI = xContext->getServiceManager()->createInstanceWithContext( + OUString("com.sun.star.linguistic2.ConversionDictionaryList"), xContext); if ( xI.is() ) xI->queryInterface( getCppuType((const Reference< XConversionDictionaryList>*)0) ) >>= xCDL; diff --git a/i18npool/source/textconversion/textconversion_zh.cxx b/i18npool/source/textconversion/textconversion_zh.cxx index 54ae5d3e371b..ae57063af1c8 100644 --- a/i18npool/source/textconversion/textconversion_zh.cxx +++ b/i18npool/source/textconversion/textconversion_zh.cxx @@ -35,11 +35,10 @@ using ::rtl::OUString; namespace com { namespace sun { namespace star { namespace i18n { -TextConversion_zh::TextConversion_zh( const Reference < XMultiServiceFactory >& xMSF ) +TextConversion_zh::TextConversion_zh( const Reference < XComponentContext >& xContext ) { - Reference < XInterface > xI; - xI = xMSF->createInstance( - OUString("com.sun.star.linguistic2.ConversionDictionaryList")); + Reference < XInterface > xI = xContext->getServiceManager()->createInstanceWithContext( + OUString("com.sun.star.linguistic2.ConversionDictionaryList"), xContext); if ( xI.is() ) xI->queryInterface( getCppuType((const Reference< XConversionDictionaryList>*)0) ) >>= xCDL; diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx index db3ba0a9f37d..8a63e1bebe88 100644 --- a/i18npool/source/transliteration/transliteration_body.cxx +++ b/i18npool/source/transliteration/transliteration_body.cxx @@ -273,8 +273,8 @@ static rtl::OUString transliterate_titlecase_Impl( OUString aRes; if (!aText.isEmpty()) { - Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - CharacterClassificationImpl aCharClassImpl( xMSF ); + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + CharacterClassificationImpl aCharClassImpl( xContext ); // because aCharClassImpl.toTitle does not handle ligatures or but will raise // an exception we need to handle the first chara manually... |