--- psiconv/trunk/lib/psiconv/parse_layout.c 2000/12/15 01:16:43 65 +++ psiconv/trunk/lib/psiconv/parse_layout.c 2000/12/28 00:24:58 84 @@ -18,11 +18,13 @@ */ #include "config.h" +#include "compat.h" + #include #include -#include "data.h" #include "parse_routines.h" +#include "error.h" int psiconv_parse_color(const psiconv_buffer buf, int lev, psiconv_u32 off, int *length, psiconv_color *result) @@ -147,11 +149,11 @@ else if (temp == 0x03) (*result)->kind = psiconv_border_dotted; else if (temp == 0x04) - (*result)->kind = psiconv_border_striped; + (*result)->kind = psiconv_border_dashed; else if (temp == 0x05) - (*result)->kind = psiconv_border_dotstripe; + (*result)->kind = psiconv_border_dotdashed; else if (temp == 0x06) - (*result)->kind = psiconv_border_dotdotstripe; + (*result)->kind = psiconv_border_dotdotdashed; else { psiconv_warn(lev+2,off,"Unknown border kind (defaults to `none')"); (*result)->kind = psiconv_border_none; @@ -163,6 +165,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) && @@ -170,6 +174,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; @@ -179,14 +184,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 ++; @@ -447,29 +452,29 @@ psiconv_debug(lev+3,off+len,"Justify: %02x",temp); len ++; case 0x07: - psiconv_progress(lev+3,off+len,"Going to read interline distance"); - result->interline = psiconv_read_size(buf,lev+3,off+len,&leng,&res); + psiconv_progress(lev+3,off+len,"Going to read linespacing distance"); + result->linespacing = psiconv_read_size(buf,lev+3,off+len,&leng,&res); if (res) goto ERROR1; len += leng; break; case 0x08: - psiconv_progress(lev+3,off+len,"Going to read interline exact"); + psiconv_progress(lev+3,off+len,"Going to read linespacing exact"); if ((res = psiconv_parse_bool(buf,lev+3,off+len,&leng, - &result->interline_exact))) + &result->linespacing_exact))) goto ERROR1; len += leng; break; case 0x09: psiconv_progress(lev+3,off+len,"Going to read top space"); - result->top_space = psiconv_read_size(buf,lev+3,off+len,&leng,&res); + result->space_above = psiconv_read_size(buf,lev+3,off+len,&leng,&res); if (res) goto ERROR1; len += leng; break; case 0x0a: psiconv_progress(lev+3,off+len,"Going to read bottom space"); - result->bottom_space = psiconv_read_size(buf,lev+3,off+len,&leng,&res); + result->space_below = psiconv_read_size(buf,lev+3,off+len,&leng,&res); if (res) goto ERROR1; len += leng; @@ -477,14 +482,14 @@ case 0x0b: psiconv_progress(lev+3,off+len,"Going to read on one page"); if ((res = psiconv_parse_bool(buf,lev+3,off+len,&leng, - &result->on_one_page))) + &result->keep_together))) goto ERROR1; len += leng; break; case 0x0c: psiconv_progress(lev+3,off+len,"Going to read together with"); if ((res = psiconv_parse_bool(buf,lev+3,off+len,&leng, - &result->together_with))) + &result->keep_with_next))) goto ERROR1; len += leng; break; @@ -699,9 +704,9 @@ len += leng; break; case 0x21: - psiconv_progress(lev+3,off+len,"Going to read strike_out"); + psiconv_progress(lev+3,off+len,"Going to read strikethrough"); if ((res = psiconv_parse_bool(buf,lev+3,off+len,&leng, - &result->strike_out))) + &result->strikethrough))) goto ERROR1; len += leng; break;