/[public]/psiconv/trunk/lib/psiconv/parse_layout.c
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/parse_layout.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 71 Revision 104
163 163
164 psiconv_progress(lev+2,off+len,"Going to read border thickness"); 164 psiconv_progress(lev+2,off+len,"Going to read border thickness");
165 (*result)->thickness = psiconv_read_size(buf,lev+2,off+len,&leng,&res); 165 (*result)->thickness = psiconv_read_size(buf,lev+2,off+len,&leng,&res);
166 if (res) 166 if (res)
167 goto ERROR2; 167 goto ERROR2;
168#if 0
169 /* This seems no longer necessary to test? */
168 if (((*result)->kind != psiconv_border_solid) && 170 if (((*result)->kind != psiconv_border_solid) &&
169 ((*result)->kind != psiconv_border_double) && 171 ((*result)->kind != psiconv_border_double) &&
170 ((*result)->thickness != 0.0) && 172 ((*result)->thickness != 0.0) &&
171 (fabs((*result)->thickness - 1/20) >= 1/1000)) { 173 (fabs((*result)->thickness - 1/20) >= 1/1000)) {
172 psiconv_warn(lev+2,off, 174 psiconv_warn(lev+2,off,
173 "Border thickness specified for unlikely border type"); 175 "Border thickness specified for unlikely border type");
174 } 176 }
177#endif
175 psiconv_debug(lev+2,off+len,"Thickness: %f",(*result)->thickness); 178 psiconv_debug(lev+2,off+len,"Thickness: %f",(*result)->thickness);
176 len += leng; 179 len += leng;
177 180
178 psiconv_progress(lev+2,off+len,"Going to read the border color"); 181 psiconv_progress(lev+2,off+len,"Going to read the border color");
179 if ((psiconv_parse_color(buf,lev+2,off+len,&leng,&(*result)->color))) 182 if ((psiconv_parse_color(buf,lev+2,off+len,&leng,&(*result)->color)))
180 goto ERROR2; 183 goto ERROR2;
181 len += leng; 184 len += leng;
182 185
183 psiconv_progress(lev+2,off+len,"Going to read the final unknown byte " 186 psiconv_progress(lev+2,off+len,"Going to read the final unknown byte "
184 "(0x01 expected)"); 187 "(0x00 or 0x01 expected)");
185 temp = psiconv_read_u8(buf,lev+2,off + len,&res); 188 temp = psiconv_read_u8(buf,lev+2,off + len,&res);
186 if (res) 189 if (res)
187 goto ERROR3; 190 goto ERROR3;
188 if (temp != 0x01) { 191 if ((temp != 0x01) && (temp != 0x00)) {
189 psiconv_warn(lev+2,off,"Unknown last byte in border specification"); 192 psiconv_warn(lev+2,off,"Unknown last byte in border specification");
190 psiconv_debug(lev+2,off+len, "Last byte: read %02x, expected %02x", 193 psiconv_debug(lev+2,off+len, "Last byte: read %02x, expected %02x or %02x",
191 temp,0x01); 194 temp,0x00,0x01);
192 } 195 }
193 len ++; 196 len ++;
194 197
195 if (length) 198 if (length)
196 *length = len; 199 *length = len;
502 if ((res = psiconv_parse_bool(buf,lev+3,off+len,&leng, 505 if ((res = psiconv_parse_bool(buf,lev+3,off+len,&leng,
503 &result->no_widow_protection))) 506 &result->no_widow_protection)))
504 goto ERROR1; 507 goto ERROR1;
505 len += leng; 508 len += leng;
506 break; 509 break;
510 case 0x0f:
511 psiconv_progress(lev+3,off+len,"Going to read wrap to fit cell limits");
512 if ((res = psiconv_parse_bool(buf,lev+3,off+len,&leng,
513 &result->wrap_to_fit_cell)))
514 goto ERROR1;
515 len += leng;
516 break;
507 case 0x10: 517 case 0x10:
508 psiconv_progress(lev+3,off+len,"Going to read border distance to text"); 518 psiconv_progress(lev+3,off+len,"Going to read border distance to text");
509 result->border_distance = psiconv_read_length(buf,lev+3, 519 result->border_distance = psiconv_read_length(buf,lev+3,
510 off+len,&leng,&res); 520 off+len,&leng,&res);
511 if (res) 521 if (res)
638 if (res) 648 if (res)
639 goto ERROR1; 649 goto ERROR1;
640 psiconv_debug(lev+3,off+len,"Id: %02x",id); 650 psiconv_debug(lev+3,off+len,"Id: %02x",id);
641 len ++; 651 len ++;
642 switch(id) { 652 switch(id) {
653 case 0x18:
654 psiconv_progress(lev+3,off+len,"Going to skip an unknown setting");
655 len ++;
656 break;
643 case 0x19: 657 case 0x19:
644 psiconv_progress(lev+3,off+len,"Going to read text color"); 658 psiconv_progress(lev+3,off+len,"Going to read text color");
645 if ((res = psiconv_parse_color(buf,lev+3,off+len, &leng,&temp_color))) 659 if ((res = psiconv_parse_color(buf,lev+3,off+len, &leng,&temp_color)))
646 goto ERROR1; 660 goto ERROR1;
647 psiconv_free_color(result->color); 661 psiconv_free_color(result->color);
653 if ((res = psiconv_parse_color(buf,lev+2,off+len, &leng,&temp_color))) 667 if ((res = psiconv_parse_color(buf,lev+2,off+len, &leng,&temp_color)))
654 goto ERROR1; 668 goto ERROR1;
655 psiconv_free_color(result->back_color); 669 psiconv_free_color(result->back_color);
656 result->back_color = temp_color; 670 result->back_color = temp_color;
657 len += leng; 671 len += leng;
672 break;
673 case 0x1b:
674 psiconv_progress(lev+3,off+len,"Going to skip an unknown setting");
675 len ++;
658 break; 676 break;
659 case 0x1c: 677 case 0x1c:
660 psiconv_progress(lev+3,off+len,"Going to read font size"); 678 psiconv_progress(lev+3,off+len,"Going to read font size");
661 result->font_size = psiconv_read_size(buf,lev+3,off+len,&leng,&res); 679 result->font_size = psiconv_read_size(buf,lev+3,off+len,&leng,&res);
662 if (res) 680 if (res)
713 goto ERROR1; 731 goto ERROR1;
714 psiconv_free_font(result->font); 732 psiconv_free_font(result->font);
715 result->font = temp_font; 733 result->font = temp_font;
716 len += leng; 734 len += leng;
717 break; 735 break;
736 case 0x23:
737 psiconv_progress(lev+3,off+len,"Going to skip an unknown setting");
738 len ++;
739 break;
718 case 0x24: 740 case 0x24:
719 psiconv_progress(lev+3,off+len, 741 psiconv_progress(lev+3,off+len,
720 "Going to read unknown code 0x24 (%02x expected)", 0); 742 "Going to read unknown code 0x24 (%02x expected)", 0);
721 temp = psiconv_read_u8(buf,lev+3,off+len,&res); 743 temp = psiconv_read_u8(buf,lev+3,off+len,&res);
722 if (res) 744 if (res)

Legend:
Removed from v.71  
changed lines
  Added in v.104

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26