summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-06-01 16:25:06 +0200
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:21:37 +0200
commit4782d959c22e113203d42e5f7cc5d85ebdf88e24 (patch)
treede4f07ac24310a14962654a8615e57d3f63b0383 /svl
parent1c740e838d54ed97846b723cced07ca234311b29 (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)
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforfind.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 97948c56cc48..36dd18e607d7 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 = css::util::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