diff options
author | Eike Rathke <erack@redhat.com> | 2017-08-30 15:55:25 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-08-30 16:12:55 +0200 |
commit | f49ef5b771910384de0bc2d4c86ad3e0442b295a (patch) | |
tree | 18c4a154b713f59409ba262443ef8b5f7625f5e5 /svl | |
parent | b44f062df9f541b0a1bea974556483c7a5876b35 (diff) |
Force ISO date format again if ISO input, tdf#91758 follow-up
... and input doesn't match a date acceptance pattern, even if less than 3
digits in year.
Change-Id: Ib25aa8e813c06a224cfa95ead79c0f3bf2d2d672
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 7 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 61af0c9c3c6a..e1059936ea41 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1047,6 +1047,13 @@ bool ImpSvNumberInputScan::CanForceToIso8601( DateOrder eDateOrder ) } else { + if (eDateOrder == DateOrder::Invalid) + { + // As if any of the cases below can be applied, but only if a + // locale dependent date pattern was not matched. + return (GetDatePatternNumbers() != nNumericsCnt) || !IsDatePatternNumberOfType(0,'Y'); + } + nCanForceToIso8601 = 1; } diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 8099fe888c33..a8abeca2e01a 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1097,7 +1097,7 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& sString, { case css::util::NumberFormat::DATE : // Preserve ISO 8601 input. - if (pStringScanner->CanForceToIso8601( DateOrder::DMY)) + if (pStringScanner->CanForceToIso8601( DateOrder::Invalid)) { F_Index = GetFormatIndex( NF_DATE_DIN_YYYYMMDD, ActLnge ); } |