diff options
author | Eike Rathke <erack@redhat.com> | 2018-05-03 13:34:54 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-05-04 00:28:59 +0200 |
commit | 657668c378a9405c9978c553be52346b250e8d99 (patch) | |
tree | 2950f6fc10b041798dd2a46e74f909f489806e84 /basic | |
parent | ccbc955ed0d2efec2de5250a8b838804fafa93ce (diff) |
Related: tdf#116579 tell SvNumberFormatter the proper NfEvalDateFormat
So far Basic relied on the side effect of date acceptance patterns
selected according to the passed format's locale, which changed
with the (temporarily reverted) commit
dfb9138b8b5a239b46f189a717999bcaff19aa79. Explicitly tell the
formatter the behavior to use.
Change-Id: I9819399df69bdfa36d79bc9db116dec37a85cbeb
Reviewed-on: https://gerrit.libreoffice.org/53787
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/runtime.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 23573424b09d..9f242dab4ba8 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -407,6 +407,15 @@ std::shared_ptr<SvNumberFormatter> SbiInstance::PrepareNumberFormatter( sal_uInt std::shared_ptr<SvNumberFormatter> pNumberFormatter( new SvNumberFormatter( comphelper::getProcessComponentContext(), eLangType )); + // Several parser methods pass SvNumberFormatter::IsNumberFormat() a number + // format index to parse against. Tell the formatter the proper date + // evaluation order, which also determines the date acceptance patterns to + // use if a format was passed. NF_EVALDATEFORMAT_FORMAT restricts to the + // format's locale's date patterns/order (no init/system locale match + // tried) and falls back to NF_EVALDATEFORMAT_INTL if no specific (i.e. 0) + // (or an unknown) format index was passed. + pNumberFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT); + sal_Int32 nCheckPos = 0; SvNumFormatType nType; rnStdTimeIdx = pNumberFormatter->GetStandardFormat( SvNumFormatType::TIME, eLangType ); |