summaryrefslogtreecommitdiff
path: root/svl/source/numbers
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2024-04-26 12:36:14 +0200
committerTomaž Vajngerl <quikee@gmail.com>2024-04-29 07:58:52 +0200
commit0a5026b3675154ee216dd87ba46dfe533744eb05 (patch)
tree31637a24711f589eadac7c03ba7f8f8f92f7967d /svl/source/numbers
parentb64751ba28fd69fb2a93a21b10a92b68f4dd2097 (diff)
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.klos@collabora.com> Change-Id: Ice04d890b38cd2d08d06f41fc7b3cc55f64fadbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166711 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins
Diffstat (limited to 'svl/source/numbers')
-rw-r--r--svl/source/numbers/zforlist.cxx4
1 files changed, 3 insertions, 1 deletions
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;