[PATCH 11/45] [WinHelp]: we no longer need to create the fonts inside winhelp

Eric Pouech eric.pouech at orange.fr
Sun Mar 23 04:18:13 CDT 2008




A+
---

 programs/winhelp/hlpfile.c |    5 -----
 programs/winhelp/hlpfile.h |    1 -
 programs/winhelp/winhelp.c |   40 ----------------------------------------
 programs/winhelp/winhelp.h |    4 ----
 4 files changed, 0 insertions(+), 50 deletions(-)


diff --git a/programs/winhelp/hlpfile.c b/programs/winhelp/hlpfile.c
index b86d68e..55bb0c2 100644
--- a/programs/winhelp/hlpfile.c
+++ b/programs/winhelp/hlpfile.c
@@ -1158,7 +1158,6 @@ static BOOL HLPFILE_ReadFont(HLPFILE* hlpfile)
             WINE_FIXME("Too high face ref (%u/%u)\n", idx, face_num);
             strcpy(hlpfile->fonts[i].LogFont.lfFaceName, "Helv");
         }
-        hlpfile->fonts[i].hFont = 0;
         hlpfile->fonts[i].color = RGB(ref[dscr_offset + i * 11 + 5],
                                       ref[dscr_offset + i * 11 + 6],
                                       ref[dscr_offset + i * 11 + 7]);
@@ -2016,10 +2015,6 @@ void HLPFILE_FreeHlpFile(HLPFILE* hlpfile)
 
     if (hlpfile->numFonts)
     {
-        for (i = 0; i < hlpfile->numFonts; i++)
-        {
-            DeleteObject(hlpfile->fonts[i].hFont);
-        }
         HeapFree(GetProcessHeap(), 0, hlpfile->fonts);
     }
 
diff --git a/programs/winhelp/hlpfile.h b/programs/winhelp/hlpfile.h
index 777d12f..e43a9ef 100644
--- a/programs/winhelp/hlpfile.h
+++ b/programs/winhelp/hlpfile.h
@@ -66,7 +66,6 @@ typedef struct
 typedef struct
 {
     LOGFONT                     LogFont;
-    HFONT                       hFont;
     COLORREF                    color;
 } HLPFILE_FONT;
 
diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c
index c8d9a85..b4ae6a1 100644
--- a/programs/winhelp/winhelp.c
+++ b/programs/winhelp/winhelp.c
@@ -48,7 +48,6 @@ static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND, UINT, WPARAM, LPARAM);
 static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND, UINT, WPARAM, LPARAM);
 static LRESULT CALLBACK WINHELP_ShadowWndProc(HWND, UINT, WPARAM, LPARAM);
 static void    WINHELP_CheckPopup(UINT);
-static void    WINHELP_InitFonts(HWND hWnd);
 static void    WINHELP_DeleteWindow(WINHELP_WINDOW*);
 
 WINHELP_GLOBALS Globals = {3, NULL, NULL, TRUE, NULL, NULL, NULL, NULL};
@@ -456,8 +455,6 @@ static BOOL     WINHELP_ReuseWindow(WINHELP_WINDOW* win, WINHELP_WINDOW* oldwin,
     SetWindowLong(win->hMainWnd,      0, (LONG)win);
     SetWindowLong(win->hHistoryWnd,   0, (LONG)win);
 
-    WINHELP_InitFonts(win->hMainWnd);
-
     if (page)
         SetWindowText(win->hMainWnd, page->file->lpszTitle);
 
@@ -556,7 +553,6 @@ BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE* page, HLPFILE_WINDOWINFO* wi,
 
     win->page = page;
 
-    win->hArrowCur = LoadCursorA(0, (LPSTR)IDC_ARROW);
     win->hHandCur = LoadCursorA(0, (LPSTR)IDC_HAND);
 
     win->info = wi;
@@ -1025,42 +1021,6 @@ static void WINHELP_DeleteWindow(WINHELP_WINDOW* win)
 
 /***********************************************************************
  *
- *           WINHELP_InitFonts
- */
-static void WINHELP_InitFonts(HWND hWnd)
-{
-    WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
-    LOGFONT logfontlist[] = {
-        {-10, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"},
-        {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"},
-        {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"},
-        {-12, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"},
-        {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"},
-        {-10, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"},
-        { -8, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}};
-#define FONTS_LEN (sizeof(logfontlist)/sizeof(*logfontlist))
-
-    static HFONT fonts[FONTS_LEN];
-    static BOOL init = 0;
-
-    win->fonts_len = FONTS_LEN;
-    win->fonts = fonts;
-
-    if (!init)
-    {
-        UINT i;
-
-        for (i = 0; i < FONTS_LEN; i++)
-	{
-            fonts[i] = CreateFontIndirect(&logfontlist[i]);
-	}
-
-        init = 1;
-    }
-}
-
-/***********************************************************************
- *
  *           WINHELP_MessageBoxIDS
  */
 INT WINHELP_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
diff --git a/programs/winhelp/winhelp.h b/programs/winhelp/winhelp.h
index 27e8d53..2c351c8 100644
--- a/programs/winhelp/winhelp.h
+++ b/programs/winhelp/winhelp.h
@@ -66,10 +66,6 @@ typedef struct tagWinHelp
     HWND                hShadowWnd;
     HWND                hHistoryWnd;
 
-    HFONT*              fonts;
-    UINT                fonts_len;
-
-    HCURSOR             hArrowCur;
     HCURSOR             hHandCur;
 
     HLPFILE_WINDOWINFO* info;





More information about the wine-patches mailing list