summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-11-20 12:57:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-11-30 13:59:46 +0100
commitf96db7d0ddeb737cf0e14eea6120daab860c54b7 (patch)
tree6107a9464ff9fa889740a743255f543390791f22
parentaf06afdbe8c61604b4498ce1e11660dd3b647dcc (diff)
fdo#46808, use service constructor for i18n::Collator
Change-Id: I15a360723e335345aad09e73fcb0f6815ed9e0d4
-rw-r--r--basctl/source/basicide/scriptdocument.cxx2
-rw-r--r--connectivity/source/drivers/evoab2/NResultSet.cxx6
-rw-r--r--cui/source/dialogs/cuifmsearch.cxx2
-rw-r--r--cui/source/options/optdict.cxx2
-rw-r--r--cui/source/tabpages/autocdlg.cxx17
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx2
-rw-r--r--editeng/source/misc/svxacorr.cxx11
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx2
-rw-r--r--offapi/UnoApi_offapi.mk1
-rw-r--r--sc/source/core/data/global.cxx6
-rw-r--r--sc/source/core/data/table3.cxx2
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx2
-rw-r--r--sfx2/source/dialog/templdlg.cxx2
-rw-r--r--sfx2/source/view/orgmgr.cxx2
-rw-r--r--svl/source/items/dateitem.cxx3
-rw-r--r--svl/source/items/style.cxx3
-rw-r--r--svtools/source/contnr/fileview.cxx2
-rw-r--r--svx/inc/svx/fmsrcimp.hxx4
-rw-r--r--svx/source/dialog/simptabl.cxx2
-rw-r--r--svx/source/form/fmsrcimp.cxx12
-rw-r--r--svx/source/items/numfmtsh.cxx2
-rw-r--r--svx/source/svdraw/svdattr.cxx1
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx2
-rw-r--r--sw/source/core/bastyp/init.cxx6
-rw-r--r--sw/source/core/doc/docsort.cxx3
-rw-r--r--sw/source/ui/app/docstyle.cxx4
-rw-r--r--sw/source/ui/utlui/attrdesc.cxx2
-rw-r--r--unotools/inc/unotools/collatorwrapper.hxx8
-rw-r--r--unotools/inc/unotools/intlwrapper.hxx7
-rw-r--r--unotools/source/i18n/collatorwrapper.cxx12
-rw-r--r--unotools/source/i18n/intlwrapper.cxx19
31 files changed, 66 insertions, 85 deletions
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx
index 644b816e2219..c1256b517d7f 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -1193,7 +1193,7 @@ namespace basctl
// sort document list by doc title?
if ( _eListType == DocumentsSorted )
{
- CollatorWrapper aCollator( ::comphelper::getProcessServiceFactory() );
+ CollatorWrapper aCollator( ::comphelper::getProcessComponentContext() );
aCollator.loadDefaultCollator( SvtSysLocale().GetLanguageTag().getLocale(), 0 );
::std::sort( aScriptDocs.begin(), aScriptDocs.end(), DocumentTitleLess( aCollator ) );
}
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index 9c564b29246a..b5f46408afa9 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -427,9 +427,9 @@ namespace
const SortDescriptor& rSortOrder;
IntlWrapper aIntlWrapper;
- ComparisonData( const SortDescriptor& _rSortOrder, const Reference< XMultiServiceFactory >& _rxFactory )
+ ComparisonData( const SortDescriptor& _rSortOrder, const Reference< XComponentContext >& _rxContext )
:rSortOrder( _rSortOrder )
- ,aIntlWrapper( _rxFactory, SvtSysLocale().GetLanguageTag() )
+ ,aIntlWrapper( _rxContext, SvtSysLocale().GetLanguageTag() )
{
}
};
@@ -546,7 +546,7 @@ void OEvoabResultSet::construct( const QueryData& _rData )
if ( m_pContacts && !_rData.aSortOrder.empty() )
{
- ComparisonData aCompData( _rData.aSortOrder, getConnection()->getDriver().getMSFactory() );
+ ComparisonData aCompData( _rData.aSortOrder, comphelper::getComponentContext(getConnection()->getDriver().getMSFactory()) );
m_pContacts = sortContacts( m_pContacts, aCompData );
}
}
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index 2f2f32374845..665643c91376 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -175,7 +175,7 @@ FmSearchDialog::FmSearchDialog(Window* pParent, const OUString& sInitialText, co
}
m_pSearchEngine = new FmSearchEngine(
- ::comphelper::getProcessServiceFactory(), fmscInitial.xCursor, fmscInitial.strUsedFields, fmscInitial.arrFields, SM_ALLOWSCHEDULE );
+ ::comphelper::getProcessComponentContext(), fmscInitial.xCursor, fmscInitial.strUsedFields, fmscInitial.arrFields, SM_ALLOWSCHEDULE );
initCommon( fmscInitial.xCursor );
if (fmscInitial.sFieldDisplayNames.Len() != 0)
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 97c21fd733df..9855c8a31fb5 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -376,7 +376,7 @@ sal_uInt16 SvxEditDictionaryDialog::GetLBInsertPos(const String &rDicWord)
{
sal_uInt16 nPos = USHRT_MAX;
- IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLanguageTag() );
+ IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() );
const CollatorWrapper* pCollator = aIntlWrapper.getCollator();
sal_uInt16 j;
for( j = 0; j < aWordsLB.GetEntryCount(); j++ )
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 024bcf877b8f..8dea32884d39 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -59,15 +59,6 @@ using namespace ::com::sun::star::util;
using namespace ::com::sun::star;
using namespace ::rtl;
-static ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& GetProcessFact()
-{
- static ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory > xMSF =
- ::comphelper::getProcessServiceFactory();
- return xMSF;
-}
-
OfaAutoCorrDlg::OfaAutoCorrDlg(Window* pParent, const SfxItemSet* _pSet ) :
SfxTabDialog( pParent, CUI_RES( RID_OFA_AUTOCORR_DLG ), _pSet ),
aLanguageFT ( this, CUI_RES( FT_LANG ) ),
@@ -887,7 +878,7 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage( Window* pParent,
bSWriter = pMod == SfxModule::GetActiveModule();
LanguageTag aLanguageTag( eLastDialogLanguage );
- pCompareClass = new CollatorWrapper( GetProcessFact() );
+ pCompareClass = new CollatorWrapper( comphelper::getProcessComponentContext() );
pCompareClass->loadDefaultCollator( aLanguageTag.getLocale(), 0 );
pCharClass = new CharClass( aLanguageTag );
@@ -1090,7 +1081,7 @@ void OfaAutocorrReplacePage::SetLanguage(LanguageType eSet)
delete pCharClass;
LanguageTag aLanguageTag( eLastDialogLanguage );
- pCompareClass = new CollatorWrapper( GetProcessFact() );
+ pCompareClass = new CollatorWrapper( comphelper::getProcessComponentContext() );
pCompareClass->loadDefaultCollator( aLanguageTag.getLocale(), 0 );
pCharClass = new CharClass( aLanguageTag );
ModifyHdl(&aShortED);
@@ -1381,7 +1372,7 @@ OfaAutocorrExceptPage::OfaAutocorrExceptPage( Window* pParent,
FreeResource();
::com::sun::star::lang::Locale aLcl( LanguageTag(eLastDialogLanguage ).getLocale());
- pCompareClass = new CollatorWrapper( GetProcessFact() );
+ pCompareClass = new CollatorWrapper( comphelper::getProcessComponentContext() );
pCompareClass->loadDefaultCollator( aLcl, 0 );
aNewAbbrevPB.SetClickHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl));
@@ -1555,7 +1546,7 @@ void OfaAutocorrExceptPage::SetLanguage(LanguageType eSet)
RefillReplaceBoxes(sal_False, eLang, eSet);
eLastDialogLanguage = eSet;
delete pCompareClass;
- pCompareClass = new CollatorWrapper( GetProcessFact() );
+ pCompareClass = new CollatorWrapper( comphelper::getProcessComponentContext() );
pCompareClass->loadDefaultCollator( LanguageTag( eLastDialogLanguage ).getLocale(), 0 );
ModifyHdl(&aAbbrevED);
ModifyHdl(&aDoubleCapsED);
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index b12b9927bd59..4cc6fcf6768c 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -255,7 +255,7 @@ void ExtensionBox_Impl::Init()
m_xRemoveListener = new ExtensionRemovedListener( this );
m_pLocale = new lang::Locale( Application::GetSettings().GetLanguageTag().getLocale() );
- m_pCollator = new CollatorWrapper( ::comphelper::getProcessServiceFactory() );
+ m_pCollator = new CollatorWrapper( ::comphelper::getProcessComponentContext() );
m_pCollator->loadDefaultCollator( *m_pLocale, i18n::CollatorOptions::CollatorOptions_IGNORE_CASE );
Show();
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 934876f81c0e..400eb9c31a78 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -187,15 +187,6 @@ LanguageType SvxAutoCorrDoc::GetLanguage( xub_StrLen , sal_Bool ) const
return LANGUAGE_SYSTEM;
}
-static ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& GetProcessFact()
-{
- static ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory > xMSF =
- ::comphelper::getProcessServiceFactory();
- return xMSF;
-}
-
static const LanguageTag& GetAppLang()
{
return Application::GetSettings().GetLanguageTag();
@@ -225,7 +216,7 @@ static TransliterationWrapper& GetIgnoreTranslWrapper()
static CollatorWrapper& GetCollatorWrapper()
{
static int bIsInit = 0;
- static CollatorWrapper aCollWrp( GetProcessFact() );
+ static CollatorWrapper aCollWrp( ::comphelper::getProcessComponentContext() );
if( !bIsInit )
{
aCollWrp.loadDefaultCollator( GetAppLang().getLocale(), 0 );
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index 2a6a9d8ed05f..43a4517f6f97 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -141,7 +141,7 @@ ToolbarsMenuController::ToolbarsMenuController( const ::com::sun::star::uno::Ref
m_aPropResourceURL( "ResourceURL" ),
m_bModuleIdentified( sal_False ),
m_bResetActive( sal_False ),
- m_aIntlWrapper( xServiceManager, Application::GetSettings().GetLanguageTag() )
+ m_aIntlWrapper( comphelper::getComponentContext(xServiceManager), Application::GetSettings().GetLanguageTag() )
{
}
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index c6bae56e3226..7311622379db 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -145,6 +145,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/inspection
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/i18n,\
BreakIterator \
CharacterClassification \
+ Collator \
LocaleCalendar \
LocaleData \
NativeNumberSupplier \
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 4d314ce1098a..dffdb1fb30e7 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -1146,7 +1146,7 @@ CollatorWrapper* ScGlobal::GetCollator()
{
if ( !pCollator )
{
- pCollator = new CollatorWrapper( ::comphelper::getProcessServiceFactory() );
+ pCollator = new CollatorWrapper( ::comphelper::getProcessComponentContext() );
pCollator->loadDefaultCollator( *GetLocale(), SC_COLLATOR_IGNORES );
}
return pCollator;
@@ -1155,7 +1155,7 @@ CollatorWrapper* ScGlobal::GetCaseCollator()
{
if ( !pCaseCollator )
{
- pCaseCollator = new CollatorWrapper( ::comphelper::getProcessServiceFactory() );
+ pCaseCollator = new CollatorWrapper( ::comphelper::getProcessComponentContext() );
pCaseCollator->loadDefaultCollator( *GetLocale(), 0 );
}
return pCaseCollator;
@@ -1174,7 +1174,7 @@ IntlWrapper* ScGlobal::GetScIntlWrapper()
{
if ( !pScIntlWrapper )
{
- pScIntlWrapper = new IntlWrapper( ::comphelper::getProcessServiceFactory(), LanguageTag( *GetLocale()) );
+ pScIntlWrapper = new IntlWrapper( LanguageTag( *GetLocale()) );
}
return pScIntlWrapper;
}
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index d84fe1fc552d..f759427d48c1 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -319,7 +319,7 @@ void ScTable::InitSortCollator( const ScSortParam& rPar )
if ( !rPar.aCollatorLocale.Language.isEmpty() )
{
if ( !pSortCollator || IsSortCollatorGlobal() )
- pSortCollator = new CollatorWrapper( pDocument->GetServiceManager() );
+ pSortCollator = new CollatorWrapper( comphelper::getComponentContext(pDocument->GetServiceManager()) );
pSortCollator->loadCollatorAlgorithm( rPar.aCollatorAlgorithm,
rPar.aCollatorLocale, (rPar.bCaseSens ? 0 : SC_COLLATOR_IGNORES) );
}
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 31e5b9b330b7..9b465a5d67c9 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -549,7 +549,7 @@ void ScTabPageSortOptions::Init()
pColRes = new CollatorResource();
//! use CollatorWrapper from document?
- pColWrap = new CollatorWrapper( comphelper::getProcessServiceFactory() );
+ pColWrap = new CollatorWrapper( comphelper::getProcessComponentContext() );
const ScSortItem& rSortItem = (const ScSortItem&)
GetItemSet().Get( nWhichSort );
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index daf2ed4aaa2b..a4d9c9cb1d2e 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -537,7 +537,7 @@ sal_Bool StyleTreeListBox_Impl::NotifyMoving(SvTreeListEntry* pTarget,
const sal_Bool bRet = (sal_Bool)aDropLink.Call(this);
rpNewParent = pTarget;
lPos=0;
- IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLanguageTag() );
+ IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() );
const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator();
for(SvTreeListEntry *pTmpEntry=FirstChild(pTarget);
pTmpEntry && COMPARE_LESS==pCollator->compareString(
diff --git a/sfx2/source/view/orgmgr.cxx b/sfx2/source/view/orgmgr.cxx
index 3b3f8ed472fc..0c4bb72a65fd 100644
--- a/sfx2/source/view/orgmgr.cxx
+++ b/sfx2/source/view/orgmgr.cxx
@@ -217,7 +217,7 @@ SfxOrganizeMgr::SfxOrganizeMgr( SfxOrganizeListBox_Impl *pLeft,
*/
{
pImpl->pDocList = new SfxObjectList;
- pImpl->pIntlWrapper = new IntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLanguageTag() );
+ pImpl->pIntlWrapper = new IntlWrapper( Application::GetSettings().GetLanguageTag() );
const CollatorWrapper* pCollator = pImpl->pIntlWrapper->getCaseCollator();
for ( SfxObjectShell* pTmp = SfxObjectShell::GetFirst(); pTmp; pTmp = SfxObjectShell::GetNext(*pTmp) )
{
diff --git a/svl/source/items/dateitem.cxx b/svl/source/items/dateitem.cxx
index bbe8e38b249d..dc7478d5e506 100644
--- a/svl/source/items/dateitem.cxx
+++ b/svl/source/items/dateitem.cxx
@@ -138,8 +138,7 @@ SfxItemPresentation SfxDateTimeItem::GetPresentation
{
DBG_WARNING("SfxDateTimeItem::GetPresentation():"
" Using default en_US IntlWrapper");
- const IntlWrapper aIntlWrapper(
- ::comphelper::getProcessServiceFactory(), LanguageTag( LANGUAGE_ENGLISH_US) );
+ const IntlWrapper aIntlWrapper( LanguageTag( LANGUAGE_ENGLISH_US) );
rText = aIntlWrapper.getLocaleData()->getDate(aDateTime);
rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
rText += aIntlWrapper.getLocaleData()->getTime(aDateTime);
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 2eb0b8325cce..3c1f9b78cdbb 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -333,8 +333,7 @@ XubString SfxStyleSheetBase::GetDescription( SfxMapUnit eMetric )
XubString aDesc;
const SfxPoolItem* pItem = aIter.FirstItem();
- IntlWrapper aIntlWrapper(comphelper::getProcessServiceFactory(),
- SvtSysLocale().GetLanguageTag());
+ IntlWrapper aIntlWrapper( SvtSysLocale().GetLanguageTag() );
while ( pItem )
{
XubString aItemPresentation;
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 32fd7d3c8972..9d846616fe64 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1711,7 +1711,7 @@ SvtFileView_Impl::SvtFileView_Impl( SvtFileView* pAntiImpl, Reference < XCommand
,mbReplaceNames ( sal_False )
,mnSuspendSelectCallback ( 0 )
,mbIsFirstResort ( sal_True )
- ,aIntlWrapper ( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLanguageTag() )
+ ,aIntlWrapper ( Application::GetSettings().GetLanguageTag() )
,maFolderImage ( SvtResId( IMG_SVT_FOLDER ) )
,mxCmdEnv ( xEnv )
diff --git a/svx/inc/svx/fmsrcimp.hxx b/svx/inc/svx/fmsrcimp.hxx
index 9809d5404ff7..7d033a456062 100644
--- a/svx/inc/svx/fmsrcimp.hxx
+++ b/svx/inc/svx/fmsrcimp.hxx
@@ -294,13 +294,13 @@ public:
every record as well as at the end of the search.
*/
FmSearchEngine(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& xCursor,
const ::rtl::OUString& strVisibleFields,
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xFormat,
FMSEARCH_MODE eMode);
FmSearchEngine(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& xCursor,
const ::rtl::OUString& strVisibleFields,
const InterfaceArray& arrFields,
diff --git a/svx/source/dialog/simptabl.cxx b/svx/source/dialog/simptabl.cxx
index 14517fc8e1ca..6c84f71ed081 100644
--- a/svx/source/dialog/simptabl.cxx
+++ b/svx/source/dialog/simptabl.cxx
@@ -449,7 +449,7 @@ StringCompare SvxSimpleTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry*
if(nRightKind == SV_ITEM_ID_LBOXSTRING &&
nLeftKind == SV_ITEM_ID_LBOXSTRING )
{
- IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLanguageTag() );
+ IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() );
const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator();
eCompare=(StringCompare)pCollator->compareString( ((SvLBoxString*)pLeftItem)->GetText(),
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index 0343e8ab4233..bb45f03d63b0 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -671,14 +671,14 @@ FmSearchEngine::SEARCH_RESULT FmSearchEngine::SearchRegularApprox(const ::rtl::O
DBG_NAME(FmSearchEngine);
//------------------------------------------------------------------------
-FmSearchEngine::FmSearchEngine(const Reference< XMultiServiceFactory >& _rxORB,
+FmSearchEngine::FmSearchEngine(const Reference< XComponentContext >& _rxContext,
const Reference< XResultSet > & xCursor, const ::rtl::OUString& sVisibleFields,
const Reference< XNumberFormatsSupplier > & xFormatSupplier, FMSEARCH_MODE eMode)
:m_xSearchCursor(xCursor)
,m_xFormatSupplier(xFormatSupplier)
- ,m_aCharacterClassficator( comphelper::getComponentContext(_rxORB), SvtSysLocale().GetLanguageTag() )
- ,m_aStringCompare( _rxORB )
+ ,m_aCharacterClassficator( _rxContext, SvtSysLocale().GetLanguageTag() )
+ ,m_aStringCompare( _rxContext )
,m_nCurrentFieldIndex(-2) // -1 hat schon eine Bedeutung, also nehme ich -2 fuer 'ungueltig'
,m_bUsingTextComponents(sal_False)
,m_eSearchForType(SEARCHFOR_STRING)
@@ -710,12 +710,12 @@ FmSearchEngine::FmSearchEngine(const Reference< XMultiServiceFactory >& _rxORB,
}
//------------------------------------------------------------------------
-FmSearchEngine::FmSearchEngine(const Reference< XMultiServiceFactory >& _rxORB,
+FmSearchEngine::FmSearchEngine(const Reference< XComponentContext >& _rxContext,
const Reference< XResultSet > & xCursor, const ::rtl::OUString& sVisibleFields,
const InterfaceArray& arrFields, FMSEARCH_MODE eMode)
:m_xSearchCursor(xCursor)
- ,m_aCharacterClassficator( comphelper::getComponentContext(_rxORB), SvtSysLocale().GetLanguageTag() )
- ,m_aStringCompare( _rxORB )
+ ,m_aCharacterClassficator( _rxContext, SvtSysLocale().GetLanguageTag() )
+ ,m_aStringCompare( _rxContext )
,m_nCurrentFieldIndex(-2) // -1 hat schon eine Bedeutung, also nehme ich -2 fuer 'ungueltig'
,m_bUsingTextComponents(sal_True)
,m_xOriginalIterator(xCursor)
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 7e72d3356767..d1c7b617c5ab 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -1583,7 +1583,7 @@ void SvxNumberFormatShell::GetCurrencySymbols(std::vector<rtl::OUString>& rList,
++nStart;
}
- CollatorWrapper aCollator( ::comphelper::getProcessServiceFactory());
+ CollatorWrapper aCollator( ::comphelper::getProcessComponentContext());
aCollator.loadDefaultCollator( Application::GetSettings().GetLanguageTag().getLocale(), 0);
const String aTwoSpace( RTL_CONSTASCII_USTRINGPARAM( " "));
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index f9eecbff6290..63e553a5ee1e 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -868,7 +868,6 @@ SfxItemPresentation SdrAngleItem::GetPresentation(
const IntlWrapper* pMyIntlWrapper = NULL;
if(!pIntlWrapper)
pIntlWrapper = pMyIntlWrapper = new IntlWrapper(
- ::comphelper::getProcessServiceFactory(),
Application::GetSettings().GetLanguageTag() );
if(pIntlWrapper->getLocaleData()->isNumLeadingZero())
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 0aa09b3944f8..98eaa94bd329 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -387,7 +387,7 @@ StringCompare DictionaryList::ColumnCompare( SvTreeListEntry* pLeft, SvTreeListE
if(nRightKind == SV_ITEM_ID_LBOXSTRING &&
nLeftKind == SV_ITEM_ID_LBOXSTRING )
{
- IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLanguageTag() );
+ IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() );
const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator();
eCompare=(StringCompare)pCollator->compareString( ((SvLBoxString*)pLeftItem)->GetText(),
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 72eee3ac669f..73bc1df0070f 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -828,9 +828,8 @@ CollatorWrapper& GetAppCollator()
if( !pCollator )
{
const lang::Locale& rLcl = pBreakIt->GetLocale( GetAppLanguage() );
- uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- pCollator = new CollatorWrapper( xMSF );
+ pCollator = new CollatorWrapper( ::comphelper::getProcessComponentContext() );
pCollator->loadDefaultCollator( rLcl, SW_COLLATOR_IGNORES );
}
return *pCollator;
@@ -840,9 +839,8 @@ CollatorWrapper& GetAppCaseCollator()
if( !pCaseCollator )
{
const lang::Locale& rLcl = pBreakIt->GetLocale( GetAppLanguage() );
- uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- pCaseCollator = new CollatorWrapper( xMSF );
+ pCaseCollator = new CollatorWrapper( ::comphelper::getProcessComponentContext() );
pCaseCollator->loadDefaultCollator( rLcl, 0 );
}
return *pCaseCollator;
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 9d78963c2a6c..40cc23e66c3d 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -86,8 +86,7 @@ void SwSortElement::Init( SwDoc* pD, const SwSortOptions& rOpt,
}
pLocale = new lang::Locale( LanguageTag( nLang ).getLocale() );
- pSortCollator = new CollatorWrapper(
- ::comphelper::getProcessServiceFactory() );
+ pSortCollator = new CollatorWrapper( ::comphelper::getProcessComponentContext() );
}
void SwSortElement::Finit()
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index 136a2a6e4cbf..fa38da7c538a 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -573,9 +573,7 @@ bool SwDocStyleSheet::HasClearParentSupport() const
--------------------------------------------------------------------*/
String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit)
{
- IntlWrapper aIntlWrapper(
- ::comphelper::getProcessServiceFactory(),
- SvtSysLocale().GetLanguageTag());
+ IntlWrapper aIntlWrapper( SvtSysLocale().GetLanguageTag() );
rtl::OUString sPlus(" + ");
if ( SFX_STYLE_FAMILY_PAGE == nFamily )
diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx
index f95e1e94e21e..7dee04c34f1f 100644
--- a/sw/source/ui/utlui/attrdesc.cxx
+++ b/sw/source/ui/utlui/attrdesc.cxx
@@ -73,7 +73,7 @@ void SwAttrSet::GetPresentation(
if( Count() )
{
SfxItemIter aIter( *this );
- const IntlWrapper rInt( ::comphelper::getProcessServiceFactory(),
+ const IntlWrapper rInt( ::comphelper::getProcessComponentContext(),
GetAppLanguageTag() );
while( sal_True )
{
diff --git a/unotools/inc/unotools/collatorwrapper.hxx b/unotools/inc/unotools/collatorwrapper.hxx
index 0752b653d8dc..c73be3518569 100644
--- a/unotools/inc/unotools/collatorwrapper.hxx
+++ b/unotools/inc/unotools/collatorwrapper.hxx
@@ -23,8 +23,8 @@
#include <com/sun/star/i18n/XCollator.hpp>
-namespace com { namespace sun { namespace star { namespace lang {
- class XMultiServiceFactory;
+namespace com { namespace sun { namespace star { namespace uno {
+ class XComponentContext;
}}}}
class UNOTOOLS_DLLPUBLIC CollatorWrapper
@@ -32,7 +32,7 @@ class UNOTOOLS_DLLPUBLIC CollatorWrapper
private:
::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory
+ ::com::sun::star::uno::XComponentContext
> mxServiceFactory;
::com::sun::star::uno::Reference<
@@ -43,7 +43,7 @@ class UNOTOOLS_DLLPUBLIC CollatorWrapper
CollatorWrapper (
const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory > &xServiceFactoryIn);
+ ::com::sun::star::uno::XComponentContext > &rxContext);
~CollatorWrapper();
diff --git a/unotools/inc/unotools/intlwrapper.hxx b/unotools/inc/unotools/intlwrapper.hxx
index 7d1665264d4d..0320d2a8204e 100644
--- a/unotools/inc/unotools/intlwrapper.hxx
+++ b/unotools/inc/unotools/intlwrapper.hxx
@@ -49,7 +49,7 @@ class UNOTOOLS_DLLPUBLIC IntlWrapper
private:
LanguageTag maLanguageTag;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
LocaleDataWrapper* pLocaleData;
CollatorWrapper* pCollator;
@@ -61,7 +61,10 @@ private:
public:
IntlWrapper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
+ const LanguageTag& rLanguageTag
+ );
+ IntlWrapper(
const LanguageTag& rLanguageTag
);
~IntlWrapper();
diff --git a/unotools/source/i18n/collatorwrapper.cxx b/unotools/source/i18n/collatorwrapper.cxx
index 5611ab7b2f39..b64268ffe2cc 100644
--- a/unotools/source/i18n/collatorwrapper.cxx
+++ b/unotools/source/i18n/collatorwrapper.cxx
@@ -19,19 +19,13 @@
#include <unotools/collatorwrapper.hxx>
#include <tools/debug.hxx>
-
-#include "instance.hxx"
+#include <com/sun/star/i18n/Collator.hpp>
using namespace ::com::sun::star;
-CollatorWrapper::CollatorWrapper (
- const uno::Reference< lang::XMultiServiceFactory > &xServiceFactory)
- : mxServiceFactory (xServiceFactory)
+CollatorWrapper::CollatorWrapper ( const uno::Reference< uno::XComponentContext > &rxContext )
{
- mxInternationalCollator = uno::Reference< i18n::XCollator > (
- intl_createInstance( xServiceFactory, "com.sun.star.i18n.Collator",
- "CollatorWrapper" ), uno::UNO_QUERY );
- DBG_ASSERT (mxInternationalCollator.is(), "CollatorWrapper: no i18n collator");
+ mxInternationalCollator = i18n::Collator::create( rxContext );
}
CollatorWrapper::~CollatorWrapper()
diff --git a/unotools/source/i18n/intlwrapper.cxx b/unotools/source/i18n/intlwrapper.cxx
index 075604e92b9c..059f08d9c22a 100644
--- a/unotools/source/i18n/intlwrapper.cxx
+++ b/unotools/source/i18n/intlwrapper.cxx
@@ -24,17 +24,27 @@
#include <comphelper/processfactory.hxx>
IntlWrapper::IntlWrapper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
const LanguageTag& rLanguageTag )
:
maLanguageTag( rLanguageTag ),
- xSMgr( xSF ),
+ m_xContext( rxContext ),
pLocaleData( NULL ),
pCollator( NULL ),
pCaseCollator( NULL )
{
}
+IntlWrapper::IntlWrapper(
+ const LanguageTag& rLanguageTag )
+ :
+ maLanguageTag( rLanguageTag ),
+ m_xContext( comphelper::getProcessComponentContext() ),
+ pLocaleData( NULL ),
+ pCollator( NULL ),
+ pCaseCollator( NULL )
+{
+}
IntlWrapper::~IntlWrapper()
{
@@ -46,14 +56,13 @@ IntlWrapper::~IntlWrapper()
void IntlWrapper::ImplNewLocaleData() const
{
- ((IntlWrapper*)this)->pLocaleData = new LocaleDataWrapper(
- comphelper::getComponentContext(xSMgr), maLanguageTag );
+ ((IntlWrapper*)this)->pLocaleData = new LocaleDataWrapper( m_xContext, maLanguageTag );
}
void IntlWrapper::ImplNewCollator( sal_Bool bCaseSensitive ) const
{
- CollatorWrapper* p = new CollatorWrapper( xSMgr );
+ CollatorWrapper* p = new CollatorWrapper( m_xContext );
if ( bCaseSensitive )
{
p->loadDefaultCollator( maLanguageTag.getLocale(), 0 );