comdlg32: Add an is_metric() helper function.

This commit is contained in:
Huw Davies 2009-01-16 12:08:18 +00:00 committed by Alexandre Julliard
parent 8149f2a645
commit 3288c72057
1 changed files with 6 additions and 1 deletions

View File

@ -2393,6 +2393,11 @@ static HGLOBAL PRINTDLG_GetPGSTemplateW(const PAGESETUPDLGW *lppd)
return hDlgTmpl;
}
static inline BOOL is_metric(const PageSetupDataA *pda)
{
return pda->dlga->Flags & PSD_INHUNDREDTHSOFMILLIMETERS;
}
static DWORD
_c_10mm2size(PAGESETUPDLGA *dlga,DWORD size) {
if (dlga->Flags & PSD_INTHOUSANDTHSOFINCHES)
@ -2414,7 +2419,7 @@ 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};
if (pda->dlga->Flags & PSD_INHUNDREDTHSOFMILLIMETERS)
if (is_metric(pda))
wsprintfW(strout, metric_format, size / 100);
else
wsprintfW(strout, imperial_format, size / 1000);