From 86084b0f85f11cc9d8d5e2e9226f46ae9cdda077 Mon Sep 17 00:00:00 2001
Message-Id: <86084b0f85f11cc9d8d5e2e9226f46ae9cdda077.1433169972.git.erack@redhat.com>
From: Eike Rathke <erack@redhat.com>
Date: Mon, 1 Jun 2015 16:25:06 +0200
Subject: [PATCH] Resolves: tdf#91420 "Jan1, 2015" is a valid date
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
This is a multi-part message in MIME format.
--------------erAck-patch-parts
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
Regression introduced with 43624d9370c4384f71c6b13fed900eaec222cf64 that
fixed tdf#34724
Change-Id: I44b5eac6e4ce5a38855148efecea5f2a987ed213
(cherry picked from commit fe2c7b25152df4c89e44c6516081d43d68075736)
---
svl/source/numbers/zforfind.cxx | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--------------erAck-patch-parts
Content-Type: text/x-patch; name="0001-Resolves-tdf-91420-Jan1-2015-is-a-valid-date.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Resolves-tdf-91420-Jan1-2015-is-a-valid-date.patch"
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 9bdee3a..b024f99 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -2102,7 +2102,9 @@ bool ImpSvNumberInputScan::ScanStartString( const OUString& rString,
short nTempMonth = GetMonth(rString, nPos);
if ( nTempMonth ) // month (Jan 1)?
{
- if (nPos < rString.getLength()) // Jan1 without separator is not a date
+ // Jan1 without separator is not a date, unless it is followed by a
+ // separator and a (year) number.
+ if (nPos < rString.getLength() || (nAnzStrings >= 4 && nAnzNums >= 2))
{
eScannedType = NUMBERFORMAT_DATE; // !!! it IS a date !!!
nMonth = nTempMonth;
@@ -2145,7 +2147,9 @@ bool ImpSvNumberInputScan::ScanStartString( const OUString& rString,
nTempMonth = GetMonth(rString, nPos);
if ( nTempMonth ) // month (Jan 1)?
{
- if (nPos < rString.getLength()) // Jan1 without separator is not a date
+ // Jan1 without separator is not a date, unless it is followed by a
+ // separator and a (year) number.
+ if (nPos < rString.getLength() || (nAnzStrings >= 4 && nAnzNums >= 2))
{
nMonth = nTempMonth;
nMonthPos = 1; // month a the beginning
--------------erAck-patch-parts--