svl/source/numbers/zforlist.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 7836cb7e90d0214cac08228f5e527322ed6f955c
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Fri Apr 26 12:36:14 2024 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Mon Apr 29 07:58:05 2024 +0200

    lok: save correct number format in multi-lang session
    
    Number formats can have different keywords in different
    languages: D - Day(EN), T - Tag(DE).
    This can cause problem when we use format which will not
    be recognized by current number formatter, then we put
    unknown keyword as string in quotes. As the result we get
    for example: formatCode="&quot;TT.&quot;mm&quot;.JJJJ&quot;"
    
    The problem exists especially in multi-language setup in LOK
    when we use non-English languages:
    1. open xlsx using FR
    2. join with DE
    3. modify number formats in both
    4. leave spreadsheet with both so it will be saved
    Result: after we open it again we have some keywords as
    strings, user has to apply new number format to see the
    real value
    
    Signed-off-by: Szymon Kłos <szymon.k...@collabora.com>
    Change-Id: Ice04d890b38cd2d08d06f41fc7b3cc55f64fadbe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166707
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index ca8b6524b9e2..912279c3b26a 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -24,6 +24,7 @@
 #include <svl/zforlist.hxx>
 #include <svl/currencytable.hxx>
 
+#include <comphelper/lok.hxx>
 #include <comphelper/string.hxx>
 #include <o3tl/string_view.hxx>
 #include <tools/debug.hxx>
@@ -916,6 +917,7 @@ OUString SvNumberFormatter::GetFormatStringForExcel( 
sal_uInt32 nKey, const NfKe
         }
         else
         {
+            bool bIsLOK = comphelper::LibreOfficeKit::isActive();
             bool bSystemLanguage = false;
             LanguageType nLang = pEntry->GetLanguage();
             if (nLang == LANGUAGE_SYSTEM)
@@ -923,7 +925,7 @@ OUString SvNumberFormatter::GetFormatStringForExcel( 
sal_uInt32 nKey, const NfKe
                 bSystemLanguage = true;
                 nLang = SvtSysLocale().GetLanguageTag().getLanguageType();
             }
-            if (nLang != LANGUAGE_ENGLISH_US)
+            if (!bIsLOK && nLang != LANGUAGE_ENGLISH_US)
             {
                 sal_Int32 nCheckPos;
                 SvNumFormatType nType = SvNumFormatType::DEFINED;

Reply via email to