diff options
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 0ec1cd812418..dfb66e3de235 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1699,7 +1699,26 @@ bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter ) else { bFormatTurn = true; - DateFmt = mpFormat->GetDateOrder(); + // Even if the format pattern is to be preferred, the input may + // have matched a pattern of the current locale, which then + // again is to be preferred. Both date orders can be different + // so we need to obtain the actual match. For example ISO + // YYYY-MM-DD format vs locale's DD.MM.YY input. + if (!GetDatePatternOrder()) + { + // No pattern match => format match. + DateFmt = mpFormat->GetDateOrder(); + } + else + { + // Pattern match. Note that patterns may have been + // constructed from the format's locale and prepended to + // the current locale's patterns, it doesn't necessarily + // mean a current locale's pattern was matched, but may if + // the format's locale's patterns didn't match, which were + // tried first. + DateFmt = GetDateOrder(); + } } break; default: |