diff options
author | Ocke Janssen <oj@openoffice.org> | 2002-09-26 10:19:37 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2002-09-26 10:19:37 +0000 |
commit | 75fd07c900e25e25cef81970531969f815901e43 (patch) | |
tree | a02e5db489ee848d0598517a0d93622b7ff68807 /forms/source | |
parent | 0cd5140819fa5f0efc40c64ceabc02f38dfe81a6 (diff) |
#96522# change locale of the numberformatter from UI to SvtSysLocale
Diffstat (limited to 'forms/source')
-rw-r--r-- | forms/source/component/FormattedField.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index 3ee67e96f8d9..1986f09a9ac8 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FormattedField.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: vg $ $Date: 2002-07-23 11:05:38 $ + * last change: $Author: oj $ $Date: 2002-09-26 11:19:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -183,7 +183,7 @@ protected: SvNumberFormatter* m_pMyPrivateFormatter; public: - StandardFormatsSupplier(const Reference<XMultiServiceFactory>& _rxFactory); + StandardFormatsSupplier(const Reference<XMultiServiceFactory>& _rxFactory,LanguageType _eSysLanguage); operator Reference<XNumberFormatsSupplier> (); SvNumberFormatsSupplierObj::operator new; @@ -195,9 +195,9 @@ protected: //------------------------------------------------------------------ -StandardFormatsSupplier::StandardFormatsSupplier(const Reference< XMultiServiceFactory > & _rxFactory) +StandardFormatsSupplier::StandardFormatsSupplier(const Reference< XMultiServiceFactory > & _rxFactory,LanguageType _eSysLanguage) :SvNumberFormatsSupplierObj() - ,m_pMyPrivateFormatter(new SvNumberFormatter(_rxFactory, Application::GetSettings().GetUILanguage())) + ,m_pMyPrivateFormatter(new SvNumberFormatter(_rxFactory, _eSysLanguage)) { SetNumberFormatter(m_pMyPrivateFormatter); } @@ -718,8 +718,14 @@ Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() co //------------------------------------------------------------------------------ Reference<XNumberFormatsSupplier> OFormattedModel::calcDefaultFormatsSupplier() const { - if (!s_xDefaultFormatter.is()) - s_xDefaultFormatter = *new StandardFormatsSupplier(m_xServiceFactory); + if ( !s_xDefaultFormatter.is() ) + { + // get the Office's UI locale + const Locale& rSysLocale = SvtSysLocale().GetLocaleData().getLocale(); + // translate + LanguageType eSysLanguage = ConvertIsoNamesToLanguage( rSysLocale.Language, rSysLocale.Country ); + s_xDefaultFormatter = *new StandardFormatsSupplier(m_xServiceFactory,eSysLanguage); + } return s_xDefaultFormatter; } |