summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-29 12:48:12 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-29 16:23:02 +0100
commit9fcee419dd368823d842b9c9a032b2213ee24d34 (patch)
tree9258eecaa7a4db170bbb6326e6f1300170c00bbf
parent023e59d0283614a568362b794bb94a9254401d7e (diff)
if we rearrange, we don't need to create maLanguageTag twice
Change-Id: I2c8ad9999adc406dc850c59b48e49681099dc054 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--include/svl/numformat.hxx4
-rw-r--r--svl/source/numbers/zforlist.cxx13
2 files changed, 6 insertions, 11 deletions
diff --git a/include/svl/numformat.hxx b/include/svl/numformat.hxx
index 7e00f7a87626..fdb5a6593b88 100644
--- a/include/svl/numformat.hxx
+++ b/include/svl/numformat.hxx
@@ -573,6 +573,8 @@ public:
private:
mutable ::osl::Mutex m_aMutex;
css::uno::Reference<css::uno::XComponentContext> m_xContext;
+ LanguageType IniLnge; // Initialized setting language/country
+ LanguageType ActLnge; // Current setting language/country
LanguageTag maLanguageTag;
std::map<sal_uInt32, std::unique_ptr<SvNumberformat>>
aFTable; // Table of format keys to format entries
@@ -591,8 +593,6 @@ private:
Link<sal_uInt16, Color*> aColorLink; // User defined color table CallBack
sal_uInt32 MaxCLOffset; // Max language/country offset used
sal_uInt32 nDefaultSystemCurrencyFormat; // NewCurrency matching SYSTEM locale
- LanguageType IniLnge; // Initialized setting language/country
- LanguageType ActLnge; // Current setting language/country
NfEvalDateFormat eEvalDateFormat; // DateFormat evaluation
bool bNoZero; // Zero value suppression
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 8833d45cd1cf..f3a721442858 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -275,22 +275,17 @@ const sal_uInt16 SvNumberFormatter::INPUTSTRING_PRECISION = ::std::numeric_limit
SvNumberFormatter::SvNumberFormatter( const Reference< XComponentContext >& rxContext,
LanguageType eLang )
: m_xContext( rxContext )
- , maLanguageTag( eLang)
+ , IniLnge(eLang != LANGUAGE_DONTKNOW ? eLang : UNKNOWN_SUBSTITUTE)
+ , ActLnge(IniLnge)
+ , maLanguageTag(IniLnge)
{
- if ( eLang == LANGUAGE_DONTKNOW )
- {
- eLang = UNKNOWN_SUBSTITUTE;
- }
- IniLnge = eLang;
- ActLnge = eLang;
eEvalDateFormat = NF_EVALDATEFORMAT_INTL;
nDefaultSystemCurrencyFormat = NUMBERFORMAT_ENTRY_NOT_FOUND;
- maLanguageTag.reset( eLang );
xCharClass.changeLocale( m_xContext, maLanguageTag );
xLocaleData.init( m_xContext, maLanguageTag );
xCalendar.init( m_xContext, maLanguageTag.getLocale() );
- xTransliteration.init( m_xContext, eLang );
+ xTransliteration.init( m_xContext, IniLnge );
xNatNum.init( m_xContext );
// cached locale data items