PATCH: variant wrong flags

Marcus Meissner marcus at jet.franken.de
Tue Aug 14 11:41:08 CDT 2001


Hi,

The Date* helper functions were using 'lcid' as if it contains the VAR_* 
flags. They are not in lcid, they are in dwFlags. Adjusted functions and
callers.

Ciao, Marcus

Changelog:
	DateTimeStringToTm and DateToTm must use dwFlags instead lcid.

Index: variant.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/variant.c,v
retrieving revision 1.18
diff -u -r1.18 variant.c
--- variant.c	2001/08/13 20:07:01	1.18
+++ variant.c	2001/08/14 16:45:22
@@ -113,7 +113,7 @@
  * the tm struct, tm_sec, tm_min, tm_hour, tm_year, tm_day, tm_mon.
  *
  ******************************************************************************/
-static BOOL DateTimeStringToTm( OLECHAR* strIn, LCID lcid, struct tm* pTm )
+static BOOL DateTimeStringToTm( OLECHAR* strIn, DWORD dwFlags, struct tm* pTm )
 {
 	BOOL res = FALSE;
 	double		fsec;
@@ -139,7 +139,7 @@
 		{
 			if( ParseDateTime( strDateTime, lowstr, field, ftype, MAXDATEFIELDS, &nf) == 0 )
 			{
-				if( lcid & VAR_DATEVALUEONLY )
+				if( dwFlags & VAR_DATEVALUEONLY )
 				{
 					/* Get the date information.
 					 * It returns 0 if date information was
@@ -157,7 +157,7 @@
 						res = TRUE;
 					}
 				}
-				if( lcid & VAR_TIMEVALUEONLY )
+				if( dwFlags & VAR_TIMEVALUEONLY )
 				{
 					/* Get time information only.
 					 */
@@ -330,7 +330,7 @@
  *
  * Returns TRUE if successful.
  */
-static BOOL DateToTm( DATE dateIn, LCID lcid, struct tm* pTm )
+static BOOL DateToTm( DATE dateIn, DWORD dwFlags, struct tm* pTm )
 {
 	/* Do not process dates smaller than January 1, 1900.
 	 * Which corresponds to 2.0 in the windows DATE format.
@@ -354,7 +354,7 @@
 		wholePart = (double) floor( dateIn );
 		decimalPart = fmod( dateIn, wholePart );
 
-		if( !(lcid & VAR_TIMEVALUEONLY) )
+		if( !(dwFlags & VAR_TIMEVALUEONLY) )
 		{
 			int nDay = 0;
 			int leapYear = 0;
@@ -446,7 +446,7 @@
 				pTm->tm_mon = 11;
 			}
 		}
-		if( !(lcid & VAR_DATEVALUEONLY) )
+		if( !(dwFlags & VAR_DATEVALUEONLY) )
 		{
 			/* find the number of seconds in this day.
 			 * fractional part times, hours, minutes, seconds.
@@ -3084,7 +3084,7 @@
 
     TRACE("( %p, %lx, %lx, %p ), stub\n", strIn, lcid, dwFlags, pdateOut );
 
-    if( DateTimeStringToTm( strIn, lcid, &TM ) )
+    if( DateTimeStringToTm( strIn, dwFlags, &TM ) )
     {
         if( TmToDATE( &TM, pdateOut ) == FALSE )
         {
@@ -3278,7 +3278,7 @@
 
     TRACE("( %f, %ld, %ld, %p ), stub\n", dateIn, lcid, dwFlags, pbstrOut );
 
-    if( DateToTm( dateIn, lcid, &TM ) == FALSE )
+    if( DateToTm( dateIn, dwFlags, &TM ) == FALSE )
 			{
         return E_INVALIDARG;
 		}
@@ -4344,7 +4400,7 @@
 
     TRACE("( 0x%x, 0x%x, 0x%p ), stub\n", *wDosDate, *wDosTime, &pvtime );
 
-    if (DateToTm(pvtime, (LCID)NULL, &t) < 0) return 0;
+    if (DateToTm(pvtime, 0, &t) < 0) return 0;
 
     *wDosTime = *wDosTime | (t.tm_sec / 2);
     *wDosTime = *wDosTime | (t.tm_min << 5);
@@ -4427,7 +4483,7 @@
     if (vtime >= 0)
     {
 
-        if (DateToTm(vtime, (LCID)NULL, &r ) <= 0) return 0;
+        if (DateToTm(vtime, 0, &r ) <= 0) return 0;
 
         lpSystemTime->wSecond = r.tm_sec;
         lpSystemTime->wMinute = r.tm_min;
@@ -4446,7 +4502,7 @@
     {
         vtime = -1*vtime;
 
-        if (DateToTm(vtime, (LCID)NULL, &r ) <= 0) return 0;
+        if (DateToTm(vtime, 0, &r ) <= 0) return 0;
 
         lpSystemTime->wSecond = r.tm_sec;
         lpSystemTime->wMinute = r.tm_min;




More information about the wine-patches mailing list