wordpad: More error handling for printing/print preview.

This commit is contained in:
Alexander Nicolaysen Sørnes 2007-09-07 23:40:53 +02:00 committed by Alexandre Julliard
parent f6cc0086fe
commit 93dc2338b2
1 changed files with 3 additions and 2 deletions

View File

@ -1302,7 +1302,8 @@ static int get_num_pages(FORMATRANGE fr)
page++; page++;
fr.chrg.cpMin = SendMessageW(hEditorWnd, EM_FORMATRANGE, TRUE, fr.chrg.cpMin = SendMessageW(hEditorWnd, EM_FORMATRANGE, TRUE,
(LPARAM)&fr); (LPARAM)&fr);
} while(fr.chrg.cpMin < fr.chrg.cpMax); }
while(fr.chrg.cpMin && fr.chrg.cpMin < fr.chrg.cpMax);
return page; return page;
} }
@ -1376,7 +1377,7 @@ static void print(LPPRINTDLGW pd)
if((pd->Flags & PD_PAGENUMS) && (printedPages > (pd->nToPage - pd->nFromPage))) if((pd->Flags & PD_PAGENUMS) && (printedPages > (pd->nToPage - pd->nFromPage)))
break; break;
} }
while(fr.chrg.cpMin < fr.chrg.cpMax); while(fr.chrg.cpMin && fr.chrg.cpMin < fr.chrg.cpMax);
EndDoc(fr.hdc); EndDoc(fr.hdc);
SendMessageW(hEditorWnd, EM_FORMATRANGE, FALSE, 0); SendMessageW(hEditorWnd, EM_FORMATRANGE, FALSE, 0);