include/svl/numformat.hxx       |    6 +++---
 svl/source/numbers/zforlist.cxx |   13 ++++---------
 2 files changed, 7 insertions(+), 12 deletions(-)

New commits:
commit 9fcee419dd368823d842b9c9a032b2213ee24d34
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Feb 29 12:48:12 2024 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Feb 29 16:23:02 2024 +0100

    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 <[email protected]>

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
commit 023e59d0283614a568362b794bb94a9254401d7e
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Feb 29 12:37:45 2024 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Feb 29 16:22:55 2024 +0100

    there is only the one ctor, so drop misleading "preferred" comment
    
    that suggests there are alternatives to choose from
    
    Change-Id: Ica3367fae93f57f339bdc39b1cd91d47a2c9618e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164146
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/include/svl/numformat.hxx b/include/svl/numformat.hxx
index 8d244c360663..7e00f7a87626 100644
--- a/include/svl/numformat.hxx
+++ b/include/svl/numformat.hxx
@@ -53,7 +53,7 @@ public:
      */
     static const sal_uInt16 INPUTSTRING_PRECISION;
 
-    /// Preferred ctor with service manager and language/country enum
+    /// ctor with service manager and language/country enum
     SvNumberFormatter(const css::uno::Reference<css::uno::XComponentContext>& 
rxContext,
                       LanguageType eLang);
 

Reply via email to