Kaydet (Commit) f49ef5b7 authored tarafından Eike Rathke's avatar Eike Rathke

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
üst b44f062d
...@@ -1047,6 +1047,13 @@ bool ImpSvNumberInputScan::CanForceToIso8601( DateOrder eDateOrder ) ...@@ -1047,6 +1047,13 @@ bool ImpSvNumberInputScan::CanForceToIso8601( DateOrder eDateOrder )
} }
else 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; nCanForceToIso8601 = 1;
} }
......
...@@ -1097,7 +1097,7 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& sString, ...@@ -1097,7 +1097,7 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& sString,
{ {
case css::util::NumberFormat::DATE : case css::util::NumberFormat::DATE :
// Preserve ISO 8601 input. // Preserve ISO 8601 input.
if (pStringScanner->CanForceToIso8601( DateOrder::DMY)) if (pStringScanner->CanForceToIso8601( DateOrder::Invalid))
{ {
F_Index = GetFormatIndex( NF_DATE_DIN_YYYYMMDD, ActLnge ); F_Index = GetFormatIndex( NF_DATE_DIN_YYYYMMDD, ActLnge );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment