Commit ccd75350 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winhelp: Properly handle the back button (in multiple windows, in empty stack...).

parent d95bcb73
......@@ -230,17 +230,7 @@ void CALLBACK MACRO_BackFlush(void)
WINE_TRACE("()\n");
if (win)
{
unsigned int i;
for (i = 0; i < win->back.index; i++)
{
HLPFILE_FreeHlpFile(win->back.set[i].page->file);
win->back.set[i].page = NULL;
}
win->back.index = 0;
}
if (win) WINHELP_DeleteBackSet(win);
}
void CALLBACK MACRO_BookmarkDefine(void)
......
......@@ -549,6 +549,8 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow)
wpage->wininfo->size.cy != CW_USEDEFAULT)
SetWindowPos(win->hMainWnd, HWND_TOP,
0, 0, wpage->wininfo->size.cx, wpage->wininfo->size.cy, SWP_NOMOVE);
if (wpage->page && wpage->page->file != win->page->file)
WINHELP_DeleteBackSet(win);
WINHELP_InitFonts(win->hMainWnd);
win->page = wpage->page;
......@@ -1814,6 +1816,22 @@ static void WINHELP_DeleteButtons(WINHELP_WINDOW* win)
win->first_button = NULL;
}
/******************************************************************
* WINHELP_DeleteBackSet
*
*/
void WINHELP_DeleteBackSet(WINHELP_WINDOW* win)
{
unsigned int i;
for (i = 0; i < win->back.index; i++)
{
HLPFILE_FreeHlpFile(win->back.set[i].page->file);
win->back.set[i].page = NULL;
}
win->back.index = 0;
}
/***********************************************************************
*
* WINHELP_DeleteWindow
......@@ -1821,7 +1839,6 @@ static void WINHELP_DeleteButtons(WINHELP_WINDOW* win)
static void WINHELP_DeleteWindow(WINHELP_WINDOW* win)
{
WINHELP_WINDOW** w;
unsigned int i;
for (w = &Globals.win_list; *w; w = &(*w)->next)
{
......@@ -1846,8 +1863,7 @@ static void WINHELP_DeleteWindow(WINHELP_WINDOW* win)
DeleteObject(win->hBrush);
for (i = 0; i < win->back.index; i++)
HLPFILE_FreeHlpFile(win->back.set[i].page->file);
WINHELP_DeleteBackSet(win);
if (win->page) HLPFILE_FreeHlpFile(win->page->file);
WINHELP_DeleteLines(win);
......
......@@ -183,6 +183,7 @@ BOOL WINHELP_CreateHelpWindowByOffset(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*, int);
BOOL WINHELP_GetOpenFileName(LPSTR, int);
BOOL WINHELP_CreateIndexWindow(void);
void WINHELP_DeleteBackSet(WINHELP_WINDOW*);
INT WINHELP_MessageBoxIDS(UINT, UINT, WORD);
INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD);
HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment