summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2020-07-04 01:17:13 +0200
committerEike Rathke <erack@redhat.com>2020-07-06 10:55:16 +0200
commit3295cc04dcba336b2ad8989482fb60c0c4c091d6 (patch)
tree8c674db597b34ecb0e86b99e6b7686daf19e6505 /svl
parente20b40958dd500b77b6325b4ccdfa5d48cca7a20 (diff)
Resolves: tdf#134490 do not skip all trailing '-' or '/' of the start string
Skip *one* of them under the condition that a month name was actually recognized. A horrible implementation of commit b00fc9462d26083b6d09f72ea44abb1e11546b63 CommitDate: Wed Sep 15 11:54:10 2010 +0200 sc-date-fix.diff: Parse 'june-2007' as June 1 2007 in en-US locales Change-Id: I0800c4f0b33aa1413bde558d710fe467e4380262 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97903 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 348e78b8ccd04b59140c7f83504c7823b2ffbe8c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98072
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforfind.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 2e8d634a7a6b..88ef3584c46a 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -2397,14 +2397,13 @@ bool ImpSvNumberInputScan::ScanStartString( const OUString& rString )
}
}
}
+ // Skip one trailing '-' or '/' character to recognize June-2007
+ if (nMonth && nPos + 1 == rString.getLength())
+ {
+ SkipChar('-', rString, nPos) || SkipChar('/', rString, nPos);
+ }
}
- // skip any trailing '-' or '/' chars
- if (nPos < rString.getLength())
- {
- while (SkipChar ('-', rString, nPos) || SkipChar ('/', rString, nPos))
- ; // do nothing
- }
if (nPos < rString.getLength()) // not everything consumed
{
// Does input StartString equal StartString of format?