[PATCH 35/45] [WinHelp]: fix the loading of a row in a table (especially, for multiple paragraphs in a single cell)
Eric Pouech
eric.pouech at orange.fr
Sun Mar 23 04:20:52 CDT 2008
A+
---
programs/winhelp/hlpfile.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/programs/winhelp/hlpfile.c b/programs/winhelp/hlpfile.c
index 19549f2..af10b6a 100644
--- a/programs/winhelp/hlpfile.c
+++ b/programs/winhelp/hlpfile.c
@@ -944,6 +944,7 @@ BOOL HLPFILE_BrowseParagraph(HLPFILE *hlpfile, struct RtfData* rd, BYTE *buf, BY
unsigned nc, ncol = 1;
char tmp[256];
BOOL ret = FALSE;
+ BOOL in_table = FALSE;
if (buf + 0x19 > end) {WINE_WARN("header too small\n"); return FALSE;};
@@ -981,6 +982,7 @@ BOOL HLPFILE_BrowseParagraph(HLPFILE *hlpfile, struct RtfData* rd, BYTE *buf, BY
{
char type;
+ in_table = TRUE;
ncol = *format++;
WINE_TRACE("#cols %u\n", ncol);
@@ -990,15 +992,17 @@ BOOL HLPFILE_BrowseParagraph(HLPFILE *hlpfile, struct RtfData* rd, BYTE *buf, BY
format += ncol * 4;
}
- for (nc = 0; nc < ncol; nc++)
+ for (nc = 0; nc < ncol; /**/)
{
- WINE_TRACE("looking for format at offset %u for column %d\n", format - (buf + 0x15), nc);
- if (buf[0x14] == 0x23)
+ WINE_TRACE("looking for format at offset %u in column %d\n", format - (buf + 0x15), nc);
+ if (in_table)
+ {
+ nc = GET_SHORT(format, 0);
+ if (nc == -1) break;
format += 5;
- if (buf[0x14] == 0x01)
- format += 6;
- else
- format += 4;
+ }
+ else nc++;
+ format += 4;
bits = GET_USHORT(format, 0); format += 2;
if (bits & 0x0001) fetch_long(&format);
if (bits & 0x0002)
More information about the wine-patches
mailing list