Huw Davies : comdlg32: Display the fractional part of the margins.

Alexandre Julliard julliard at winehq.org
Mon Jan 19 08:58:24 CST 2009


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Fri Jan 16 12:04:45 2009 +0000

comdlg32: Display the fractional part of the margins.

---

 dlls/comdlg32/printdlg.c |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c
index be0eaf8..fdedbcf 100644
--- a/dlls/comdlg32/printdlg.c
+++ b/dlls/comdlg32/printdlg.c
@@ -2416,13 +2416,28 @@ _c_inch2size(PAGESETUPDLGA *dlga,DWORD size) {
 
 static void size2str(const PageSetupDataA *pda, DWORD size, LPWSTR strout)
 {
-    static const WCHAR metric_format[] = {'%','d',0};
-    static const WCHAR imperial_format[] = {'%','d','i','n',0};
+    WCHAR decimal[2] = {'.', 0};
+    WCHAR integer_fmt[] = {'%','d',0};
+    WCHAR hundredths_fmt[] = {'%','d','%','s','%','0','2','d',0};
+    WCHAR thousandths_fmt[] = {'%','d','%','s','%','0','3','d',0};
+
+    /* FIXME use LOCALE_SDECIMAL when the edit parsing code can cope */
 
     if (is_metric(pda))
-	wsprintfW(strout, metric_format, size / 100);
+    {
+        if(size % 100)
+            wsprintfW(strout, hundredths_fmt, size / 100, decimal, size % 100);
+        else
+            wsprintfW(strout, integer_fmt, size / 100);
+    }
     else
-	wsprintfW(strout, imperial_format, size / 1000);
+    {
+        if(size % 1000)
+            wsprintfW(strout, thousandths_fmt, size / 1000, decimal, size % 1000);
+        else
+            wsprintfW(strout, integer_fmt, size / 1000);
+
+    }
 }
 
 static void




More information about the wine-cvs mailing list