Author: akhaldi Date: Sun Jun 16 12:43:35 2013 New Revision: 59230
URL: http://svn.reactos.org/svn/reactos?rev=59230&view=rev Log: [FONTVIEW] * Restructure Display_OnPrint to eliminate allocating an unused variable and plug a leak.
Modified: trunk/reactos/base/applications/fontview/display.c
Modified: trunk/reactos/base/applications/fontview/display.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/fontview/... ============================================================================== --- trunk/reactos/base/applications/fontview/display.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/fontview/display.c [iso-8859-1] Sun Jun 16 12:43:35 2013 @@ -417,13 +417,6 @@ PRINTDLG pfont; TEXTMETRIC tm; 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 */ ZeroMemory(&pfont, sizeof(pfont)); @@ -443,7 +436,15 @@ if (PrintDlg(&pfont)) { 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.lpszDocName = "Printing Font"; docinfo.lpszOutput = NULL; @@ -470,7 +471,9 @@
/* TODO: Determine if using Display_DrawText() will work for both rendering out to the 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 */ EndPage(pfont.hDC); @@ -487,12 +490,11 @@ EndDoc(pfont.hDC);
DeleteDC(pfont.hDC); - } else { - return 0; - } - - /* Frees the memory since we no longer need it for now */ - free(pData); +#if 0 + /* Frees the memory since we no longer need it for now */ + free(pData); +#endif + }
return 0; }