Alexander Nicolaysen Sørnes : comdlg32: printdlg: Fix number display in PrintDlgW().

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 20 16:09:05 CDT 2007


Module: wine
Branch: master
Commit: 225c33fe7047251be4edb33f428cdf118a4832ea
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=225c33fe7047251be4edb33f428cdf118a4832ea

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Tue Jul 24 23:26:53 2007 +0200

comdlg32: printdlg: Fix number display in PrintDlgW().

---

 dlls/comdlg32/printdlg.c |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c
index 5301646..714f09c 100644
--- a/dlls/comdlg32/printdlg.c
+++ b/dlls/comdlg32/printdlg.c
@@ -2413,21 +2413,19 @@ _c_size2strA(PageSetupDataA *pda,DWORD size,LPSTR strout) {
 }
 static void
 _c_size2strW(PageSetupDataW *pda,DWORD size,LPWSTR strout) {
-    static const WCHAR UNDEF[] = { '<', 'u', 'n', 'd', 'e', 'f', '>', 0 };
-    static const WCHAR mm_fmt[] = { '%', '.', '2', 'f', 'm', 'm', 0 };
-    static const WCHAR in_fmt[] = { '%', '.', '2', 'f', 'i', 'n', 0 };
-    lstrcpyW(strout, UNDEF);
+    static const char mm_fmt[] = "%.2f mm";
+    static const char in_fmt[] = "%.2f in";
+    char buf[20];
     if (pda->dlga->Flags & PSD_INHUNDREDTHSOFMILLIMETERS) {
-	wsprintfW(strout,mm_fmt,(size*1.0)/100.0);
-	return;
-    }
-    if (pda->dlga->Flags & PSD_INTHOUSANDTHSOFINCHES) {
-	wsprintfW(strout,in_fmt,(size*1.0)/1000.0);
-	return;
+        sprintf(buf, mm_fmt, (size * 1.0) / 100.0);
+    } else if (pda->dlga->Flags & PSD_INTHOUSANDTHSOFINCHES) {
+        sprintf(buf, in_fmt, (size * 1.0) / 1000.0);
+    } else {
+        pda->dlga->Flags |= PSD_INHUNDREDTHSOFMILLIMETERS;
+        sprintf(buf, mm_fmt, (size * 1.0) / 100.0);
     }
-    pda->dlga->Flags |= PSD_INHUNDREDTHSOFMILLIMETERS;
-    wsprintfW(strout,mm_fmt,(size*1.0)/100.0);
-    return;
+
+    MultiByteToWideChar(CP_ACP, 0, buf, -1, strout, 20);
 }
 
 static DWORD




More information about the wine-cvs mailing list