… | |
… | |
672 | psiconv_u32 off, int *length, |
672 | psiconv_u32 off, int *length, |
673 | psiconv_sheet_info_section *result) |
673 | psiconv_sheet_info_section *result) |
674 | { |
674 | { |
675 | int res=0; |
675 | int res=0; |
676 | psiconv_u32 temp; |
676 | psiconv_u32 temp; |
677 | int len=0; |
677 | int len=0,leng; |
678 | |
678 | |
679 | 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"); |
680 | if (!(*result = malloc(sizeof(**result)))) |
680 | if (!(*result = malloc(sizeof(**result)))) |
681 | goto ERROR1; |
681 | goto ERROR1; |
682 | |
682 | |
… | |
… | |
689 | psiconv_warn(lev+2,off+len, |
689 | psiconv_warn(lev+2,off+len, |
690 | "Sheet info section initial byte unknown value (ignored)"); |
690 | "Sheet info section initial byte unknown value (ignored)"); |
691 | psiconv_debug(lev+2,off+len,"Initial byte: %02x",temp); |
691 | psiconv_debug(lev+2,off+len,"Initial byte: %02x",temp); |
692 | } |
692 | } |
693 | 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; |
694 | |
701 | |
695 | 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"); |
696 | temp = psiconv_read_u8(buf,lev+2,off+len,&res); |
703 | temp = psiconv_read_u8(buf,lev+2,off+len,&res); |
697 | if (res) |
704 | if (res) |
698 | goto ERROR2; |
705 | goto ERROR2; |
… | |
… | |
1204 | int psiconv_parse_sheet_worksheet(const psiconv_buffer buf, int lev, |
1211 | int psiconv_parse_sheet_worksheet(const psiconv_buffer buf, int lev, |
1205 | psiconv_u32 off, int *length, |
1212 | psiconv_u32 off, int *length, |
1206 | psiconv_sheet_worksheet *result) |
1213 | psiconv_sheet_worksheet *result) |
1207 | { |
1214 | { |
1208 | int res=0; |
1215 | int res=0; |
1209 | 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; |
1210 | int len=0; |
1217 | int len=0; |
1211 | int leng; |
1218 | int leng; |
1212 | |
1219 | |
1213 | 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"); |
1214 | if (!(*result = malloc(sizeof(**result)))) |
1221 | if (!(*result = malloc(sizeof(**result)))) |
… | |
… | |
1278 | psiconv_debug(lev+2,off+len,"Offset: %04x",grid_off); |
1285 | psiconv_debug(lev+2,off+len,"Offset: %04x",grid_off); |
1279 | len += 4; |
1286 | len += 4; |
1280 | |
1287 | |
1281 | psiconv_progress(lev+2,off+len, |
1288 | psiconv_progress(lev+2,off+len, |
1282 | "Going to read the offset of the 3rd ??? Section"); |
1289 | "Going to read the offset of the 3rd ??? Section"); |
1283 | temp = psiconv_read_u32(buf,lev+2,off+len,&res); |
1290 | unknown_off = psiconv_read_u32(buf,lev+2,off+len,&res); |
1284 | if (res) |
1291 | if (res) |
1285 | 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)"); |
1286 | psiconv_debug(lev+2,off+len,"Offset: %04x",temp); |
1305 | psiconv_debug(lev+2,unknown_off,"Offset: %04x",temp); |
|
|
1306 | } |
1287 | len += 4; |
1307 | len += 4; |
1288 | |
1308 | |
1289 | 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"); |
1290 | 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, |
1291 | &(*result)->row_default_layouts, |
1311 | &(*result)->row_default_layouts, |