mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:53:06 +00:00
[FONTVIEW]
* Restructure Display_OnPrint to eliminate allocating an unused variable and plug a leak. svn path=/trunk/; revision=59230
This commit is contained in:
parent
78a3d923b6
commit
a2949de657
1 changed files with 15 additions and 13 deletions
|
@ -417,13 +417,6 @@ Display_OnPrint(HWND hwnd)
|
||||||
PRINTDLG pfont;
|
PRINTDLG pfont;
|
||||||
TEXTMETRIC tm;
|
TEXTMETRIC tm;
|
||||||
int copies, yPos;
|
int copies, yPos;
|
||||||
DISPLAYDATA* pData;
|
|
||||||
|
|
||||||
pData = malloc(sizeof(DISPLAYDATA));
|
|
||||||
ZeroMemory(pData, sizeof(DISPLAYDATA));
|
|
||||||
|
|
||||||
/* Sets up the font layout */
|
|
||||||
pData = (DISPLAYDATA*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
|
||||||
|
|
||||||
/* Clears the memory before using it */
|
/* Clears the memory before using it */
|
||||||
ZeroMemory(&pfont, sizeof(pfont));
|
ZeroMemory(&pfont, sizeof(pfont));
|
||||||
|
@ -443,7 +436,15 @@ Display_OnPrint(HWND hwnd)
|
||||||
if (PrintDlg(&pfont))
|
if (PrintDlg(&pfont))
|
||||||
{
|
{
|
||||||
DOCINFO docinfo;
|
DOCINFO docinfo;
|
||||||
|
#if 0
|
||||||
|
DISPLAYDATA* pData;
|
||||||
|
|
||||||
|
pData = malloc(sizeof(DISPLAYDATA));
|
||||||
|
ZeroMemory(pData, sizeof(DISPLAYDATA));
|
||||||
|
|
||||||
|
/* Sets up the font layout */
|
||||||
|
pData = (DISPLAYDATA*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
||||||
|
#endif
|
||||||
docinfo.cbSize = sizeof(DOCINFO);
|
docinfo.cbSize = sizeof(DOCINFO);
|
||||||
docinfo.lpszDocName = "Printing Font";
|
docinfo.lpszDocName = "Printing Font";
|
||||||
docinfo.lpszOutput = NULL;
|
docinfo.lpszOutput = NULL;
|
||||||
|
@ -470,7 +471,9 @@ Display_OnPrint(HWND hwnd)
|
||||||
|
|
||||||
/* TODO: Determine if using Display_DrawText() will work for both rendering out to the
|
/* TODO: Determine if using Display_DrawText() will work for both rendering out to the
|
||||||
window and to the printer output */
|
window and to the printer output */
|
||||||
//Display_DrawText(pfont.hDC, pData, yPos);
|
#if 0
|
||||||
|
Display_DrawText(pfont.hDC, pData, yPos);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Ends the current page */
|
/* Ends the current page */
|
||||||
EndPage(pfont.hDC);
|
EndPage(pfont.hDC);
|
||||||
|
@ -487,13 +490,12 @@ Display_OnPrint(HWND hwnd)
|
||||||
EndDoc(pfont.hDC);
|
EndDoc(pfont.hDC);
|
||||||
|
|
||||||
DeleteDC(pfont.hDC);
|
DeleteDC(pfont.hDC);
|
||||||
} else {
|
#if 0
|
||||||
return 0;
|
/* Frees the memory since we no longer need it for now */
|
||||||
|
free(pData);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Frees the memory since we no longer need it for now */
|
|
||||||
free(pData);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue