Nikolay Sivov : oleaut32/varformat: Fix day string representation format output.

Alexandre Julliard julliard at winehq.org
Mon Dec 20 17:49:49 CST 2010


Module: wine
Branch: master
Commit: 495792e228e3f96cf54ac956307db70d03c9523c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=495792e228e3f96cf54ac956307db70d03c9523c

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sun Dec 19 19:25:50 2010 +0300

oleaut32/varformat: Fix day string representation format output.

---

 dlls/oleaut32/tests/varformat.c |    4 +++-
 dlls/oleaut32/varformat.c       |    4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/oleaut32/tests/varformat.c b/dlls/oleaut32/tests/varformat.c
index 2d4ef62..d83f218 100644
--- a/dlls/oleaut32/tests/varformat.c
+++ b/dlls/oleaut32/tests/varformat.c
@@ -212,7 +212,9 @@ static const FMTDATERES VarFormat_date_results[] =
   { 2.525, "hh :mm:mm", "12 :36:01" },
   { 2.525, "dd :mm:mm", "01 :01:01" },
   { 2.525, "dd :mm:nn", "01 :01:36" },
-  { 2.725, "hh:nn:ss A/P", "05:24:00 P" }
+  { 2.725, "hh:nn:ss A/P", "05:24:00 P" },
+  { 40531.0, "dddd", "Sunday" },
+  { 40531.0, "ddd", "Sun" }
 };
 
 #define VNUMFMT(vt,v) \
diff --git a/dlls/oleaut32/varformat.c b/dlls/oleaut32/varformat.c
index f297641..529528b 100644
--- a/dlls/oleaut32/varformat.c
+++ b/dlls/oleaut32/varformat.c
@@ -1725,14 +1725,14 @@ static HRESULT VARIANT_FormatDate(LPVARIANT pVarIn, LPOLESTR lpszFormat,
     case FMT_DATE_DAY_SHORT:
       /* FIXME: VARIANT_CALENDAR HIJRI should cause Hijri output */
       TRACE("short day\n");
-      localeValue = LOCALE_SABBREVDAYNAME1 + udate.st.wMonth - 1;
+      localeValue = LOCALE_SABBREVDAYNAME1 + (udate.st.wDayOfWeek + 6)%7;
       defaultChar = '?';
       break;
 
     case FMT_DATE_DAY_LONG:
       /* FIXME: VARIANT_CALENDAR HIJRI should cause Hijri output */
       TRACE("long day\n");
-      localeValue = LOCALE_SDAYNAME1 + udate.st.wMonth - 1;
+      localeValue = LOCALE_SDAYNAME1 + (udate.st.wDayOfWeek + 6)%7;
       defaultChar = '?';
       break;
 




More information about the wine-cvs mailing list