svl/source/numbers/zforlist.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit ec1ce8049ed36d5117e93bb6af5e0798010b28dd Author: Szymon Kłos <[email protected]> AuthorDate: Fri Apr 26 12:36:14 2024 +0200 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Mon Apr 29 07:58:40 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=""TT."mm".JJJJ"" 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 <[email protected]> Change-Id: Ice04d890b38cd2d08d06f41fc7b3cc55f64fadbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166719 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Tomaž Vajngerl <[email protected]> diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 3d2fadbacbad..a81dc68860bb 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> @@ -901,6 +902,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) @@ -908,7 +910,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;
