Commit a2d74e5f authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

oleaut32: Fixed VARIANT_FormatDate behavior on dates before year 1600.

parent 30630b4d
...@@ -1908,7 +1908,7 @@ static HRESULT VARIANT_FormatDate(LPVARIANT pVarIn, LPOLESTR lpszFormat, ...@@ -1908,7 +1908,7 @@ static HRESULT VARIANT_FormatDate(LPVARIANT pVarIn, LPOLESTR lpszFormat,
WCHAR fmt_buff[80]; WCHAR fmt_buff[80];
if (!GetLocaleInfoW(lcid, dwFmt, fmt_buff, sizeof(fmt_buff)/sizeof(WCHAR)) || 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))) sizeof(buff)/sizeof(WCHAR)-(pBuff-buff)))
{ {
hRes = E_INVALIDARG; hRes = E_INVALIDARG;
......
...@@ -127,3 +127,5 @@ typedef struct tagVARIANT_NUMBER_CHARS ...@@ -127,3 +127,5 @@ typedef struct tagVARIANT_NUMBER_CHARS
BOOL VARIANT_GetLocalisedText(LANGID, DWORD, WCHAR *) DECLSPEC_HIDDEN; BOOL VARIANT_GetLocalisedText(LANGID, DWORD, WCHAR *) DECLSPEC_HIDDEN;
HRESULT VARIANT_ClearInd(VARIANTARG *) DECLSPEC_HIDDEN; HRESULT VARIANT_ClearInd(VARIANTARG *) DECLSPEC_HIDDEN;
BOOL get_date_format(LCID, DWORD, const SYSTEMTIME *,
const WCHAR *, WCHAR *, int) DECLSPEC_HIDDEN;
...@@ -6596,7 +6596,7 @@ static inline int output_int_len(int o, int min_len, WCHAR *date, int date_len) ...@@ -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 */ /* 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) const WCHAR *fmt, WCHAR *date, int date_len)
{ {
static const LCTYPE dayname[] = { static const LCTYPE dayname[] = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment