svl/source/numbers/zforlist.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 0a5026b3675154ee216dd87ba46dfe533744eb05 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:52 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 <szymon.k...@collabora.com> Change-Id: Ice04d890b38cd2d08d06f41fc7b3cc55f64fadbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166711 Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> Tested-by: Jenkins diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 54576eb1c230..2d26b1251f3e 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> @@ -990,6 +991,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) @@ -997,7 +999,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;