basic/source/runtime/runtime.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 657668c378a9405c9978c553be52346b250e8d99
Author: Eike Rathke <er...@redhat.com>
Date:   Thu May 3 13:34:54 2018 +0200

    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 <er...@redhat.com>
    Tested-by: Eike Rathke <er...@redhat.com>

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 );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to