summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-10 16:40:27 +0200
committerNoel Grandin <noel@peralex.com>2013-01-28 08:25:24 +0200
commitf95a7c2c6d5c2158de12bb3ca6fd94b139e33c62 (patch)
tree85f09e15fd9954a84f55e561cb174fe0450ea99f
parentb772eb0c728a06bdf72866ef61f800bbf7ec15a9 (diff)
fdo#46808, Convert SvNumberFormatter to use XComponentContext
Change-Id: If4e8312dae6bc5eb8bb7655cf250f06ab37b7e5c
-rw-r--r--basic/source/runtime/methods.cxx4
-rw-r--r--basic/source/runtime/runtime.cxx5
-rw-r--r--basic/source/sbx/sbxdate.cxx10
-rw-r--r--basic/source/sbx/sbxscan.cxx4
-rw-r--r--chart2/source/model/main/ChartModel.cxx3
-rw-r--r--cui/source/options/optupdt.cxx2
-rw-r--r--filter/source/svg/svgexport.cxx2
-rw-r--r--forms/source/component/FormattedField.cxx12
-rw-r--r--sc/source/core/data/dpobject.cxx4
-rw-r--r--sc/source/core/data/global.cxx2
-rw-r--r--sc/source/core/data/poolhelp.cxx2
-rw-r--r--sc/source/filter/excel/xestyle.cxx4
-rw-r--r--sc/source/ui/docshell/docsh.cxx2
-rw-r--r--sc/source/ui/docshell/impex.cxx4
-rw-r--r--sc/source/ui/miscdlgs/autofmt.cxx2
-rw-r--r--sd/source/ui/app/sdmod.cxx2
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx2
-rw-r--r--svl/inc/svl/zforlist.hxx12
-rw-r--r--svl/source/numbers/supservs.cxx2
-rw-r--r--svl/source/numbers/zforlist.cxx22
-rw-r--r--svl/source/numbers/zforscan.cxx2
-rw-r--r--svtools/source/control/fmtfield.cxx2
-rw-r--r--sw/source/core/doc/docfmt.cxx3
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx2
-rw-r--r--sw/source/ui/table/tautofmt.cxx13
-rw-r--r--sw/source/ui/utlui/numfmtlb.cxx5
-rw-r--r--uui/source/iahndl-ssl.cxx3
-rw-r--r--xmloff/inc/xmloff/xmlnumfi.hxx11
-rw-r--r--xmloff/source/core/xmlimp.cxx4
-rw-r--r--xmloff/source/draw/ximpstyl.cxx4
-rw-r--r--xmloff/source/style/xmlnumfe.cxx8
-rw-r--r--xmloff/source/style/xmlnumfi.cxx28
32 files changed, 77 insertions, 110 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 3a6eb970bbaf..b9a286127c2c 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1966,9 +1966,7 @@ RTLFUNC(DateValue)
if( !bSuccess && ( eLangType != LANGUAGE_ENGLISH_US ) )
{
// Create a new SvNumberFormatter by using LANGUAGE_ENGLISH to get the date value;
- uno::Reference< lang::XMultiServiceFactory >
- xFactory = comphelper::getProcessServiceFactory();
- SvNumberFormatter aFormatter( xFactory, LANGUAGE_ENGLISH_US );
+ SvNumberFormatter aFormatter( comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US );
bSuccess = aFormatter.IsNumberFormat( aStr, nIndex, fResult );
nType = aFormatter.GetType( nIndex );
}
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index eba60649f255..55836e8593af 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -349,9 +349,6 @@ void SbiInstance::PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter,
sal_uInt32 &rnStdDateIdx, sal_uInt32 &rnStdTimeIdx, sal_uInt32 &rnStdDateTimeIdx,
LanguageType* peFormatterLangType, DateFormat* peFormatterDateFormat )
{
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- xFactory = comphelper::getProcessServiceFactory();
-
LanguageType eLangType;
if( peFormatterLangType )
{
@@ -372,7 +369,7 @@ void SbiInstance::PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter,
eDate = aSysLocale.GetLocaleData().getDateFormat();
}
- rpNumberFormatter = new SvNumberFormatter( xFactory, eLangType );
+ rpNumberFormatter = new SvNumberFormatter( comphelper::getProcessComponentContext(), eLangType );
sal_Int32 nCheckPos = 0; short nType;
rnStdTimeIdx = rpNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eLangType );
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index 6d0a4073a64a..f28c5851f954 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -98,10 +98,7 @@ double ImpGetDate( const SbxValues* p )
{
LanguageType eLangType = GetpApp()->GetSettings().GetLanguageTag().getLanguageType();
- SvNumberFormatter* pFormatter;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- xFactory = comphelper::getProcessServiceFactory();
- pFormatter = new SvNumberFormatter( xFactory, eLangType );
+ SvNumberFormatter* pFormatter = new SvNumberFormatter( comphelper::getProcessComponentContext(), eLangType );
sal_uInt32 nIndex;
sal_Int32 nCheckPos = 0;
@@ -271,10 +268,7 @@ start:
Color* pColor;
LanguageType eLangType = GetpApp()->GetSettings().GetLanguageTag().getLanguageType();
- SvNumberFormatter* pFormatter;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- xFactory = comphelper::getProcessServiceFactory();
- pFormatter = new SvNumberFormatter( xFactory, eLangType );
+ SvNumberFormatter* pFormatter = new SvNumberFormatter( comphelper::getProcessComponentContext(), eLangType );
sal_uInt32 nIndex;
sal_Int32 nCheckPos = 0;
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 4febd4c27935..856a40daa805 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -717,9 +717,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const
}
LanguageType eLangType = GetpApp()->GetSettings().GetLanguageTag().getLanguageType();
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- xFactory = comphelper::getProcessServiceFactory();
- SvNumberFormatter aFormatter( xFactory, eLangType );
+ SvNumberFormatter aFormatter( comphelper::getProcessComponentContext(), eLangType );
sal_uInt32 nIndex;
double nNumber;
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 053bf079df4a..0564adde45e1 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -1272,8 +1272,7 @@ Reference< util::XNumberFormatsSupplier > ChartModel::impl_getNumberFormatsSuppl
{
if( !m_xOwnNumberFormatsSupplier.is() )
{
- Reference< lang::XMultiServiceFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY );
- m_apSvNumberFormatter.reset( new SvNumberFormatter( xFactory, LANGUAGE_SYSTEM ) );
+ m_apSvNumberFormatter.reset( new SvNumberFormatter( m_xContext, LANGUAGE_SYSTEM ) );
m_xOwnNumberFormatsSupplier = new SvNumberFormatsSupplierObj( m_apSvNumberFormatter.get() );
//pOwnNumberFormatter->ChangeStandardPrec( 15 ); todo?
}
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 9dc4b72177f4..3475b5615806 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -127,7 +127,7 @@ void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
}
LanguageType eUILang = Application::GetSettings().GetUILanguageTag().getLanguageType();
- SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), eUILang );
+ SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessComponentContext(), eUILang );
String aTmpStr;
Color* pColor = NULL;
Date* pNullDate = pNumberFormatter->GetNullDate();
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 2bf32d0ce995..4d04490a17fd 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -2206,7 +2206,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo )
{
String sDate;
LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
- SvNumberFormatter * pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), LANGUAGE_SYSTEM );
+ SvNumberFormatter * pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessComponentContext(), LANGUAGE_SYSTEM );
// We always collect the characters obtained by using the SVXDATEFORMAT_B (as: 13.02.1996)
// so we are sure to include any unusual day|month|year separator.
Date aDate( 1, 1, 1996 );
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx
index cc6e967f0855..0eb9406c8bf2 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -92,13 +92,13 @@ protected:
static WeakReference< XNumberFormatsSupplier > s_xDefaultFormatsSupplier;
public:
- static Reference< XNumberFormatsSupplier > get( const Reference< XMultiServiceFactory >& _rxORB );
+ static Reference< XNumberFormatsSupplier > get( const Reference< XComponentContext >& _rxORB );
using SvNumberFormatsSupplierObj::operator new;
using SvNumberFormatsSupplierObj::operator delete;
protected:
- StandardFormatsSupplier(const Reference<XMultiServiceFactory>& _rxFactory,LanguageType _eSysLanguage);
+ StandardFormatsSupplier(const Reference< XComponentContext >& _rxFactory,LanguageType _eSysLanguage);
~StandardFormatsSupplier();
protected:
@@ -110,9 +110,9 @@ protected:
WeakReference< XNumberFormatsSupplier > StandardFormatsSupplier::s_xDefaultFormatsSupplier;
//------------------------------------------------------------------
-StandardFormatsSupplier::StandardFormatsSupplier(const Reference< XMultiServiceFactory > & _rxFactory,LanguageType _eSysLanguage)
+StandardFormatsSupplier::StandardFormatsSupplier(const Reference< XComponentContext > & _rxContext,LanguageType _eSysLanguage)
:SvNumberFormatsSupplierObj()
- ,m_pMyPrivateFormatter(new SvNumberFormatter(_rxFactory, _eSysLanguage))
+ ,m_pMyPrivateFormatter(new SvNumberFormatter(_rxContext, _eSysLanguage))
{
SetNumberFormatter(m_pMyPrivateFormatter);
@@ -129,7 +129,7 @@ StandardFormatsSupplier::~StandardFormatsSupplier()
}
//------------------------------------------------------------------
-Reference< XNumberFormatsSupplier > StandardFormatsSupplier::get( const Reference< XMultiServiceFactory >& _rxORB )
+Reference< XNumberFormatsSupplier > StandardFormatsSupplier::get( const Reference< XComponentContext >& _rxORB )
{
LanguageType eSysLanguage = LANGUAGE_SYSTEM;
{
@@ -661,7 +661,7 @@ Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() co
//------------------------------------------------------------------------------
Reference< XNumberFormatsSupplier > OFormattedModel::calcDefaultFormatsSupplier() const
{
- return StandardFormatsSupplier::get( getContext().getLegacyServiceFactory() );
+ return StandardFormatsSupplier::get( getContext().getUNOContext() );
}
// XBoundComponent
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index d86a012118e3..c82926827f22 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2847,7 +2847,7 @@ const ScDPCache* ScDPCollection::DBCaches::getCache(
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr<ScDPCache> pCache(new ScDPCache(mpDoc));
SAL_WNODEPRECATED_DECLARATIONS_POP
- SvNumberFormatter aFormat(mpDoc->GetServiceManager(), ScGlobal::eLnge);
+ SvNumberFormatter aFormat( comphelper::getComponentContext(mpDoc->GetServiceManager()), ScGlobal::eLnge);
DBConnector aDB(*pCache, xRowSet, *aFormat.GetNullDate());
if (!aDB.isValid())
return NULL;
@@ -2961,7 +2961,7 @@ void ScDPCollection::DBCaches::updateCache(
return;
}
- SvNumberFormatter aFormat(mpDoc->GetServiceManager(), ScGlobal::eLnge);
+ SvNumberFormatter aFormat( comphelper::getComponentContext(mpDoc->GetServiceManager()), ScGlobal::eLnge);
DBConnector aDB(rCache, xRowSet, *aFormat.GetNullDate());
if (!aDB.isValid())
return;
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index e18d241ba54b..5f146c813a16 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -208,7 +208,7 @@ SvNumberFormatter* ScGlobal::GetEnglishFormatter()
if ( !pEnglishFormatter )
{
pEnglishFormatter = new SvNumberFormatter(
- ::comphelper::getProcessServiceFactory(), LANGUAGE_ENGLISH_US );
+ ::comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US );
pEnglishFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_INTL_FORMAT );
}
return pEnglishFormatter;
diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx
index c8d4780f3a1e..c2ba946938a2 100644
--- a/sc/source/core/data/poolhelp.cxx
+++ b/sc/source/core/data/poolhelp.cxx
@@ -73,7 +73,7 @@ SvNumberFormatter* ScPoolHelper::GetFormTable() const
{
if ( !pFormTable )
{
- pFormTable = new SvNumberFormatter( m_pSourceDoc->GetServiceManager(), ScGlobal::eLnge );
+ pFormTable = new SvNumberFormatter( comphelper::getComponentContext(m_pSourceDoc->GetServiceManager()), ScGlobal::eLnge );
pFormTable->SetColorLink( LINK( m_pSourceDoc, ScDocument, GetUserDefinedColor ) );
pFormTable->SetEvalDateFormat( NF_EVALDATEFORMAT_INTL_FORMAT );
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index a7b8b032160c..ff39ed467d49 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1225,7 +1225,7 @@ XclExpNumFmtBuffer::XclExpNumFmtBuffer( const XclExpRoot& rRoot ) :
/* Compiler needs a hint, this doesn't work: new NfKeywordTable;
cannot convert from 'class String *' to 'class String (*)[54]'
The effective result here is class String (*)[54*1] */
- mxFormatter( new SvNumberFormatter( rRoot.GetDoc().GetServiceManager(), LANGUAGE_ENGLISH_US ) ),
+ mxFormatter( new SvNumberFormatter( comphelper::getComponentContext(rRoot.GetDoc().GetServiceManager()), LANGUAGE_ENGLISH_US ) ),
mpKeywordTable( new NfKeywordTable ),
mnStdFmt( GetFormatter().GetStandardFormat( ScGlobal::eLnge ) )
{
@@ -2866,7 +2866,7 @@ void XclExpXFBuffer::AddBorderAndFill( const XclExpXF& rXF )
XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot )
: XclExpRoot( rRoot ),
- mxFormatter( new SvNumberFormatter( rRoot.GetDoc().GetServiceManager(), LANGUAGE_ENGLISH_US ) ),
+ mxFormatter( new SvNumberFormatter( comphelper::getComponentContext(rRoot.GetDoc().GetServiceManager()), LANGUAGE_ENGLISH_US ) ),
mpKeywordTable( new NfKeywordTable )
{
mxFormatter->FillKeywordTable( *mpKeywordTable, LANGUAGE_ENGLISH_US );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 79e7dd09fb0a..21629ce6a80c 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1360,7 +1360,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
ScRange aRange;
// HTML macht eigenes ColWidth/RowHeight
CalcOutputFactor();
- SvNumberFormatter aNumFormatter(aDocument.GetServiceManager(), eLang);
+ SvNumberFormatter aNumFormatter( comphelper::getComponentContext(aDocument.GetServiceManager()), eLang);
eError = ScFormatFilter::Get().ScImportHTML( *pInStream, rMedium.GetBaseURL(), &aDocument, aRange,
GetOutputFactor(), !bWebQuery, &aNumFormatter, bDateConvert );
if (eError != eERR_OK)
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 09ec1cd750cb..12d04a136699 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1279,7 +1279,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
long nSkipLines = pExtOptions->GetStartRow();
LanguageType eDocLang = pExtOptions->GetLanguage();
- SvNumberFormatter aNumFormatter(pDoc->GetServiceManager(), eDocLang);
+ SvNumberFormatter aNumFormatter( comphelper::getComponentContext(pDoc->GetServiceManager()), eDocLang);
bool bDetectNumFormat = pExtOptions->IsDetectSpecialNumber();
// For date recognition
@@ -2175,7 +2175,7 @@ bool ScImportExport::HTML2Doc( SvStream& rStrm, const String& rBaseURL )
{
// Pick up import options if available.
LanguageType eLang = pExtOptions->GetLanguage();
- SvNumberFormatter aNumFormatter(pDoc->GetServiceManager(), eLang);
+ SvNumberFormatter aNumFormatter( comphelper::getComponentContext(pDoc->GetServiceManager()), eLang);
bool bSpecialNumber = pExtOptions->IsDetectSpecialNumber();
pImp->WriteToDocument(false, 1.0, &aNumFormatter, bSpecialNumber);
}
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index 1a354f8f90e2..bf3317716c5f 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -75,7 +75,7 @@ ScAutoFmtPreview::ScAutoFmtPreview( Window* pParent, const ResId& rRes, ScDocume
aStrMid ( ScResId( STR_MID ) ),
aStrSouth ( ScResId( STR_SOUTH ) ),
aStrSum ( ScResId( STR_SUM ) ),
- pNumFmt ( new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), ScGlobal::eLnge ) )
+ pNumFmt ( new SvNumberFormatter( ::comphelper::getProcessComponentContext(), ScGlobal::eLnge ) )
{
Init();
}
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index f84fb4447d15..3ab54fb528b0 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -245,7 +245,7 @@ SvStorageStreamRef SdModule::GetOptionStream( const String& rOptionName,
SvNumberFormatter* SdModule::GetNumberFormatter()
{
if( !pNumberFormatter )
- pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), LANGUAGE_SYSTEM );
+ pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessComponentContext(), LANGUAGE_SYSTEM );
return pNumberFormatter;
}
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index c7655150d6b3..9655c32219fe 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1712,7 +1712,7 @@ CustomPropertiesWindow::CustomPropertiesWindow(Window* pParent,
m_aYesNoButton ( this, SfxResId( SFX_WIN_PROPERTY_YESNO ) ),
m_aRemoveButton ( this, SfxResId( SFX_PB_PROPERTY_REMOVE ) ),
m_nScrollPos (0),
- m_aNumberFormatter( ::comphelper::getProcessServiceFactory(),
+ m_aNumberFormatter( ::comphelper::getProcessComponentContext(),
Application::GetSettings().GetLanguageTag().getLanguageType() )
{
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx
index b7e6949f89d2..9167bfc33790 100644
--- a/svl/inc/svl/zforlist.hxx
+++ b/svl/inc/svl/zforlist.hxx
@@ -47,8 +47,8 @@ class ImpSvNumberInputScan;
class SvNumberformat;
namespace com { namespace sun { namespace star {
- namespace lang {
- class XMultiServiceFactory;
+ namespace uno {
+ class XComponentContext;
}
}}}
@@ -325,7 +325,7 @@ public:
/// Preferred ctor with service manager and language/country enum
SvNumberFormatter(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMgr,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
LanguageType eLang
);
@@ -788,7 +788,7 @@ public:
static bool IsLocaleInstalled( LanguageType eLang );
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
LanguageTag maLanguageTag;
SvNumberFormatTable aFTable; // Table of format keys to format entries
typedef std::map<sal_uInt32, sal_uInt32> DefaultFormatKeysMap;
@@ -936,9 +936,9 @@ public:
// new format codes are appended.
void ReplaceSystemCL( LanguageType eOldLanguage );
- inline ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceManager() const
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > GetComponentContext() const
{
- return xServiceManager;
+ return m_xContext;
}
diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx
index 905f2a09b15b..a82bb0a76c51 100644
--- a/svl/source/numbers/supservs.cxx
+++ b/svl/source/numbers/supservs.cxx
@@ -111,7 +111,7 @@ void SAL_CALL SvNumberFormatsSupplierServiceObject::initialize( const Sequence<
#endif
}
- m_pOwnFormatter = new SvNumberFormatter(m_xORB, eNewFormatterLanguage);
+ m_pOwnFormatter = new SvNumberFormatter( comphelper::getComponentContext(m_xORB), eNewFormatterLanguage);
m_pOwnFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT_INTL );
SetNumberFormatter(m_pOwnFormatter);
}
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 482dee35cd76..e2fa5f6efb30 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -188,9 +188,9 @@ sal_uInt16 SvNumberFormatter::nSystemCurrencyPosition = 0;
const sal_uInt16 SvNumberFormatter::UNLIMITED_PRECISION = ::std::numeric_limits<sal_uInt16>::max();
const sal_uInt16 SvNumberFormatter::INPUTSTRING_PRECISION = ::std::numeric_limits<sal_uInt16>::max()-1;
-SvNumberFormatter::SvNumberFormatter( const Reference< XMultiServiceFactory >& xSMgr,
+SvNumberFormatter::SvNumberFormatter( const Reference< XComponentContext >& rxContext,
LanguageType eLang )
- : xServiceManager( xSMgr )
+ : m_xContext( rxContext )
, maLanguageTag( eLang)
{
ImpConstruct( eLang );
@@ -234,12 +234,12 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang )
nDefaultSystemCurrencyFormat = NUMBERFORMAT_ENTRY_NOT_FOUND;
maLanguageTag.reset( eLang );
- pCharClass = new CharClass( comphelper::getComponentContext(xServiceManager), maLanguageTag );
- xLocaleData.init( comphelper::getComponentContext(xServiceManager), maLanguageTag );
- xCalendar.init( comphelper::getComponentContext(xServiceManager), maLanguageTag.getLocale() );
- xTransliteration.init( comphelper::getComponentContext(xServiceManager), eLang,
+ pCharClass = new CharClass( m_xContext, maLanguageTag );
+ xLocaleData.init( m_xContext, maLanguageTag );
+ xCalendar.init( m_xContext, maLanguageTag.getLocale() );
+ xTransliteration.init( m_xContext, eLang,
::com::sun::star::i18n::TransliterationModules_IGNORE_CASE );
- xNatNum.init( comphelper::getComponentContext(xServiceManager) );
+ xNatNum.init( m_xContext );
// cached locale data items
const LocaleDataWrapper* pLoc = GetLocaleData();
@@ -474,7 +474,7 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage )
pStdFormat->SetLastInsertKey( sal_uInt16(nLastKey - nCLOffset) );
// append new system additional formats
- NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(xServiceManager),
+ NumberFormatCodeWrapper aNumberFormatCode( m_xContext,
GetLanguageTag().getLocale() );
ImpGenerateAdditionalFormats( nCLOffset, aNumberFormatCode, true );
}
@@ -736,7 +736,7 @@ bool SvNumberFormatter::Load( SvStream& rStream )
// different SYSTEM locale
if ( !pConverter )
{
- pConverter = new SvNumberFormatter( xServiceManager, eSysLang );
+ pConverter = new SvNumberFormatter( m_xContext, eSysLang );
}
pEntry->ConvertLanguage( *pConverter, eSaveSysLang, eLoadSysLang, true );
}
@@ -781,7 +781,7 @@ bool SvNumberFormatter::Load( SvStream& rStream )
// generate additional i18n standard formats for all used locales
LanguageType eOldLanguage = ActLnge;
- NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(xServiceManager),
+ NumberFormatCodeWrapper aNumberFormatCode( m_xContext,
GetLanguageTag().getLocale() );
std::vector<sal_uInt16> aList;
GetUsedLanguages( aList );
@@ -2247,7 +2247,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio
pFormatScanner->SetConvertMode(false); // switch off for this function
}
- NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(xServiceManager),
+ NumberFormatCodeWrapper aNumberFormatCode( m_xContext,
GetLanguageTag().getLocale() );
SvNumberformat* pNewFormat = NULL;
sal_Int32 nIdx;
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 24c14a739b09..73e6add49ca6 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -225,7 +225,7 @@ void ImpSvNumberformatScan::SetDependentKeywords()
// requested Locale, otherwise number format codes might not match
const LanguageTag& rLoadedLocale = pLocaleData->getLoadedLanguageTag();
LanguageType eLang = rLoadedLocale.getLanguageType( false);
- NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ NumberFormatCodeWrapper aNumberFormatCode( pFormatter->GetComponentContext(),
rLoadedLocale.getLocale() );
i18n::NumberFormatCode aFormat = aNumberFormatCode.getFormatCode( NF_NUMBER_STANDARD );
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index b8b67748b315..b580109846b4 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -286,7 +286,7 @@ SvNumberFormatter* FormattedField::StaticFormatter::GetFormatter()
// get the Office's locale and translate
LanguageType eSysLanguage = SvtSysLocale().GetLanguageTag().getLanguageType( false);
s_cFormatter = new SvNumberFormatter(
- ::comphelper::getProcessServiceFactory(),
+ ::comphelper::getProcessComponentContext(),
eSysLanguage);
}
return s_cFormatter;
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 484c93c1aa46..dec44945f1a2 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -2311,8 +2311,7 @@ void SwDoc::_CreateNumberFormatter()
LanguageType eLang = LANGUAGE_SYSTEM;
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- pNumberFormatter = new SvNumberFormatter( xMSF, eLang );
+ pNumberFormatter = new SvNumberFormatter( comphelper::getProcessComponentContext(), eLang );
pNumberFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT_INTL );
pNumberFormatter->SetYear2000(static_cast<sal_uInt16>(::utl::MiscCfg().GetYear2000()));
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 393a685757c6..3d3bcf4ed0ee 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2308,7 +2308,7 @@ bool MSWordExportBase::GetNumberFmt(const SwField& rFld, String& rStr)
if( pNumFmt )
{
sal_uInt16 nLng = rFld.GetLanguage();
- LocaleDataWrapper aLocDat(comphelper::getComponentContext(pNFmtr->GetServiceManager()),
+ LocaleDataWrapper aLocDat(pNFmtr->GetComponentContext(),
LanguageTag(nLng));
String sFmt(pNumFmt->GetMappedFormatstring(GetNfKeywordTable(),
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 8995ac076a78..fcc36424c1f5 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -78,7 +78,6 @@ private:
const String aStrSum;
SvNumberFormatter* pNumFmt;
- uno::Reference< lang::XMultiServiceFactory > m_xMSF;
uno::Reference< i18n::XBreakIterator > m_xBreak;
//-------------------------------------------
@@ -544,15 +543,11 @@ AutoFmtPreview::AutoFmtPreview(Window* pParent) :
aStrNorth ( SW_RES( STR_NORTH ) ),
aStrMid ( SW_RES( STR_MID ) ),
aStrSouth ( SW_RES( STR_SOUTH ) ),
- aStrSum ( SW_RES( STR_SUM ) ),
- m_xMSF ( comphelper::getProcessServiceFactory() )
+ aStrSum ( SW_RES( STR_SUM ) )
{
- OSL_ENSURE( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory");
- if ( m_xMSF.is() )
- {
- m_xBreak = i18n::BreakIterator::create(comphelper::getComponentContext(m_xMSF));
- }
- pNumFmt = new SvNumberFormatter( m_xMSF, LANGUAGE_SYSTEM );
+ uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+ m_xBreak = i18n::BreakIterator::create(xContext);
+ pNumFmt = new SvNumberFormatter( xContext, LANGUAGE_SYSTEM );
Init();
}
diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx
index ced1283cf541..7dbfe5c50613 100644
--- a/sw/source/ui/utlui/numfmtlb.cxx
+++ b/sw/source/ui/utlui/numfmtlb.cxx
@@ -97,9 +97,8 @@ void NumFormatListBox::Init(short nFormatType, sal_Bool bUsrFmts)
eCurLanguage = SvtSysLocale().GetLanguageTag().getLanguageType();
if (bUsrFmts == sal_False)
- {
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- pOwnFormatter = new SvNumberFormatter(xMSF, eCurLanguage);
+ {
+ pOwnFormatter = new SvNumberFormatter(comphelper::getProcessComponentContext(), eCurLanguage);
}
SetFormatType(nFormatType);
diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx
index 4e34999bd611..c81aefc4a86e 100644
--- a/uui/source/iahndl-ssl.cxx
+++ b/uui/source/iahndl-ssl.cxx
@@ -114,8 +114,7 @@ getLocalizedDatTimeStr(
aTime = Time( rDateTime.Hours, rDateTime.Minutes, rDateTime.Seconds );
LanguageType eUILang = Application::GetSettings().GetUILanguageTag().getLanguageType();
- SvNumberFormatter *pNumberFormatter
- = new SvNumberFormatter( uno::Reference<lang::XMultiServiceFactory>(xContext->getServiceManager(), uno::UNO_QUERY_THROW), eUILang );
+ SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( xContext, eUILang );
String aTmpStr;
Color* pColor = NULL;
Date* pNullDate = pNumberFormatter->GetNullDate();
diff --git a/xmloff/inc/xmloff/xmlnumfi.hxx b/xmloff/inc/xmloff/xmlnumfi.hxx
index f162f5be8aa1..678d9f26ae29 100644
--- a/xmloff/inc/xmloff/xmlnumfi.hxx
+++ b/xmloff/inc/xmloff/xmlnumfi.hxx
@@ -74,21 +74,14 @@ class SvXMLNumFmtHelper
{
SvXMLNumImpData* pData;
- // #110680#
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
-
public:
- // #110680#
- //SvXMLNumFmtHelper( const ::com::sun::star::uno::Reference<
- // ::com::sun::star::util::XNumberFormatsSupplier >& rSupp );
- //SvXMLNumFmtHelper( SvNumberFormatter* pNumberFormatter );
SvXMLNumFmtHelper(
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& rSupp,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
SvXMLNumFmtHelper(
SvNumberFormatter* pNumberFormatter,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
~SvXMLNumFmtHelper();
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 6b492ef217ee..1db8a015f5f7 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -381,7 +381,7 @@ void SvXMLImport::_InitCtor()
msPackageProtocol = "vnd.sun.star.Package:";
if (mxNumberFormatsSupplier.is())
- mpNumImport = new SvXMLNumFmtHelper(mxNumberFormatsSupplier, getServiceFactory());
+ mpNumImport = new SvXMLNumFmtHelper(mxNumberFormatsSupplier, comphelper::getComponentContext(getServiceFactory()));
if (mxModel.is() && !mxEventListener.is())
{
@@ -1649,7 +1649,7 @@ void SvXMLImport::_CreateDataStylesImport()
uno::Reference<util::XNumberFormatsSupplier> xNum =
GetNumberFormatsSupplier();
if ( xNum.is() )
- mpNumImport = new SvXMLNumFmtHelper(xNum, getServiceFactory());
+ mpNumImport = new SvXMLNumFmtHelper(xNum, comphelper::getComponentContext(getServiceFactory()));
}
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 1a736dbedfc2..94ca2f7615d3 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -1002,8 +1002,8 @@ SdXMLStylesContext::SdXMLStylesContext(
mbIsAutoStyle(bIsAutoStyle)
{
Reference< lang::XMultiServiceFactory > xMSF = rImport.getServiceFactory();
- mpNumFormatter = new SvNumberFormatter( xMSF, LANGUAGE_SYSTEM );
- mpNumFmtHelper = new SvXMLNumFmtHelper( mpNumFormatter, xMSF );
+ mpNumFormatter = new SvNumberFormatter( comphelper::getComponentContext(xMSF), LANGUAGE_SYSTEM );
+ mpNumFmtHelper = new SvXMLNumFmtHelper( mpNumFormatter, comphelper::getComponentContext(xMSF) );
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 98e3e9e803cb..0a124371de2d 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -237,9 +237,9 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
if ( pFormatter )
{
- pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pCharClass = new CharClass( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
- pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pLocaleData = new LocaleDataWrapper( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
}
else
@@ -272,9 +272,9 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
if ( pFormatter )
{
- pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pCharClass = new CharClass( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
- pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pLocaleData = new LocaleDataWrapper( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
}
else
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 8b57734766d5..3e2c5455a160 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -93,12 +93,12 @@ class SvXMLNumImpData
LocaleDataWrapper* pLocaleData;
SvXMLNumFmtEntryArr aNameEntries;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
+ uno::Reference< uno::XComponentContext > m_xContext;
public:
SvXMLNumImpData(
SvNumberFormatter* pFmt,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory );
+ const uno::Reference<uno::XComponentContext>& rxContext );
~SvXMLNumImpData();
SvNumberFormatter* GetNumberFormatter() const { return pFormatter; }
@@ -381,17 +381,16 @@ static SvXMLDefaultDateFormat aDefaultDateFormats[] =
SvXMLNumImpData::SvXMLNumImpData(
SvNumberFormatter* pFmt,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
+ const uno::Reference<uno::XComponentContext>& rxContext )
: pFormatter(pFmt),
pStylesElemTokenMap(NULL),
pStyleElemTokenMap(NULL),
pStyleAttrTokenMap(NULL),
pStyleElemAttrTokenMap(NULL),
pLocaleData(NULL),
-
- mxServiceFactory(xServiceFactory)
+ m_xContext(rxContext)
{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
+ DBG_ASSERT( rxContext.is(), "got no service manager" );
}
SvXMLNumImpData::~SvXMLNumImpData()
@@ -600,8 +599,7 @@ const LocaleDataWrapper& SvXMLNumImpData::GetLocaleData( LanguageType nLang )
{
if ( !pLocaleData )
pLocaleData = new LocaleDataWrapper(
- comphelper::getComponentContext(
- pFormatter ? pFormatter->GetServiceManager() : mxServiceFactory),
+ pFormatter ? pFormatter->GetComponentContext() : m_xContext,
LanguageTag( nLang ) );
else
pLocaleData->setLanguageTag( LanguageTag( nLang ) );
@@ -2150,10 +2148,9 @@ sal_Bool SvXMLNumFormatContext::IsSystemLanguage()
SvXMLNumFmtHelper::SvXMLNumFmtHelper(
const uno::Reference<util::XNumberFormatsSupplier>& rSupp,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
-: mxServiceFactory(xServiceFactory)
+ const uno::Reference<uno::XComponentContext>& rxContext )
{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
+ DBG_ASSERT( rxContext.is(), "got no service manager" );
SvNumberFormatter* pFormatter = NULL;
SvNumberFormatsSupplierObj* pObj =
@@ -2161,17 +2158,16 @@ SvXMLNumFmtHelper::SvXMLNumFmtHelper(
if (pObj)
pFormatter = pObj->GetNumberFormatter();
- pData = new SvXMLNumImpData( pFormatter, mxServiceFactory );
+ pData = new SvXMLNumImpData( pFormatter, rxContext );
}
SvXMLNumFmtHelper::SvXMLNumFmtHelper(
SvNumberFormatter* pNumberFormatter,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
-: mxServiceFactory(xServiceFactory)
+ const uno::Reference<uno::XComponentContext>& rxContext )
{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
+ DBG_ASSERT( rxContext.is(), "got no service manager" );
- pData = new SvXMLNumImpData( pNumberFormatter, mxServiceFactory );
+ pData = new SvXMLNumImpData( pNumberFormatter, rxContext );
}
SvXMLNumFmtHelper::~SvXMLNumFmtHelper()