diff options
author | Jonathan Pryor <jpryor@novell.com> | 2010-09-15 11:54:10 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-09-15 11:54:10 +0200 |
commit | b00fc9462d26083b6d09f72ea44abb1e11546b63 (patch) | |
tree | 554d5ea4963a3129159e2bf59eb3470e488b9791 /svl/source | |
parent | 615e2b4075b2d285c033aae5e722ffa382e8520e (diff) |
sc-date-fix.diff: Parse 'june-2007' as June 1 2007 in en-US locales
n#358750
Diffstat (limited to 'svl/source')
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 8c63ed903825..bdf150f515d4 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1109,9 +1109,16 @@ input for the following reasons: switch (DateFmt) { case MDY: - case YMD: - pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, ImplGetDay(0) ); + case YMD: { + USHORT nDay = ImplGetDay(0); + USHORT nYear = ImplGetYear(0); + if (nDay == 0 || nDay > 32) { + pCal->setValue( CalendarFieldIndex::YEAR, nYear); + } + else + pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, ImplGetDay(0) ); break; + } case DMY: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; @@ -1550,6 +1557,13 @@ BOOL ImpSvNumberInputScan::ScanStartString( const String& rString, } } + // skip any trailing '-' or '/' chars + if (nPos < rString.Len()) + { + while (SkipChar ('-', rString, nPos) || SkipChar ('/', rString, nPos)) { + // do nothing + } + } if (nPos < rString.Len()) // not everything consumed { // Does input StartString equal StartString of format? |