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.
This commit is contained in:
parent
e42d1a8cc1
commit
fc473e0f63
|
@ -243,9 +243,11 @@ static int get_num_pages(HWND hEditorWnd, FORMATRANGE fr)
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
int bottom = fr.rc.bottom;
|
||||||
page++;
|
page++;
|
||||||
fr.chrg.cpMin = SendMessageW(hEditorWnd, EM_FORMATRANGE, TRUE,
|
fr.chrg.cpMin = SendMessageW(hEditorWnd, EM_FORMATRANGE, TRUE,
|
||||||
(LPARAM)&fr);
|
(LPARAM)&fr);
|
||||||
|
fr.rc.bottom = bottom;
|
||||||
}
|
}
|
||||||
while(fr.chrg.cpMin && fr.chrg.cpMin < fr.chrg.cpMax);
|
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++)
|
for(i = 1; i < page; i++)
|
||||||
{
|
{
|
||||||
|
int bottom = fr->rc.bottom;
|
||||||
fr->chrg.cpMin = SendMessageW(hEditorWnd, EM_FORMATRANGE, TRUE, (LPARAM)fr);
|
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);
|
StartDocW(fr.hdc, &di);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
int bottom = fr.rc.bottom;
|
||||||
if(StartPage(fr.hdc) <= 0)
|
if(StartPage(fr.hdc) <= 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -335,6 +340,7 @@ static void print(LPPRINTDLGW pd, LPWSTR wszFileName)
|
||||||
|
|
||||||
if(EndPage(fr.hdc) <= 0)
|
if(EndPage(fr.hdc) <= 0)
|
||||||
break;
|
break;
|
||||||
|
bottom = fr.rc.bottom;
|
||||||
|
|
||||||
printedPages++;
|
printedPages++;
|
||||||
if((pd->Flags & PD_PAGENUMS) && (printedPages > (pd->nToPage - pd->nFromPage)))
|
if((pd->Flags & PD_PAGENUMS) && (printedPages > (pd->nToPage - pd->nFromPage)))
|
||||||
|
|
Loading…
Reference in New Issue