From f108b034cb0b075863c8af07431f08fdb50bade0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Zalewski?= Date: Wed, 23 Aug 2006 14:13:32 +0200 Subject: [PATCH] shlwapi: Move strings used by StrFromTimeInterval to resources. --- dlls/shlwapi/resource.h | 3 +++ dlls/shlwapi/shlwapi_De.rc | 3 +++ dlls/shlwapi/shlwapi_En.rc | 3 +++ dlls/shlwapi/shlwapi_Eo.rc | 3 +++ dlls/shlwapi/shlwapi_Es.rc | 3 +++ dlls/shlwapi/shlwapi_Fi.rc | 3 +++ dlls/shlwapi/shlwapi_Fr.rc | 3 +++ dlls/shlwapi/shlwapi_Hu.rc | 3 +++ dlls/shlwapi/shlwapi_It.rc | 3 +++ dlls/shlwapi/shlwapi_Ja.rc | 3 +++ dlls/shlwapi/shlwapi_Ko.rc | 3 +++ dlls/shlwapi/shlwapi_Nl.rc | 3 +++ dlls/shlwapi/shlwapi_No.rc | 3 +++ dlls/shlwapi/shlwapi_Pl.rc | 3 +++ dlls/shlwapi/shlwapi_Pt.rc | 3 +++ dlls/shlwapi/shlwapi_Tr.rc | 3 +++ dlls/shlwapi/string.c | 13 +++++-------- 17 files changed, 53 insertions(+), 8 deletions(-) diff --git a/dlls/shlwapi/resource.h b/dlls/shlwapi/resource.h index c06dbf71a7..7359ffe7c5 100644 --- a/dlls/shlwapi/resource.h +++ b/dlls/shlwapi/resource.h @@ -21,6 +21,9 @@ #define WINE_SHLWAPI_RESOURCE_H #define IDS_BYTES_FORMAT 64 +#define IDS_TIME_INTERVAL_HOURS 65 +#define IDS_TIME_INTERVAL_MINUTES 66 +#define IDS_TIME_INTERVAL_SECONDS 67 /* These numbers match native ID's and shouldn't be abitrarily changed */ #define IDD_ERR_DIALOG 0x1200 diff --git a/dlls/shlwapi/shlwapi_De.rc b/dlls/shlwapi/shlwapi_De.rc index a98005de4f..c9ac965351 100644 --- a/dlls/shlwapi/shlwapi_De.rc +++ b/dlls/shlwapi/shlwapi_De.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld Bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_En.rc b/dlls/shlwapi/shlwapi_En.rc index a8d19806c3..5a327f0e00 100644 --- a/dlls/shlwapi/shlwapi_En.rc +++ b/dlls/shlwapi/shlwapi_En.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_Eo.rc b/dlls/shlwapi/shlwapi_Eo.rc index dcbcdafe99..71b3710f6d 100644 --- a/dlls/shlwapi/shlwapi_Eo.rc +++ b/dlls/shlwapi/shlwapi_Eo.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_Es.rc b/dlls/shlwapi/shlwapi_Es.rc index 61782c9d00..3a325db2c0 100644 --- a/dlls/shlwapi/shlwapi_Es.rc +++ b/dlls/shlwapi/shlwapi_Es.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_Fi.rc b/dlls/shlwapi/shlwapi_Fi.rc index 5ba5d3ce73..ea9b395084 100644 --- a/dlls/shlwapi/shlwapi_Fi.rc +++ b/dlls/shlwapi/shlwapi_Fi.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_Fr.rc b/dlls/shlwapi/shlwapi_Fr.rc index e84403d10e..e80b870afb 100644 --- a/dlls/shlwapi/shlwapi_Fr.rc +++ b/dlls/shlwapi/shlwapi_Fr.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_Hu.rc b/dlls/shlwapi/shlwapi_Hu.rc index 52efedc2f0..9aa253e45b 100644 --- a/dlls/shlwapi/shlwapi_Hu.rc +++ b/dlls/shlwapi/shlwapi_Hu.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_It.rc b/dlls/shlwapi/shlwapi_It.rc index cdb113e8cf..ff1ff5b9e0 100644 --- a/dlls/shlwapi/shlwapi_It.rc +++ b/dlls/shlwapi/shlwapi_It.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_Ja.rc b/dlls/shlwapi/shlwapi_Ja.rc index 7ac8d412ae..dbcc44123c 100644 --- a/dlls/shlwapi/shlwapi_Ja.rc +++ b/dlls/shlwapi/shlwapi_Ja.rc @@ -37,4 +37,7 @@ FONT 9, "MS UI Gothic" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_Ko.rc b/dlls/shlwapi/shlwapi_Ko.rc index bb8641cee6..62a8ddf5e5 100644 --- a/dlls/shlwapi/shlwapi_Ko.rc +++ b/dlls/shlwapi/shlwapi_Ko.rc @@ -38,4 +38,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld ¹ÙÀÌÆ®" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_Nl.rc b/dlls/shlwapi/shlwapi_Nl.rc index 5d257800da..4c93061f0b 100644 --- a/dlls/shlwapi/shlwapi_Nl.rc +++ b/dlls/shlwapi/shlwapi_Nl.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_No.rc b/dlls/shlwapi/shlwapi_No.rc index 779fdc5a1f..4df42c87dd 100644 --- a/dlls/shlwapi/shlwapi_No.rc +++ b/dlls/shlwapi/shlwapi_No.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld byte" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_Pl.rc b/dlls/shlwapi/shlwapi_Pl.rc index 8942a77d3f..467ee8d1f7 100644 --- a/dlls/shlwapi/shlwapi_Pl.rc +++ b/dlls/shlwapi/shlwapi_Pl.rc @@ -38,4 +38,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bajtów" + IDS_TIME_INTERVAL_HOURS " godz." + IDS_TIME_INTERVAL_MINUTES " min." + IDS_TIME_INTERVAL_SECONDS " s" } diff --git a/dlls/shlwapi/shlwapi_Pt.rc b/dlls/shlwapi/shlwapi_Pt.rc index c0fb168df2..c11693a107 100644 --- a/dlls/shlwapi/shlwapi_Pt.rc +++ b/dlls/shlwapi/shlwapi_Pt.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/shlwapi_Tr.rc b/dlls/shlwapi/shlwapi_Tr.rc index a55641b3a4..15453623df 100644 --- a/dlls/shlwapi/shlwapi_Tr.rc +++ b/dlls/shlwapi/shlwapi_Tr.rc @@ -37,4 +37,7 @@ FONT 8, "MS Shell Dlg" STRINGTABLE DISCARDABLE { IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/dlls/shlwapi/string.c b/dlls/shlwapi/string.c index 8551c91105..ac5970fff1 100644 --- a/dlls/shlwapi/string.c +++ b/dlls/shlwapi/string.c @@ -1996,14 +1996,14 @@ inline static int SHLWAPI_FormatSignificant(LPWSTR lpszNum, int dwDigits) * Internal helper for StrFromTimeIntervalW. */ static int WINAPI SHLWAPI_WriteTimeClass(LPWSTR lpszOut, DWORD dwValue, - LPCWSTR lpszClass, int iDigits) + UINT uClassStringId, int iDigits) { WCHAR szBuff[64], *szOut = szBuff + 32; szOut = SHLWAPI_WriteReverseNum(szOut, dwValue); iDigits = SHLWAPI_FormatSignificant(szOut + 1, iDigits); *szOut = ' '; - strcpyW(szBuff + 32, lpszClass); + LoadStringW(shlwapi_hInstance, uClassStringId, szBuff + 32, 32); strcatW(lpszOut, szOut); return iDigits; } @@ -2064,9 +2064,6 @@ INT WINAPI StrFromTimeIntervalA(LPSTR lpszStr, UINT cchMax, DWORD dwMS, INT WINAPI StrFromTimeIntervalW(LPWSTR lpszStr, UINT cchMax, DWORD dwMS, int iDigits) { - static const WCHAR szHr[] = {' ','h','r','\0'}; - static const WCHAR szMin[] = {' ','m','i','n','\0'}; - static const WCHAR szSec[] = {' ','s','e','c','\0'}; INT iRet = 0; TRACE("(%p,%d,%ld,%d)\n", lpszStr, cchMax, dwMS, iDigits); @@ -2092,13 +2089,13 @@ INT WINAPI StrFromTimeIntervalW(LPWSTR lpszStr, UINT cchMax, DWORD dwMS, szCopy[0] = '\0'; if (dwHours) - iDigits = SHLWAPI_WriteTimeClass(szCopy, dwHours, szHr, iDigits); + iDigits = SHLWAPI_WriteTimeClass(szCopy, dwHours, IDS_TIME_INTERVAL_HOURS, iDigits); if (dwMinutes && iDigits) - iDigits = SHLWAPI_WriteTimeClass(szCopy, dwMinutes, szMin, iDigits); + iDigits = SHLWAPI_WriteTimeClass(szCopy, dwMinutes, IDS_TIME_INTERVAL_MINUTES, iDigits); if (iDigits) /* Always write seconds if we have significant digits */ - SHLWAPI_WriteTimeClass(szCopy, dwMS, szSec, iDigits); + SHLWAPI_WriteTimeClass(szCopy, dwMS, IDS_TIME_INTERVAL_SECONDS, iDigits); lstrcpynW(lpszStr, szCopy, cchMax); iRet = strlenW(lpszStr);