summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforlist.cxx62
1 files changed, 24 insertions, 38 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 3b6c2bd7f1b5..fa9c83757eff 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -275,44 +275,18 @@ 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)
+ , MaxCLOffset(0)
+ , nDefaultSystemCurrencyFormat(NUMBERFORMAT_ENTRY_NOT_FOUND)
+ , eEvalDateFormat(NF_EVALDATEFORMAT_INTL)
+ , bNoZero(false)
{
- ImpConstruct( eLang );
-}
-
-SvNumberFormatter::~SvNumberFormatter()
-{
- {
- ::osl::MutexGuard aGuard( GetGlobalMutex() );
- pFormatterRegistry->Remove( this );
- if ( !pFormatterRegistry->Count() )
- {
- delete pFormatterRegistry;
- pFormatterRegistry = nullptr;
- }
- }
-
- aFTable.clear();
- ClearMergeTable();
-}
-
-
-void SvNumberFormatter::ImpConstruct( LanguageType eLang )
-{
- 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
@@ -324,16 +298,28 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang )
pStringScanner.reset( new ImpSvNumberInputScan( this ) );
pFormatScanner.reset( new ImpSvNumberformatScan( this ) );
- pFormatTable = nullptr;
- MaxCLOffset = 0;
ImpGenerateFormats( 0, false ); // 0 .. 999 for initialized language formats
- pMergeTable = nullptr;
- bNoZero = false;
::osl::MutexGuard aGuard( GetGlobalMutex() );
GetFormatterRegistry().Insert( this );
}
+SvNumberFormatter::~SvNumberFormatter()
+{
+ {
+ ::osl::MutexGuard aGuard( GetGlobalMutex() );
+ pFormatterRegistry->Remove( this );
+ if ( !pFormatterRegistry->Count() )
+ {
+ delete pFormatterRegistry;
+ pFormatterRegistry = nullptr;
+ }
+ }
+
+ aFTable.clear();
+ ClearMergeTable();
+}
+
void SvNumberFormatter::ChangeIntl(LanguageType eLnge)
{