--- psiconv/trunk/lib/psiconv/parse_layout.c 2000/12/22 22:31:50 71 +++ psiconv/trunk/lib/psiconv/parse_layout.c 2002/01/29 18:47:26 143 @@ -26,6 +26,11 @@ #include "parse_routines.h" #include "error.h" +#ifdef DMALLOC +#include +#endif + + int psiconv_parse_color(const psiconv_buffer buf, int lev, psiconv_u32 off, int *length, psiconv_color *result) { @@ -165,6 +170,8 @@ (*result)->thickness = psiconv_read_size(buf,lev+2,off+len,&leng,&res); if (res) goto ERROR2; +#if 0 + /* This seems no longer necessary to test? */ if (((*result)->kind != psiconv_border_solid) && ((*result)->kind != psiconv_border_double) && ((*result)->thickness != 0.0) && @@ -172,6 +179,7 @@ psiconv_warn(lev+2,off, "Border thickness specified for unlikely border type"); } +#endif psiconv_debug(lev+2,off+len,"Thickness: %f",(*result)->thickness); len += leng; @@ -181,14 +189,14 @@ len += leng; psiconv_progress(lev+2,off+len,"Going to read the final unknown byte " - "(0x01 expected)"); + "(0x00 or 0x01 expected)"); temp = psiconv_read_u8(buf,lev+2,off + len,&res); if (res) goto ERROR3; - if (temp != 0x01) { + if ((temp != 0x01) && (temp != 0x00)) { psiconv_warn(lev+2,off,"Unknown last byte in border specification"); - psiconv_debug(lev+2,off+len, "Last byte: read %02x, expected %02x", - temp,0x01); + psiconv_debug(lev+2,off+len, "Last byte: read %02x, expected %02x or %02x", + temp,0x00,0x01); } len ++; @@ -448,6 +456,7 @@ } psiconv_debug(lev+3,off+len,"Justify: %02x",temp); len ++; + break; case 0x07: psiconv_progress(lev+3,off+len,"Going to read linespacing distance"); result->linespacing = psiconv_read_size(buf,lev+3,off+len,&leng,&res); @@ -504,6 +513,13 @@ goto ERROR1; len += leng; break; + case 0x0f: + psiconv_progress(lev+3,off+len,"Going to read wrap to fit cell limits"); + if ((res = psiconv_parse_bool(buf,lev+3,off+len,&leng, + &result->wrap_to_fit_cell))) + goto ERROR1; + len += leng; + break; case 0x10: psiconv_progress(lev+3,off+len,"Going to read border distance to text"); result->border_distance = psiconv_read_length(buf,lev+3, @@ -568,6 +584,7 @@ psiconv_free_tab(temp_tab); goto ERROR1; } + psiconv_free_tab(temp_tab); len += leng; break; default: @@ -640,6 +657,10 @@ psiconv_debug(lev+3,off+len,"Id: %02x",id); len ++; switch(id) { + case 0x18: + psiconv_progress(lev+3,off+len,"Going to skip an unknown setting"); + len ++; + break; case 0x19: psiconv_progress(lev+3,off+len,"Going to read text color"); if ((res = psiconv_parse_color(buf,lev+3,off+len, &leng,&temp_color))) @@ -656,6 +677,10 @@ result->back_color = temp_color; len += leng; break; + case 0x1b: + psiconv_progress(lev+3,off+len,"Going to skip an unknown setting"); + len ++; + break; case 0x1c: psiconv_progress(lev+3,off+len,"Going to read font size"); result->font_size = psiconv_read_size(buf,lev+3,off+len,&leng,&res); @@ -715,6 +740,10 @@ result->font = temp_font; len += leng; break; + case 0x23: + psiconv_progress(lev+3,off+len,"Going to skip an unknown setting"); + len ++; + break; case 0x24: psiconv_progress(lev+3,off+len, "Going to read unknown code 0x24 (%02x expected)", 0);