--- psiconv/trunk/lib/psiconv/parse_common.c 2000/12/15 00:21:51 64 +++ psiconv/trunk/lib/psiconv/parse_common.c 2000/12/22 22:31:50 71 @@ -22,8 +22,8 @@ #include #include -#include "data.h" #include "parse_routines.h" +#include "error.h" static int psiconv_parse_layout_section(const psiconv_buffer buf, int lev,psiconv_u32 off, @@ -46,7 +46,7 @@ psiconv_progress(lev+2,off+len,"Going to read UID1 to UID3"); (*result)->uid1 = psiconv_read_u32(buf,lev+2,off+len,&res); - if (!res) + if (res) goto ERROR2; psiconv_debug(lev+2,off+len,"UID1: %08x",(*result)->uid1); if ((*result)->uid1 == PSICONV_ID_CLIPART) { @@ -273,7 +273,7 @@ goto ERROR2; text_len = psiconv_read_X(buf,lev+2,off,&leng,&res); - if (!res) + if (res) goto ERROR3; psiconv_debug(lev+2,off,"Length: %08x",text_len); len += leng; @@ -569,7 +569,7 @@ psiconv_progress(lev+4,off+len,"Going to read the paragraph length"); temp = psiconv_read_u32(buf,lev+4,off+len,&res); - if (!res) + if (res) goto ERROR4; if (temp != strlen(para->text)+1) { psiconv_warn(lev+4,off+len, @@ -583,7 +583,7 @@ psiconv_progress(lev+4,off+len,"Going to read the paragraph type"); temp = psiconv_read_u8(buf,lev+4,off+len,&res); - if (!res) + if (res) goto ERROR4; if (temp != 0x00) { psiconv_debug(lev+4,off+len,"Type: %02x",temp); @@ -665,7 +665,7 @@ para->base_style = temp; psiconv_progress(lev+4,off+len,"Going to read paragraph layout"); - if (!(psiconv_parse_paragraph_layout_list(buf,lev+4,off+len,&leng, + if ((res = psiconv_parse_paragraph_layout_list(buf,lev+4,off+len,&leng, para->base_paragraph))) goto ERROR4; len += leng; @@ -687,7 +687,7 @@ nr = psiconv_read_u32(buf,lev+3,off+len,&res); if (res) goto ERROR4; - psiconv_debug(lev+3,off,"Elements: %08x",nr); + psiconv_debug(lev+3,off+len,"Elements: %08x",nr); len += 0x04; psiconv_progress(lev+3,off+len, @@ -716,8 +716,8 @@ if (res) goto ERROR4; len += 1; - psiconv_debug(lev+4,off,"Type: %02x",temp); - psiconv_progress(lev+4,off, + psiconv_debug(lev+4,off+len,"Type: %02x",temp); + psiconv_progress(lev+4,off+len, "Going to read the number of characters it applies to"); in_line.length = psiconv_read_u32(buf,lev+4,len+off,&res); if (res) @@ -769,7 +769,7 @@ if (length) *length = len; - psiconv_progress(lev+1,off+len-1,"End of layout section (total length: %08x", + psiconv_progress(lev+1,off+len-1,"End of layout section (total length: %08x)", len); return 0;