comdlg32: Fix a couple of string resources so their format placeholders can be reordered.
Francois Gouget
fgouget at free.fr
Sat Nov 19 08:11:49 CST 2011
---
dlls/comdlg32/comdlg32.rc | 4 ++--
dlls/comdlg32/fontdlg.c | 7 ++++++-
dlls/comdlg32/printdlg.c | 8 +++++++-
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/dlls/comdlg32/comdlg32.rc b/dlls/comdlg32/comdlg32.rc
index 997aaaf..bd4021a 100644
--- a/dlls/comdlg32/comdlg32.rc
+++ b/dlls/comdlg32/comdlg32.rc
@@ -65,7 +65,7 @@ STRINGTABLE
PD32_VALUE_UREADABLE "Unreadable Entry"
PD32_INVALID_PAGE_RANGE "This value does not lie within the page range.\n\
-Please enter a value between %d and %d."
+Please enter a value between %1!d! and %2!d!."
PD32_FROM_NOT_ABOVE_TO "The 'from' entry cannot exceed the \
'to' entry."
PD32_MARGINS_OVERLAP "Margins overlap or fall outside \
@@ -148,7 +148,7 @@ STRINGTABLE /* Color names */
STRINGTABLE
{
- IDS_FONT_SIZE "Select a font size between %d and %d points."
+ IDS_FONT_SIZE "Select a font size between %1!d! and %2!d! points."
IDS_SAVE_BUTTON "&Save"
IDS_SAVE_IN "Save &in:"
IDS_SAVE "Save"
diff --git a/dlls/comdlg32/fontdlg.c b/dlls/comdlg32/fontdlg.c
index 3bfa5ed..8068e82 100644
--- a/dlls/comdlg32/fontdlg.c
+++ b/dlls/comdlg32/fontdlg.c
@@ -1055,8 +1055,13 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFO
{
WCHAR buffer[80];
WCHAR format[80];
+ DWORD_PTR args[2];
LoadStringW(COMDLG32_hInstance, IDS_FONT_SIZE, format, sizeof(format)/sizeof(WCHAR));
- wsprintfW(buffer, format, lpcf->nSizeMin,lpcf->nSizeMax);
+ args[0] = lpcf->nSizeMin;
+ args[1] = lpcf->nSizeMax;
+ FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,
+ format, 0, 0, buffer, sizeof(buffer)/sizeof(*buffer),
+ (__ms_va_list*)args);
MessageBoxW(hDlg, buffer, NULL, MB_OK);
}
return(TRUE);
diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c
index b2d5331..ee4dab2 100644
--- a/dlls/comdlg32/printdlg.c
+++ b/dlls/comdlg32/printdlg.c
@@ -543,9 +543,15 @@ static BOOL PRINTDLG_UpdatePrintDlgW(HWND hDlg,
nToPage < lppd->nMinPage || nToPage > lppd->nMaxPage) {
WCHAR resourcestr[256];
WCHAR resultstr[256];
+ DWORD_PTR args[2];
LoadStringW(COMDLG32_hInstance, PD32_INVALID_PAGE_RANGE,
resourcestr, 255);
- wsprintfW(resultstr,resourcestr, lppd->nMinPage, lppd->nMaxPage);
+ args[0] = lppd->nMinPage;
+ args[1] = lppd->nMaxPage;
+ FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,
+ resourcestr, 0, 0, resultstr,
+ sizeof(resultstr)/sizeof(*resultstr),
+ (__ms_va_list*)args);
LoadStringW(COMDLG32_hInstance, PD32_PRINT_TITLE,
resourcestr, 255);
MessageBoxW(hDlg, resultstr, resourcestr,
--
1.7.7.1
More information about the wine-patches
mailing list