diff options
author | Eike Rathke <erack@redhat.com> | 2015-06-01 16:25:06 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-06-02 08:04:50 +0000 |
commit | bd4f115484e9955045a50131c84685823a5af078 (patch) | |
tree | e14049e5bfbc4277c0dbd8eccecf159183aa8874 | |
parent | 129e0fbcdd00aa6d5f6096a90e561c846cbf54b5 (diff) |
Resolves: tdf#91420 "Jan1, 2015" is a valid date
Regression introduced with 43624d9370c4384f71c6b13fed900eaec222cf64 that
fixed tdf#34724
Change-Id: I44b5eac6e4ce5a38855148efecea5f2a987ed213
(cherry picked from commit fe2c7b25152df4c89e44c6516081d43d68075736)
Reviewed-on: https://gerrit.libreoffice.org/16018
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index fab73b4bef61..ce6d0e0691d7 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -2101,7 +2101,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; @@ -2144,7 +2146,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 |