winhlp32: Remove the lpszName field from the window structure, as it's given by the window info.

This commit is contained in:
Eric Pouech 2009-05-30 14:26:58 +02:00 committed by Alexandre Julliard
parent a6104304f4
commit e3beef0af5
3 changed files with 7 additions and 14 deletions

View File

@ -280,7 +280,7 @@ static void CALLBACK MACRO_CloseSecondarys(void)
WINE_TRACE("()\n"); WINE_TRACE("()\n");
for (win = Globals.win_list; win; win = win->next) for (win = Globals.win_list; win; win = win->next)
if (win->lpszName && lstrcmpi(win->lpszName, "main")) if (lstrcmpi(win->info->name, "main"))
DestroyWindow(win->hMainWnd); DestroyWindow(win->hMainWnd);
} }
@ -293,7 +293,7 @@ static void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow)
if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main"; if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
for (win = Globals.win_list; win; win = win->next) for (win = Globals.win_list; win; win = win->next)
if (win->lpszName && !lstrcmpi(win->lpszName, lpszWindow)) if (!lstrcmpi(win->info->name, lpszWindow))
DestroyWindow(win->hMainWnd); DestroyWindow(win->hMainWnd);
} }
@ -430,7 +430,7 @@ static void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow)
if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main"; if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
for (win = Globals.win_list; win; win = win->next) for (win = Globals.win_list; win; win = win->next)
if (win->lpszName && !lstrcmpi(win->lpszName, lpszWindow)) if (!lstrcmpi(win->info->name, lpszWindow))
SetFocus(win->hMainWnd); SetFocus(win->hMainWnd);
} }

View File

@ -257,7 +257,7 @@ HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name)
unsigned int i; unsigned int i;
if (!name || !name[0]) if (!name || !name[0])
name = Globals.active_win->lpszName; name = Globals.active_win->info->name;
if (hlpfile) if (hlpfile)
for (i = 0; i < hlpfile->numWindows; i++) for (i = 0; i < hlpfile->numWindows; i++)
@ -645,7 +645,6 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
{ {
WINHELP_WINDOW* win = NULL; WINHELP_WINDOW* win = NULL;
BOOL bPrimary, bPopup, bReUsed = FALSE; BOOL bPrimary, bPopup, bReUsed = FALSE;
LPSTR name;
HICON hIcon; HICON hIcon;
HWND hTextWnd = NULL; HWND hTextWnd = NULL;
@ -656,7 +655,7 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
{ {
for (win = Globals.win_list; win; win = win->next) for (win = Globals.win_list; win; win = win->next)
{ {
if (!lstrcmpi(win->lpszName, wpage->wininfo->name)) if (!lstrcmpi(win->info->name, wpage->wininfo->name))
{ {
POINT pt = {0, 0}; POINT pt = {0, 0};
SIZE sz = {0, 0}; SIZE sz = {0, 0};
@ -699,15 +698,11 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
if (!win) if (!win)
{ {
/* Initialize WINHELP_WINDOW struct */ /* Initialize WINHELP_WINDOW struct */
win = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, win = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINHELP_WINDOW));
sizeof(WINHELP_WINDOW) + strlen(wpage->wininfo->name) + 1);
if (!win) return FALSE; if (!win) return FALSE;
win->next = Globals.win_list; win->next = Globals.win_list;
Globals.win_list = win; Globals.win_list = win;
name = (char*)win + sizeof(WINHELP_WINDOW);
lstrcpy(name, wpage->wininfo->name);
win->lpszName = name;
win->hHandCur = LoadCursorW(0, (LPWSTR)IDC_HAND); win->hHandCur = LoadCursorW(0, (LPWSTR)IDC_HAND);
win->back.index = 0; win->back.index = 0;
win->font_scale = 1; win->font_scale = 1;
@ -1496,7 +1491,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
{ {
BOOL bExit; BOOL bExit;
win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0);
bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->lpszName, "main")); bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->info->name, "main"));
WINHELP_DeleteWindow(win); WINHELP_DeleteWindow(win);
if (bExit) MACRO_Exit(); if (bExit) MACRO_Exit();

View File

@ -71,8 +71,6 @@ typedef struct tagPageSet
typedef struct tagWinHelp typedef struct tagWinHelp
{ {
LPCSTR lpszName;
WINHELP_BUTTON* first_button; WINHELP_BUTTON* first_button;
HLPFILE_PAGE* page; HLPFILE_PAGE* page;