/[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 183 Revision 184
131 131
132 psiconv_progress(config,lev,off+len-1, 132 psiconv_progress(config,lev,off+len-1,
133 "End of sheet column reference (total length: %08x)", len); 133 "End of sheet column reference (total length: %08x)", len);
134 return result; 134 return result;
135ERROR1: 135ERROR1:
136 psiconv_warn(config,lev+1,off,"Reading of Sheet Column Reference failed"); 136 psiconv_error(config,lev+1,off,"Reading of Sheet Column Reference failed");
137 if (length) 137 if (length)
138 *length = 0; 138 *length = 0;
139 if (status) 139 if (status)
140 *status = res?res:-PSICONV_E_NOMEM; 140 *status = res?res:-PSICONV_E_NOMEM;
141 return result; 141 return result;
215 psiconv_progress(config,lev,off+len-1, 215 psiconv_progress(config,lev,off+len-1,
216 "End of sheet cell block reference (total length: %08x)", 216 "End of sheet cell block reference (total length: %08x)",
217 len); 217 len);
218 return result; 218 return result;
219ERROR1: 219ERROR1:
220 psiconv_warn(config,lev+1,off,"Reading of Sheet Cell Block Reference failed"); 220 psiconv_error(config,lev+1,off,"Reading of Sheet Cell Block Reference failed");
221 if (length) 221 if (length)
222 *length = 0; 222 *length = 0;
223 if (status) 223 if (status)
224 *status = res?res:-PSICONV_E_NOMEM; 224 *status = res?res:-PSICONV_E_NOMEM;
225 return result; 225 return result;
334 psiconv_progress(config,lev,off+len-1, 334 psiconv_progress(config,lev,off+len-1,
335 "End of sheet number format (total length: %08x)", len); 335 "End of sheet number format (total length: %08x)", len);
336 return 0; 336 return 0;
337 337
338ERROR1: 338ERROR1:
339 psiconv_warn(config,lev+1,off,"Reading of Sheet Number Format failed"); 339 psiconv_error(config,lev+1,off,"Reading of Sheet Number Format failed");
340 if (length) 340 if (length)
341 *length = 0; 341 *length = 0;
342 if (!res) 342 if (!res)
343 return -PSICONV_E_NOMEM; 343 return -PSICONV_E_NOMEM;
344 else 344 else
492 return 0; 492 return 0;
493 493
494ERROR2: 494ERROR2:
495 free (*result); 495 free (*result);
496ERROR1: 496ERROR1:
497 psiconv_warn(config,lev+1,off,"Reading of Sheet Status Section failed"); 497 psiconv_error(config,lev+1,off,"Reading of Sheet Status Section failed");
498 if (length) 498 if (length)
499 *length = 0; 499 *length = 0;
500 if (!res) 500 if (!res)
501 return -PSICONV_E_NOMEM; 501 return -PSICONV_E_NOMEM;
502 else 502 else
617ERROR3: 617ERROR3:
618 psiconv_free_sheet_info_section((*result)->info); 618 psiconv_free_sheet_info_section((*result)->info);
619ERROR2: 619ERROR2:
620 free (*result); 620 free (*result);
621ERROR1: 621ERROR1:
622 psiconv_warn(config,lev+1,off,"Reading of Sheet Workbook Section failed"); 622 psiconv_error(config,lev+1,off,"Reading of Sheet Workbook Section failed");
623 if (length) 623 if (length)
624 *length = 0; 624 *length = 0;
625 if (!res) 625 if (!res)
626 return -PSICONV_E_NOMEM; 626 return -PSICONV_E_NOMEM;
627 else 627 else
667 return 0; 667 return 0;
668 668
669ERROR2: 669ERROR2:
670 free(*result); 670 free(*result);
671ERROR1: 671ERROR1:
672 psiconv_warn(config,lev+1,off,"Reading of Sheet Name Section failed"); 672 psiconv_error(config,lev+1,off,"Reading of Sheet Name Section failed");
673 if (length) 673 if (length)
674 *length = 0; 674 *length = 0;
675 if (!res) 675 if (!res)
676 return -PSICONV_E_NOMEM; 676 return -PSICONV_E_NOMEM;
677 else 677 else
734 return 0; 734 return 0;
735 735
736ERROR2: 736ERROR2:
737 free(*result); 737 free(*result);
738ERROR1: 738ERROR1:
739 psiconv_warn(config,lev+1,off,"Reading of Sheet Name Section failed"); 739 psiconv_error(config,lev+1,off,"Reading of Sheet Name Section failed");
740 if (length) 740 if (length)
741 *length = 0; 741 *length = 0;
742 if (!res) 742 if (!res)
743 return -PSICONV_E_NOMEM; 743 return -PSICONV_E_NOMEM;
744 else 744 else
802ERROR3: 802ERROR3:
803 psiconv_free_formula(formula); 803 psiconv_free_formula(formula);
804ERROR2: 804ERROR2:
805 psiconv_list_free(*result); 805 psiconv_list_free(*result);
806ERROR1: 806ERROR1:
807 psiconv_warn(config,lev+1,off,"Reading of Sheet Formula list failed"); 807 psiconv_error(config,lev+1,off,"Reading of Sheet Formula list failed");
808 if (length) 808 if (length)
809 *length = 0; 809 *length = 0;
810 if (!res) 810 if (!res)
811 return -PSICONV_E_NOMEM; 811 return -PSICONV_E_NOMEM;
812 else 812 else
926 psiconv_progress(config,lev+2,off+len,"Going to read a string"); 926 psiconv_progress(config,lev+2,off+len,"Going to read a string");
927 (*result)->data.dat_string = 927 (*result)->data.dat_string =
928 psiconv_read_string(config,buf,lev+2,off+len,&leng,&res); 928 psiconv_read_string(config,buf,lev+2,off+len,&leng,&res);
929 if (res) 929 if (res)
930 goto ERROR2; 930 goto ERROR2;
931 if (!(auxstr = psiconv_make_printable((*result)->data.dat_string))) 931 if (!(auxstr = psiconv_make_printable(config,(*result)->data.dat_string)))
932 goto ERROR2; 932 goto ERROR2;
933 psiconv_debug(config,lev+2,off+len,"Cell contents: `%s'",auxstr); 933 psiconv_debug(config,lev+2,off+len,"Cell contents: `%s'",auxstr);
934 free(auxstr); 934 free(auxstr);
935 len += leng; 935 len += leng;
936 } else { 936 } else {
937 psiconv_warn(config,lev+2,off+len,"Unknown Sheet Cell type: %02x",(*result)->type); 937 psiconv_error(config,lev+2,off+len,"Unknown Sheet Cell type: %02x",(*result)->type);
938 res = PSICONV_E_PARSE; 938 res = PSICONV_E_PARSE;
939 goto ERROR2; 939 goto ERROR2;
940 } 940 }
941 941
942 if (!((*result)->layout = psiconv_clone_cell_layout( 942 if (!((*result)->layout = psiconv_clone_cell_layout(
1056ERROR3: 1056ERROR3:
1057 psiconv_free_sheet_cell(cell); 1057 psiconv_free_sheet_cell(cell);
1058ERROR2: 1058ERROR2:
1059 psiconv_free_sheet_cell_list(*result); 1059 psiconv_free_sheet_cell_list(*result);
1060ERROR1: 1060ERROR1:
1061 psiconv_warn(config,lev+1,off,"Reading of Sheet Cells List failed"); 1061 psiconv_error(config,lev+1,off,"Reading of Sheet Cells List failed");
1062 if (length) 1062 if (length)
1063 *length = 0; 1063 *length = 0;
1064 if (!res) 1064 if (!res)
1065 return -PSICONV_E_NOMEM; 1065 return -PSICONV_E_NOMEM;
1066 else 1066 else
1144ERROR3: 1144ERROR3:
1145 psiconv_free_sheet_worksheet(worksheet); 1145 psiconv_free_sheet_worksheet(worksheet);
1146ERROR2: 1146ERROR2:
1147 psiconv_free_sheet_worksheet_list(*result); 1147 psiconv_free_sheet_worksheet_list(*result);
1148ERROR1: 1148ERROR1:
1149 psiconv_warn(config,lev+1,off,"Reading of worksheet list failed"); 1149 psiconv_error(config,lev+1,off,"Reading of worksheet list failed");
1150 if (length) 1150 if (length)
1151 *length = 0; 1151 *length = 0;
1152 if (!res) 1152 if (!res)
1153 return -PSICONV_E_NOMEM; 1153 return -PSICONV_E_NOMEM;
1154 else 1154 else
1216 "End of sheet cell layout (total length: %08x)", len); 1216 "End of sheet cell layout (total length: %08x)", len);
1217 1217
1218 return 0; 1218 return 0;
1219 1219
1220ERROR1: 1220ERROR1:
1221 psiconv_warn(config,lev+1,off,"Reading of sheet cell layout failed"); 1221 psiconv_error(config,lev+1,off,"Reading of sheet cell layout failed");
1222 if (length) 1222 if (length)
1223 *length = 0; 1223 *length = 0;
1224 if (!res) 1224 if (!res)
1225 return -PSICONV_E_NOMEM; 1225 return -PSICONV_E_NOMEM;
1226 else 1226 else
1371ERROR3: 1371ERROR3:
1372 psiconv_free_sheet_cell_layout((*result)->default_layout); 1372 psiconv_free_sheet_cell_layout((*result)->default_layout);
1373ERROR2: 1373ERROR2:
1374 free (*result); 1374 free (*result);
1375ERROR1: 1375ERROR1:
1376 psiconv_warn(config,lev+1,off,"Reading of Sheet Worksheet Section failed"); 1376 psiconv_error(config,lev+1,off,"Reading of Sheet Worksheet Section failed");
1377 if (length) 1377 if (length)
1378 *length = 0; 1378 *length = 0;
1379 if (!res) 1379 if (!res)
1380 return -PSICONV_E_NOMEM; 1380 return -PSICONV_E_NOMEM;
1381 else 1381 else
1421ERROR3: 1421ERROR3:
1422 psiconv_free_sheet_cell_layout((*result)->layout); 1422 psiconv_free_sheet_cell_layout((*result)->layout);
1423ERROR2: 1423ERROR2:
1424 free (*result); 1424 free (*result);
1425ERROR1: 1425ERROR1:
1426 psiconv_warn(config,lev+1,off,"Reading of the sheet line failed"); 1426 psiconv_error(config,lev+1,off,"Reading of the sheet line failed");
1427 if (length) 1427 if (length)
1428 *length = 0; 1428 *length = 0;
1429 if (!res) 1429 if (!res)
1430 return -PSICONV_E_NOMEM; 1430 return -PSICONV_E_NOMEM;
1431 else 1431 else
1492ERROR3: 1492ERROR3:
1493 psiconv_free_sheet_line(line); 1493 psiconv_free_sheet_line(line);
1494ERROR2: 1494ERROR2:
1495 psiconv_free_sheet_line_list(*result); 1495 psiconv_free_sheet_line_list(*result);
1496ERROR1: 1496ERROR1:
1497 psiconv_warn(config,lev+1,off,"Reading of Sheet Line List failed"); 1497 psiconv_error(config,lev+1,off,"Reading of Sheet Line List failed");
1498 if (length) 1498 if (length)
1499 *length = 0; 1499 *length = 0;
1500 if (!res) 1500 if (!res)
1501 return -PSICONV_E_NOMEM; 1501 return -PSICONV_E_NOMEM;
1502 else 1502 else
1571 &leng, &res); 1571 &leng, &res);
1572 if (res) 1572 if (res)
1573 goto ERROR3; 1573 goto ERROR3;
1574 len += leng; 1574 len += leng;
1575 } else { 1575 } else {
1576 psiconv_warn(config,lev+2,off+len,"Sheet variable unknown type marker"); 1576 psiconv_error(config,lev+2,off+len,"Sheet variable unknown type marker");
1577 res = -PSICONV_E_PARSE; 1577 res = -PSICONV_E_PARSE;
1578 goto ERROR3; 1578 goto ERROR3;
1579 } 1579 }
1580 1580
1581 psiconv_progress(config,lev+2,off+len,"Going to read the variable number"); 1581 psiconv_progress(config,lev+2,off+len,"Going to read the variable number");
1598ERROR3: 1598ERROR3:
1599 free((*result)->name); 1599 free((*result)->name);
1600ERROR2: 1600ERROR2:
1601 free (*result); 1601 free (*result);
1602ERROR1: 1602ERROR1:
1603 psiconv_warn(config,lev+1,off,"Reading of Sheet Variable failed"); 1603 psiconv_error(config,lev+1,off,"Reading of Sheet Variable failed");
1604 if (length) 1604 if (length)
1605 *length = 0; 1605 *length = 0;
1606 if (!res) 1606 if (!res)
1607 return -PSICONV_E_NOMEM; 1607 return -PSICONV_E_NOMEM;
1608 else 1608 else
1666ERROR3: 1666ERROR3:
1667 psiconv_free_sheet_variable(variable); 1667 psiconv_free_sheet_variable(variable);
1668ERROR2: 1668ERROR2:
1669 psiconv_list_free(*result); 1669 psiconv_list_free(*result);
1670ERROR1: 1670ERROR1:
1671 psiconv_warn(config,lev+1,off,"Reading of Sheet Variable list failed"); 1671 psiconv_error(config,lev+1,off,"Reading of Sheet Variable list failed");
1672 if (length) 1672 if (length)
1673 *length = 0; 1673 *length = 0;
1674 if (!res) 1674 if (!res)
1675 return -PSICONV_E_NOMEM; 1675 return -PSICONV_E_NOMEM;
1676 else 1676 else
1934ERROR3: 1934ERROR3:
1935 psiconv_free_sheet_grid_size_list((*result)->row_heights); 1935 psiconv_free_sheet_grid_size_list((*result)->row_heights);
1936ERROR2: 1936ERROR2:
1937 free(*result); 1937 free(*result);
1938ERROR1: 1938ERROR1:
1939 psiconv_warn(config,lev+1,off,"Reading of Sheet Grid Section failed"); 1939 psiconv_error(config,lev+1,off,"Reading of Sheet Grid Section failed");
1940 if (length) 1940 if (length)
1941 *length = 0; 1941 *length = 0;
1942 if (!res) 1942 if (!res)
1943 return -PSICONV_E_NOMEM; 1943 return -PSICONV_E_NOMEM;
1944 else 1944 else
1989ERROR3: 1989ERROR3:
1990 psiconv_free_sheet_grid_size(size); 1990 psiconv_free_sheet_grid_size(size);
1991ERROR2: 1991ERROR2:
1992 psiconv_list_free(*result); 1992 psiconv_list_free(*result);
1993ERROR1: 1993ERROR1:
1994 psiconv_warn(config,lev+1,off,"Reading of Sheet Grid Size List failed"); 1994 psiconv_error(config,lev+1,off,"Reading of Sheet Grid Size List failed");
1995 if (length) 1995 if (length)
1996 *length = 0; 1996 *length = 0;
1997 if (!res) 1997 if (!res)
1998 return -PSICONV_E_NOMEM; 1998 return -PSICONV_E_NOMEM;
1999 else 1999 else
2036 return 0; 2036 return 0;
2037 2037
2038ERROR2: 2038ERROR2:
2039 free (*result); 2039 free (*result);
2040ERROR1: 2040ERROR1:
2041 psiconv_warn(config,lev+1,off,"Reading of Sheet Grid Size failed"); 2041 psiconv_error(config,lev+1,off,"Reading of Sheet Grid Size failed");
2042 if (length) 2042 if (length)
2043 *length = 0; 2043 *length = 0;
2044 if (!res) 2044 if (!res)
2045 return -PSICONV_E_NOMEM; 2045 return -PSICONV_E_NOMEM;
2046 else 2046 else
2089 return 0; 2089 return 0;
2090 2090
2091ERROR2: 2091ERROR2:
2092 psiconv_list_free(*result); 2092 psiconv_list_free(*result);
2093ERROR1: 2093ERROR1:
2094 psiconv_warn(config,lev+1,off,"Reading of Sheet Grid break List failed"); 2094 psiconv_error(config,lev+1,off,"Reading of Sheet Grid break List failed");
2095 if (length) 2095 if (length)
2096 *length = 0; 2096 *length = 0;
2097 if (!res) 2097 if (!res)
2098 return -PSICONV_E_NOMEM; 2098 return -PSICONV_E_NOMEM;
2099 else 2099 else

Legend:
Removed from v.183  
changed lines
  Added in v.184

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