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

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

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

Revision 129 Revision 133
506 psiconv_progress(lev+1,off,"Going to read the sheet workbook section"); 506 psiconv_progress(lev+1,off,"Going to read the sheet workbook section");
507 if (!(*result = malloc(sizeof(**result)))) 507 if (!(*result = malloc(sizeof(**result))))
508 goto ERROR1; 508 goto ERROR1;
509 509
510 psiconv_progress(lev+2,off+len, 510 psiconv_progress(lev+2,off+len,
511 "Going to read the initial byte (%02x or $02xexpected)", 511 "Going to read the initial byte (%02x or %02x expected)",
512 0x02,0x04); 512 0x02,0x04);
513 temp = psiconv_read_u8(buf,lev+2,off+len,&res); 513 temp = psiconv_read_u8(buf,lev+2,off+len,&res);
514 if (res) 514 if (res)
515 goto ERROR2; 515 goto ERROR2;
516 if ((temp != 0x04) && temp !=0x02) { 516 if ((temp != 0x04) && temp !=0x02) {
584 NULL,&(*result)->worksheets))) 584 NULL,&(*result)->worksheets)))
585 goto ERROR5; 585 goto ERROR5;
586 586
587 if (with_name) { 587 if (with_name) {
588 psiconv_progress(lev+2,off+len,"Going to read the name section"); 588 psiconv_progress(lev+2,off+len,"Going to read the name section");
589
590 if ((res = psiconv_parse_sheet_name_section(buf,lev+2,name_off,NULL, 589 if ((res = psiconv_parse_sheet_name_section(buf,lev+2,name_off,NULL,
591 &(*result)->name))) 590 &(*result)->name)))
592 goto ERROR6; 591 goto ERROR6;
593 } else 592 } else
594 (*result)->name = NULL; 593 (*result)->name = NULL;
673 psiconv_u32 off, int *length, 672 psiconv_u32 off, int *length,
674 psiconv_sheet_info_section *result) 673 psiconv_sheet_info_section *result)
675{ 674{
676 int res=0; 675 int res=0;
677 psiconv_u32 temp; 676 psiconv_u32 temp;
678 int len=0; 677 int len=0,leng;
679 678
680 psiconv_progress(lev+1,off,"Going to read the sheet info section"); 679 psiconv_progress(lev+1,off,"Going to read the sheet info section");
681 if (!(*result = malloc(sizeof(**result)))) 680 if (!(*result = malloc(sizeof(**result))))
682 goto ERROR1; 681 goto ERROR1;
683 682
690 psiconv_warn(lev+2,off+len, 689 psiconv_warn(lev+2,off+len,
691 "Sheet info section initial byte unknown value (ignored)"); 690 "Sheet info section initial byte unknown value (ignored)");
692 psiconv_debug(lev+2,off+len,"Initial byte: %02x",temp); 691 psiconv_debug(lev+2,off+len,"Initial byte: %02x",temp);
693 } 692 }
694 len ++; 693 len ++;
694
695 psiconv_progress(lev+2,off+len, "Going to read an unknown Xint");
696 temp = psiconv_read_X(buf,lev+2,off+len,&leng,&res);
697 if (res)
698 goto ERROR2;
699 psiconv_debug(lev+2,off+len,"Value: %d\n",temp);
700 len += leng;
695 701
696 psiconv_progress(lev+2,off+len, "Going to read the flags byte"); 702 psiconv_progress(lev+2,off+len, "Going to read the flags byte");
697 temp = psiconv_read_u8(buf,lev+2,off+len,&res); 703 temp = psiconv_read_u8(buf,lev+2,off+len,&res);
698 if (res) 704 if (res)
699 goto ERROR2; 705 goto ERROR2;
1205int psiconv_parse_sheet_worksheet(const psiconv_buffer buf, int lev, 1211int psiconv_parse_sheet_worksheet(const psiconv_buffer buf, int lev,
1206 psiconv_u32 off, int *length, 1212 psiconv_u32 off, int *length,
1207 psiconv_sheet_worksheet *result) 1213 psiconv_sheet_worksheet *result)
1208{ 1214{
1209 int res=0; 1215 int res=0;
1210 psiconv_u32 temp,cells_off,grid_off,rows_off,cols_off; 1216 psiconv_u32 temp,cells_off,grid_off,rows_off,cols_off,unknown_off;
1211 int len=0; 1217 int len=0;
1212 int leng; 1218 int leng;
1213 1219
1214 psiconv_progress(lev+1,off,"Going to read the sheet worksheet section"); 1220 psiconv_progress(lev+1,off,"Going to read the sheet worksheet section");
1215 if (!(*result = malloc(sizeof(**result)))) 1221 if (!(*result = malloc(sizeof(**result))))
1279 psiconv_debug(lev+2,off+len,"Offset: %04x",grid_off); 1285 psiconv_debug(lev+2,off+len,"Offset: %04x",grid_off);
1280 len += 4; 1286 len += 4;
1281 1287
1282 psiconv_progress(lev+2,off+len, 1288 psiconv_progress(lev+2,off+len,
1283 "Going to read the offset of the 3rd ??? Section"); 1289 "Going to read the offset of the 3rd ??? Section");
1284 temp = psiconv_read_u32(buf,lev+2,off+len,&res); 1290 unknown_off = psiconv_read_u32(buf,lev+2,off+len,&res);
1285 if (res) 1291 if (res)
1286 goto ERROR3; 1292 goto ERROR3;
1293 psiconv_debug(lev+2,off+len,"Offset: %04x",unknown_off);
1294 len += 4;
1295
1296 psiconv_progress(lev+2,off+len,
1297 "Going to read a long of the 3rd ??? Section "
1298 "(%08x expected)",0x00);
1299 temp = psiconv_read_u32(buf,lev+2,unknown_off,&res);
1300 if (res)
1301 goto ERROR3;
1302 if (temp != 0x00) {
1303 psiconv_warn(lev+2,unknown_off,
1304 "Unknown worksheet subsection has unknown contents (ignored)");
1287 psiconv_debug(lev+2,off+len,"Offset: %04x",temp); 1305 psiconv_debug(lev+2,unknown_off,"Offset: %04x",temp);
1306 }
1288 len += 4; 1307 len += 4;
1289 1308
1290 psiconv_progress(lev+2,off+len,"Going to read the row defaults"); 1309 psiconv_progress(lev+2,off+len,"Going to read the row defaults");
1291 if ((res = psiconv_parse_sheet_line_list(buf,lev+2,rows_off,NULL, 1310 if ((res = psiconv_parse_sheet_line_list(buf,lev+2,rows_off,NULL,
1292 &(*result)->row_default_layouts, 1311 &(*result)->row_default_layouts,

Legend:
Removed from v.129  
changed lines
  Added in v.133

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