Commit 6af0e45d authored by Kirill K. Smirnov's avatar Kirill K. Smirnov Committed by Alexandre Julliard

winhelp: Remember last added page.

parent 8e639ec3
...@@ -443,15 +443,14 @@ static BOOL HLPFILE_AddPage(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigned off ...@@ -443,15 +443,14 @@ static BOOL HLPFILE_AddPage(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigned off
if (hlpfile->first_page) if (hlpfile->first_page)
{ {
HLPFILE_PAGE *p; hlpfile->last_page->next = page;
page->prev = hlpfile->last_page;
for (p = hlpfile->first_page; p->next; p = p->next); hlpfile->last_page = page;
page->prev = p;
p->next = page;
} }
else else
{ {
hlpfile->first_page = page; hlpfile->first_page = page;
hlpfile->last_page = page;
page->prev = NULL; page->prev = NULL;
} }
...@@ -889,9 +888,8 @@ static BOOL HLPFILE_AddParagraph(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigne ...@@ -889,9 +888,8 @@ static BOOL HLPFILE_AddParagraph(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigne
unsigned short bits; unsigned short bits;
unsigned nc, ncol = 1; unsigned nc, ncol = 1;
if (!hlpfile->first_page) {WINE_WARN("no page\n"); return FALSE;}; if (!hlpfile->last_page) {WINE_WARN("no page\n"); return FALSE;};
page = hlpfile->last_page;
for (page = hlpfile->first_page; page->next; page = page->next) /* Nothing */;
for (paragraphptr = &page->first_paragraph; *paragraphptr; for (paragraphptr = &page->first_paragraph; *paragraphptr;
paragraphptr = &(*paragraphptr)->next) /* Nothing */; paragraphptr = &(*paragraphptr)->next) /* Nothing */;
......
...@@ -122,6 +122,7 @@ typedef struct tagHlpFileFile ...@@ -122,6 +122,7 @@ typedef struct tagHlpFileFile
LPSTR lpszTitle; LPSTR lpszTitle;
LPSTR lpszCopyright; LPSTR lpszCopyright;
HLPFILE_PAGE* first_page; HLPFILE_PAGE* first_page;
HLPFILE_PAGE* last_page;
HLPFILE_MACRO* first_macro; HLPFILE_MACRO* first_macro;
BYTE* Context; BYTE* Context;
BYTE* kwbtree; BYTE* kwbtree;
......
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