Piotr Caban : oleaut32: Fixed VARIANT_FormatDate behavior on dates before year 1600.

Alexandre Julliard julliard at winehq.org
Mon Feb 25 14:33:47 CST 2013


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Feb 25 11:40:56 2013 +0100

oleaut32: Fixed VARIANT_FormatDate behavior on dates before year 1600.

---

 dlls/oleaut32/varformat.c |    2 +-
 dlls/oleaut32/variant.h   |    2 ++
 dlls/oleaut32/vartype.c   |    2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/varformat.c b/dlls/oleaut32/varformat.c
index 351529c..e02ad39 100644
--- a/dlls/oleaut32/varformat.c
+++ b/dlls/oleaut32/varformat.c
@@ -1908,7 +1908,7 @@ static HRESULT VARIANT_FormatDate(LPVARIANT pVarIn, LPOLESTR lpszFormat,
       WCHAR fmt_buff[80];
 
       if (!GetLocaleInfoW(lcid, dwFmt, fmt_buff, sizeof(fmt_buff)/sizeof(WCHAR)) ||
-          !GetDateFormatW(lcid, 0, &udate.st, fmt_buff, pBuff,
+          !get_date_format(lcid, 0, &udate.st, fmt_buff, pBuff,
                           sizeof(buff)/sizeof(WCHAR)-(pBuff-buff)))
       {
         hRes = E_INVALIDARG;
diff --git a/dlls/oleaut32/variant.h b/dlls/oleaut32/variant.h
index b6af547..765c0c4 100644
--- a/dlls/oleaut32/variant.h
+++ b/dlls/oleaut32/variant.h
@@ -127,3 +127,5 @@ typedef struct tagVARIANT_NUMBER_CHARS
 
 BOOL VARIANT_GetLocalisedText(LANGID, DWORD, WCHAR *) DECLSPEC_HIDDEN;
 HRESULT VARIANT_ClearInd(VARIANTARG *) DECLSPEC_HIDDEN;
+BOOL get_date_format(LCID, DWORD, const SYSTEMTIME *,
+        const WCHAR *, WCHAR *, int) DECLSPEC_HIDDEN;
diff --git a/dlls/oleaut32/vartype.c b/dlls/oleaut32/vartype.c
index 28795a7..74f66de 100644
--- a/dlls/oleaut32/vartype.c
+++ b/dlls/oleaut32/vartype.c
@@ -6596,7 +6596,7 @@ static inline int output_int_len(int o, int min_len, WCHAR *date, int date_len)
 }
 
 /* format date string, similar to GetDateFormatW function but works on bigger range of dates */
-static BOOL get_date_format(LCID lcid, DWORD flags, const SYSTEMTIME *st,
+BOOL get_date_format(LCID lcid, DWORD flags, const SYSTEMTIME *st,
         const WCHAR *fmt, WCHAR *date, int date_len)
 {
     static const LCTYPE dayname[] = {




More information about the wine-cvs mailing list