summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/ww8atr.cxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-05-19 13:23:33 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2022-05-27 10:59:52 +0200
commit5c7f4b83c207b909312ed5a28282015fdcdd12da (patch)
treeffdd681af812cac33c0d959330a9663d5f47bcdb /sw/source/filter/ww8/ww8atr.cxx
parenta8df5c815c8b002b7083b8777e3dd8beac573bf3 (diff)
sw: language fallback in MSWordExportBase::GetNumberFormat()
There is this number format: <number:date-style style:name="N36" number:automatic-order="true"> <number:day number:style="long"/> <number:text>.</number:text> <number:month number:style="long"/> <number:text>.</number:text> <number:year number:style="long"/> </number:date-style> in a paragraph which has fo:language="zxx", so the field has LANGUAGE_NONE. MSWordExportBase::GetNumberFormat() exports as: DATE \@"dd/MM/yyyy" But should be: DATE \@"dd.MM.yyyy" Follow Eike's suggestion to use the number format's language in case the field doesn't have one. Change-Id: I596bea5daa75c717931b3c5d5506103b87b8ee08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134638 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source/filter/ww8/ww8atr.cxx')
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index b5f354e46d84..78bbb5219e57 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2601,6 +2601,11 @@ bool MSWordExportBase::GetNumberFormat(const SwField& rField, OUString& rStr)
if( pNumFormat )
{
LanguageType nLng = rField.GetLanguage();
+ SAL_WARN_IF(nLng == LANGUAGE_DONTKNOW, "sw.ww8", "unexpected LANGUAGE_DONTKNOW");
+ if (nLng == LANGUAGE_NONE || nLng == LANGUAGE_DONTKNOW)
+ {
+ nLng = pNumFormat->GetLanguage();
+ }
LocaleDataWrapper aLocDat(pNFormatr->GetComponentContext(),
LanguageTag(nLng));