Moved string to resources.
authorJacek Caban <jack@itma.pwr.wroc.pl>
Thu, 6 Jan 2005 19:43:43 +0000 (19:43 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 6 Jan 2005 19:43:43 +0000 (19:43 +0000)
dlls/commdlg/cdlg.h
dlls/commdlg/cdlg_En.rc
dlls/commdlg/cdlg_Pl.rc
dlls/commdlg/fontdlg.c

index 4461ecb2558e6e23906eb0ac75b4c3c3811e2e1d..5f80e51dd886f73bc1745f8ca3a887499f694a5a 100644 (file)
@@ -145,6 +145,8 @@ typedef struct {
 #define IDS_COLOR_AQUA                  1054
 #define IDS_COLOR_WHITE                 1055
 
+#define IDS_FONT_SIZE    1200
+
 #include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
index 27546580b347890ec35580e801372926dff80838..d4ede7a8cfa88908313fc286ea190262b4db8846 100644 (file)
@@ -460,6 +460,10 @@ STRINGTABLE DISCARDABLE /* Color names */
     IDS_COLOR_WHITE     "White"
 }
 
+STRINGTABLE DISCARDABLE
+{
+    IDS_FONT_SIZE   "Select a font size between %d and %d points."
+}
 
 /****************************************************************/
 /* English neutral resources
index e7d2ec4b31dcb574bcb81b9755ad63aac36af0e0..85fa2232a12c075c2dc356ce66cbed2a3b99d4b9 100644 (file)
@@ -436,6 +436,11 @@ STRINGTABLE DISCARDABLE
     PD32_PRINTER_STATUS_POWER_SAVE        "Tryb oszcz�dzania energii; "
 }
 
+STRINGTABLE DISCARDABLE
+{
+    IDS_FONT_SIZE   "Wybierz czcionk� o rozmiarze pomi�dzy %d a %d punktami."
+}
+
 STRINGTABLE DISCARDABLE /* Color names */
 {
     IDS_COLOR_BLACK     "Czarny"
index cec484f553044f1c1c11ab00cf0f21cfa080d6fd..61e5ba2afe179da8b224bfec675c4ebf7df047ff 100644 (file)
@@ -393,16 +393,17 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf)
 static int AddFontSizeToCombo3(HWND hwnd, UINT h, LPCHOOSEFONTW lpcf)
 {
     int j;
-    char buffer[20];
+    WCHAR buffer[20];
+    static const WCHAR strFormat[] = {'%','2','d',0};
 
     if (  (!(lpcf->Flags & CF_LIMITSIZE))  ||
             ((lpcf->Flags & CF_LIMITSIZE) && (h >= lpcf->nSizeMin) && (h <= lpcf->nSizeMax)))
     {
-        sprintf(buffer, "%2d", h);
-        j=SendMessageA(hwnd, CB_FINDSTRINGEXACT, -1, (LPARAM)buffer);
+        wsprintfW(buffer, strFormat, h);
+        j=SendMessageW(hwnd, CB_FINDSTRINGEXACT, -1, (LPARAM)buffer);
         if (j==CB_ERR)
         {
-            j=SendMessageA(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer);
+            j=SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer);
             if (j!=CB_ERR) j = SendMessageW(hwnd, CB_SETITEMDATA, j, h);
             if (j==CB_ERR) return 1;
         }
@@ -1006,10 +1007,11 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
             EndDialog(hDlg, TRUE);
         else
         {
-            char buffer[80];
-            sprintf(buffer,"Select a font size between %d and %d points.",
-                    lpcf->nSizeMin,lpcf->nSizeMax);
-            MessageBoxA(hDlg, buffer, NULL, MB_OK);
+            WCHAR buffer[80];
+            WCHAR format[80];
+            LoadStringW(COMDLG32_hInstance, IDS_FONT_SIZE, format, sizeof(format)/sizeof(WCHAR));
+            wsprintfW(buffer, format, lpcf->nSizeMin,lpcf->nSizeMax);
+            MessageBoxW(hDlg, buffer, NULL, MB_OK);
         }
         return(TRUE);
     case IDCANCEL: