From f9f881bfc2f8810a79874ba2f643544dcc8acf2c Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Fri, 5 Sep 2008 11:08:49 +0200 Subject: [PATCH] comdlg32/printdlg: If ToPages field is left empty set it to FromPages value. --- dlls/comdlg32/printdlg.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index 52ac3c6dfe2..bc49bfcfa3d 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -309,8 +309,13 @@ static BOOL PRINTDLG_UpdatePrintDlgA(HWND hDlg, if (IsDlgButtonChecked(hDlg, rad3) == BST_CHECKED) { /* Pages */ WORD nToPage; WORD nFromPage; + BOOL translated; nFromPage = GetDlgItemInt(hDlg, edt1, NULL, FALSE); - nToPage = GetDlgItemInt(hDlg, edt2, NULL, FALSE); + nToPage = GetDlgItemInt(hDlg, edt2, &translated, FALSE); + + /* if no ToPage value is entered, use the FromPage value */ + if(!translated) nToPage = nFromPage; + if (nFromPage < lppd->nMinPage || nFromPage > lppd->nMaxPage || nToPage < lppd->nMinPage || nToPage > lppd->nMaxPage) { WCHAR resourcestr[256]; @@ -407,8 +412,13 @@ static BOOL PRINTDLG_UpdatePrintDlgW(HWND hDlg, if (IsDlgButtonChecked(hDlg, rad3) == BST_CHECKED) { /* Pages */ WORD nToPage; WORD nFromPage; + BOOL translated; nFromPage = GetDlgItemInt(hDlg, edt1, NULL, FALSE); - nToPage = GetDlgItemInt(hDlg, edt2, NULL, FALSE); + nToPage = GetDlgItemInt(hDlg, edt2, &translated, FALSE); + + /* if no ToPage value is entered, use the FromPage value */ + if(!translated) nToPage = nFromPage; + if (nFromPage < lppd->nMinPage || nFromPage > lppd->nMaxPage || nToPage < lppd->nMinPage || nToPage > lppd->nMaxPage) { WCHAR resourcestr[256];