comctl32: SetFirstDayOfWeek/GetFirstDayOfWeek should use 0=monday

Peter Åstrand astrand at cendio.se
Tue Sep 4 06:25:47 CDT 2007


changelog:

* The month calendar control should use 0=monday in 
  SetFirstDayOfWeek/GetFirstDayOfWeek. Fixes bug 9532.


Index: comctl32/monthcal.c
===================================================================
--- comctl32/monthcal.c	(revision 12762)
+++ comctl32/monthcal.c	(arbetskopia)
@@ -886,7 +886,7 @@
 static LRESULT
 MONTHCAL_GetFirstDayOfWeek(const MONTHCAL_INFO *infoPtr)
 {
-  return MAKELONG(infoPtr->firstDay, infoPtr->firstDayHighWord);
+  return MAKELONG((infoPtr->firstDay + 6) % 7, infoPtr->firstDayHighWord);
 }
 
 
@@ -906,7 +906,7 @@
   GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, buf, countof(buf));
   TRACE("%s %d\n", debugstr_w(buf), strlenW(buf));
 
-  localFirstDay = atoiW(buf);
+  localFirstDay = (atoiW(buf) + 1) % 7;
 
   if(lParam == -1)
   {
@@ -920,7 +920,7 @@
   }
   else
   {
-    infoPtr->firstDay = lParam;
+    infoPtr->firstDay = (lParam + 1) % 7;
     infoPtr->firstDayHighWord = TRUE;
   }
 

---
Peter Åstrand		ThinLinc Chief Developer
Cendio AB		http://www.cendio.se
Wallenbergs gata 4
583 30 Linköping	Phone: +46-13-21 46 00


More information about the wine-patches mailing list