[ooo-build-commit] .: svl/source

Fridrich Strba fridrich at kemper.freedesktop.org
Wed Sep 15 05:29:03 PDT 2010


 svl/source/numbers/zforfind.cxx |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 9e97cb2f8240331fb247fe3d97c747ae63778e20
Author: Jonathan Pryor <jpryor at novell.com>
Date:   Wed Sep 15 11:54:10 2010 +0200

    sc-date-fix.diff: Parse 'june-2007' as June 1 2007 in en-US locales
    
     n#358750

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 1152d54..a049895 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?


More information about the ooo-build-commit mailing list