[Libreoffice-commits] .: svl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Dec 19 12:55:55 PST 2012
svl/source/numbers/zforfind.cxx | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
New commits:
commit 8041285b369e58df477b5e92df4bde68e96056a2
Author: Eike Rathke <erack at redhat.com>
Date: Wed Dec 19 21:53:13 2012 +0100
resolved fdo#54344 let date pattern match overrule incomplete format match
Change-Id: I69a0c62ab5b4da036a77bd6c3b2baec0af7c8339
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 7e05fe4..d5adf88 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1678,11 +1678,21 @@ input for the following reasons:
{
case 0: // not found
{
- bool bHadExact;
sal_uInt32 nExactDateOrder = (bFormatTurn ?
pFormat->GetExactDateOrder() :
GetDatePatternOrder());
bool bIsExact = (0xff < nExactDateOrder && nExactDateOrder <= 0xffff);
+ if (!bIsExact && bFormatTurn && IsAcceptedDatePattern( nNums[0]))
+ {
+ // If input does not match format but pattern, use pattern
+ // instead, even if eEDF==NF_EVALDATEFORMAT_FORMAT_INTL.
+ // For example, format has "Y-M-D" and pattern is "D.M.",
+ // input with 2 numbers can't match format and 31.12. would
+ // lead to 1931-12-01 (fdo#54344)
+ nExactDateOrder = GetDatePatternOrder();
+ bIsExact = (0xff < nExactDateOrder && nExactDateOrder <= 0xffff);
+ }
+ bool bHadExact;
if (bIsExact)
{
// formatted as date and exactly 2 parts
More information about the Libreoffice-commits
mailing list