update dev300-m57
[ooovba.git] / applied_patches / 0129-sc-date-fix.diff
blobc12f2653038fe4750d264cb40fb8dbc43d776cab
1 Index: svtools/source/numbers/zforfind.cxx
2 ===================================================================
3 RCS file: /cvs/util/svtools/source/numbers/zforfind.cxx,v
4 retrieving revision 1.47
5 diff -u -p -r1.47 zforfind.cxx
6 --- svtools/source/numbers/zforfind.cxx 27 Jun 2007 21:56:34 -0000 1.47
7 +++ svtools/source/numbers/zforfind.cxx 21 Feb 2008 23:01:27 -0000
8 @@ -1120,9 +1120,16 @@ input for the following reasons:
9 switch (DateFmt)
11 case MDY:
12 - case YMD:
13 - pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, ImplGetDay(0) );
14 + case YMD: {
15 + USHORT nDay = ImplGetDay(0);
16 + USHORT nYear = ImplGetYear(0);
17 + if (nDay == 0 || nDay > 32) {
18 + pCal->setValue( CalendarFieldIndex::YEAR, nYear);
19 + }
20 + else
21 + pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, ImplGetDay(0) );
22 break;
23 + }
24 case DMY:
25 pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) );
26 break;
27 @@ -1543,6 +1550,13 @@ BOOL ImpSvNumberInputScan::ScanStartStri
31 + // skip any trailing '-' or '/' chars
32 + if (nPos < rString.Len())
33 + {
34 + while (SkipChar ('-', rString, nPos) || SkipChar ('/', rString, nPos)) {
35 + // do nothing
36 + }
37 + }
38 if (nPos < rString.Len()) // not everything consumed
40 // Does input StartString equal StartString of format?