Dylan Smith : wordpad: Reset rc.bottom between calls to EM_FORMATRANGE.
Module: wine Branch: master Commit: fc473e0f6387fffac400cd69f6dca1356bcb84d3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=fc473e0f6387fffac400cd69f6... Author: Dylan Smith <dylan.ah.smith(a)gmail.com> Date: Wed Jan 27 02:25:10 2010 -0500 wordpad: Reset rc.bottom between calls to EM_FORMATRANGE. EM_FORMATRANGE will set rc.bottom within the FORMATRANGE struct to be the bottom of the area actually printed to, so this must be reset between calls to make sure that the page boundaries are consistent between the pages. --- programs/wordpad/print.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/programs/wordpad/print.c b/programs/wordpad/print.c index dc18966..b920a4f 100644 --- a/programs/wordpad/print.c +++ b/programs/wordpad/print.c @@ -243,9 +243,11 @@ static int get_num_pages(HWND hEditorWnd, FORMATRANGE fr) do { + int bottom = fr.rc.bottom; page++; fr.chrg.cpMin = SendMessageW(hEditorWnd, EM_FORMATRANGE, TRUE, (LPARAM)&fr); + fr.rc.bottom = bottom; } while(fr.chrg.cpMin && fr.chrg.cpMin < fr.chrg.cpMax); @@ -260,7 +262,9 @@ static void char_from_pagenum(HWND hEditorWnd, FORMATRANGE *fr, int page) for(i = 1; i < page; i++) { + int bottom = fr->rc.bottom; fr->chrg.cpMin = SendMessageW(hEditorWnd, EM_FORMATRANGE, TRUE, (LPARAM)fr); + fr->rc.bottom = bottom; } } @@ -328,6 +332,7 @@ static void print(LPPRINTDLGW pd, LPWSTR wszFileName) StartDocW(fr.hdc, &di); do { + int bottom = fr.rc.bottom; if(StartPage(fr.hdc) <= 0) break; @@ -335,6 +340,7 @@ static void print(LPPRINTDLGW pd, LPWSTR wszFileName) if(EndPage(fr.hdc) <= 0) break; + bottom = fr.rc.bottom; printedPages++; if((pd->Flags & PD_PAGENUMS) && (printedPages > (pd->nToPage - pd->nFromPage)))
participants (1)
-
Alexandre Julliard