summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-11-05 15:19:49 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-11-27 18:18:07 +0100
commit9df0baaf0b2d0dc22b88d13848014b402937aac6 (patch)
treea12df367d83caa5e52419b00e325dafdb6625e02
parentc2bbc9797c2fef9078c11460100996972bebd971 (diff)
fdo#46808, convert i18n::BreakIterator impl to XComponentContext
Change-Id: I2e6800d0f5a6346fc743d5a57bab34d1e36b4ee4
-rw-r--r--i18npool/inc/breakiteratorImpl.hxx4
-rw-r--r--i18npool/inc/cclass_unicode.hxx5
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx8
-rw-r--r--i18npool/source/characterclassification/cclass_unicode.cxx4
-rw-r--r--i18npool/source/characterclassification/cclass_unicode_parser.cxx6
-rw-r--r--i18npool/source/registerservices/registerservices.cxx4
6 files changed, 15 insertions, 16 deletions
diff --git a/i18npool/inc/breakiteratorImpl.hxx b/i18npool/inc/breakiteratorImpl.hxx
index 395c144ad53f..7a6ef2ac439e 100644
--- a/i18npool/inc/breakiteratorImpl.hxx
+++ b/i18npool/inc/breakiteratorImpl.hxx
@@ -46,7 +46,7 @@ class BreakIteratorImpl : public cppu::WeakImplHelper2
>
{
public:
- BreakIteratorImpl( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF );
+ BreakIteratorImpl( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext );
BreakIteratorImpl();
~BreakIteratorImpl();
@@ -123,8 +123,8 @@ private :
std::vector<lookupTableItem*> lookupTable;
com::sun::star::lang::Locale aLocale;
com::sun::star::uno::Reference < XBreakIterator > xBI;
+ com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext;
- com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF;
sal_Bool SAL_CALL createLocaleSpecificBreakIterator( const rtl::OUString& aLocaleName )
throw( com::sun::star::uno::RuntimeException );
com::sun::star::uno::Reference < XBreakIterator > SAL_CALL getLocaleSpecificBreakIterator( const com::sun::star::lang::Locale& rLocale )
diff --git a/i18npool/inc/cclass_unicode.hxx b/i18npool/inc/cclass_unicode.hxx
index 340b72fad63f..d515cfd2b3d3 100644
--- a/i18npool/inc/cclass_unicode.hxx
+++ b/i18npool/inc/cclass_unicode.hxx
@@ -22,7 +22,6 @@
#include <com/sun/star/i18n/XNativeNumberSupplier.hpp>
#include <com/sun/star/i18n/XCharacterClassification.hpp>
#include <com/sun/star/i18n/XLocaleData4.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <cppuhelper/implbase1.hxx> // helper for implementations
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -36,7 +35,7 @@ typedef sal_uInt32 UPT_FLAG_TYPE;
class cclass_Unicode : public cppu::WeakImplHelper1 < XCharacterClassification >
{
public:
- cclass_Unicode(com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xSMgr );
+ cclass_Unicode(const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rxContext );
~cclass_Unicode();
virtual rtl::OUString SAL_CALL toUpper( const rtl::OUString& Text, sal_Int32 nPos, sal_Int32 nCount,
@@ -118,7 +117,7 @@ private:
static const sal_Unicode* StrChr( const sal_Unicode* pStr, sal_Unicode c );
- com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF;
+ com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext;
/// used for parser only
com::sun::star::lang::Locale aParserLocale;
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 4ea8e48196e8..4f2207a84413 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -29,7 +29,7 @@ using namespace ::rtl;
namespace com { namespace sun { namespace star { namespace i18n {
-BreakIteratorImpl::BreakIteratorImpl( const Reference < XMultiServiceFactory >& rxMSF ) : xMSF( rxMSF )
+BreakIteratorImpl::BreakIteratorImpl( const Reference < XComponentContext >& rxContext ) : m_xContext( rxContext )
{
}
@@ -545,8 +545,8 @@ sal_Bool SAL_CALL BreakIteratorImpl::createLocaleSpecificBreakIterator(const OUS
}
}
- Reference < uno::XInterface > xI = xMSF->createInstance(
- OUString("com.sun.star.i18n.BreakIterator_") + aLocaleName);
+ Reference < uno::XInterface > xI = m_xContext->getServiceManager()->createInstanceWithContext(
+ OUString("com.sun.star.i18n.BreakIterator_") + aLocaleName, m_xContext);
if ( xI.is() ) {
xI->queryInterface( getCppuType((const Reference< XBreakIterator>*)0) ) >>= xBI;
@@ -563,7 +563,7 @@ BreakIteratorImpl::getLocaleSpecificBreakIterator(const Locale& rLocale) throw (
{
if (xBI.is() && rLocale == aLocale)
return xBI;
- else if (xMSF.is()) {
+ else if (m_xContext.is()) {
aLocale = rLocale;
for (size_t i = 0; i < lookupTable.size(); i++) {
diff --git a/i18npool/source/characterclassification/cclass_unicode.cxx b/i18npool/source/characterclassification/cclass_unicode.cxx
index da8529bb9bce..5e27fa50d1d6 100644
--- a/i18npool/source/characterclassification/cclass_unicode.cxx
+++ b/i18npool/source/characterclassification/cclass_unicode.cxx
@@ -35,7 +35,7 @@ namespace com { namespace sun { namespace star { namespace i18n {
// class cclass_Unicode
// ----------------------------------------------------;
-cclass_Unicode::cclass_Unicode( uno::Reference < XMultiServiceFactory > xSMgr ) : xMSF( xSMgr ),
+cclass_Unicode::cclass_Unicode( const uno::Reference < XComponentContext >& rxContext ) : m_xContext( rxContext ),
pTable( NULL ),
pStart( NULL ),
pCont( NULL ),
@@ -90,7 +90,7 @@ cclass_Unicode::toTitle( const OUString& Text, sal_Int32 nPos, sal_Int32 nCount,
trans->setMappingType(MappingTypeToTitle, rLocale);
rtl_uString* pStr = comphelper::string::rtl_uString_alloc(nCount);
sal_Unicode* out = pStr->buffer;
- BreakIteratorImpl brk(xMSF);
+ BreakIteratorImpl brk(m_xContext);
Boundary bdy = brk.getWordBoundary(Text, nPos, rLocale,
WordType::ANYWORD_IGNOREWHITESPACES, sal_True);
for (sal_Int32 i = nPos; i < nCount + nPos; i++, out++) {
diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
index c3f5ac5b72ca..3f3de5b8f002 100644
--- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx
+++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
@@ -402,7 +402,7 @@ sal_Bool cclass_Unicode::setupInternational( const Locale& rLocale )
}
if ( !mxLocaleData.is() )
{
- mxLocaleData.set( LocaleData::create(comphelper::getComponentContext(xMSF)) );
+ mxLocaleData.set( LocaleData::create(m_xContext) );
}
return bChanged;
}
@@ -1007,9 +1007,9 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
{
if ( !xNatNumSup.is() )
{
- if ( xMSF.is() )
+ if ( m_xContext.is() )
{
- xNatNumSup = NativeNumberSupplier::create( comphelper::getComponentContext(xMSF) );
+ xNatNumSup = NativeNumberSupplier::create( m_xContext );
}
}
OUString aTmp( pTextStart + r.LeadingWhiteSpace, r.EndPos - nPos +
diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx
index c83702218c8c..44e00d328f38 100644
--- a/i18npool/source/registerservices/registerservices.cxx
+++ b/i18npool/source/registerservices/registerservices.cxx
@@ -146,7 +146,7 @@ IMPL_CREATEINSTANCE( Calendar_ROC )
IMPL_CREATEINSTANCE( Calendar_hijri )
IMPL_CREATEINSTANCE( Calendar_jewish )
IMPL_CREATEINSTANCE( Calendar_buddhist )
-IMPL_CREATEINSTANCE_MSF( BreakIteratorImpl )
+IMPL_CREATEINSTANCE_CTX( BreakIteratorImpl )
IMPL_CREATEINSTANCE( BreakIterator_Unicode )
IMPL_CREATEINSTANCE( BreakIterator_ja )
IMPL_CREATEINSTANCE( BreakIterator_zh )
@@ -158,7 +158,7 @@ IMPL_CREATEINSTANCE_MSF( CollatorImpl )
IMPL_CREATEINSTANCE( Collator_Unicode )
IMPL_CREATEINSTANCE_MSF( CharacterClassificationImpl )
-IMPL_CREATEINSTANCE_MSF( cclass_Unicode )
+IMPL_CREATEINSTANCE_CTX( cclass_Unicode )
IMPL_CREATEINSTANCE_CTX( TransliterationImpl )
IMPL_CREATEINSTANCE( UnoScriptTypeDetector )