bug 359808 : fix my stupid mistake again

This commit is contained in:
jshin%mailaps.org 2007-02-08 18:47:12 +00:00
parent fb61cdfd9f
commit 11773386d4

View File

@ -273,13 +273,12 @@ int nsDateTimeFormatWin::nsGetTimeFormatW(DWORD dwFlags, const SYSTEMTIME *lpTim
const char* format, PRUnichar *timeStr, int cchTime) const char* format, PRUnichar *timeStr, int cchTime)
{ {
int len = 0; int len = 0;
len = GetTimeFormatW(mLCID, dwFlags, lpTime,
LPCWSTR wstr = NULL; format ?
if (format) { NS_CONST_CAST(LPCWSTR,
NS_ConvertASCIItoUTF16 wFormat(format); NS_ConvertASCIItoUTF16(format).get()) :
wstr = NS_CONST_CAST(LPCWSTR, wFormat.get()); NULL,
} (LPWSTR) timeStr, cchTime);
len = GetTimeFormatW(mLCID, dwFlags, lpTime, wstr, (LPWSTR) timeStr, cchTime);
return len; return len;
} }
@ -287,12 +286,11 @@ int nsDateTimeFormatWin::nsGetDateFormatW(DWORD dwFlags, const SYSTEMTIME *lpDat
const char* format, PRUnichar *dateStr, int cchDate) const char* format, PRUnichar *dateStr, int cchDate)
{ {
int len = 0; int len = 0;
len = GetDateFormatW(mLCID, dwFlags, lpDate,
LPCWSTR wstr = NULL; format ?
if (format) { NS_CONST_CAST(LPCWSTR,
NS_ConvertASCIItoUTF16 wFormat(format); NS_ConvertASCIItoUTF16(format).get()) :
wstr = NS_CONST_CAST(LPCWSTR, wFormat.get()); NULL,
} (LPWSTR) dateStr, cchDate);
len = GetDateFormatW(mLCID, dwFlags, lpDate, wstr, (LPWSTR) dateStr, cchDate);
return len; return len;
} }