--- psiconv/trunk/lib/psiconv/parse_sheet.c 2003/11/25 17:57:05 168 +++ psiconv/trunk/lib/psiconv/parse_sheet.c 2004/02/04 12:19:09 196 @@ -1,6 +1,6 @@ /* parse_sheet.c - Part of psiconv, a PSION 5 file formats converter - Copyright (c) 2001 Frodo Looijaard + Copyright (c) 2000-2004 Frodo Looijaard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -133,7 +133,7 @@ "End of sheet column reference (total length: %08x)", len); return result; ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Column Reference failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Column Reference failed"); if (length) *length = 0; if (status) @@ -217,7 +217,7 @@ len); return result; ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Cell Block Reference failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Cell Block Reference failed"); if (length) *length = 0; if (status) @@ -336,7 +336,7 @@ return 0; ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Number Format failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Number Format failed"); if (length) *length = 0; if (!res) @@ -494,7 +494,7 @@ ERROR2: free (*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Status Section failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Status Section failed"); if (length) *length = 0; if (!res) @@ -619,7 +619,7 @@ ERROR2: free (*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Workbook Section failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Workbook Section failed"); if (length) *length = 0; if (!res) @@ -669,7 +669,7 @@ ERROR2: free(*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Name Section failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Name Section failed"); if (length) *length = 0; if (!res) @@ -736,7 +736,7 @@ ERROR2: free(*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Name Section failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Name Section failed"); if (length) *length = 0; if (!res) @@ -804,7 +804,7 @@ ERROR2: psiconv_list_free(*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Formula list failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Formula list failed"); if (length) *length = 0; if (!res) @@ -826,6 +826,7 @@ psiconv_u32 temp; psiconv_bool_t has_layout; int leng; + char *auxstr; psiconv_progress(config,lev+1,off,"Going to read a sheet cell structure"); if (!(*result = malloc(sizeof(**result)))) @@ -927,11 +928,13 @@ psiconv_read_string(config,buf,lev+2,off+len,&leng,&res); if (res) goto ERROR2; - psiconv_debug(config,lev+2,off+len,"Cell contents: `%s'", - (*result)->data.dat_string); + if (!(auxstr = psiconv_make_printable(config,(*result)->data.dat_string))) + goto ERROR2; + psiconv_debug(config,lev+2,off+len,"Cell contents: `%s'",auxstr); + free(auxstr); len += leng; } else { - psiconv_warn(config,lev+2,off+len,"Unknown Sheet Cell type: %02x",(*result)->type); + psiconv_error(config,lev+2,off+len,"Unknown Sheet Cell type: %02x",(*result)->type); res = PSICONV_E_PARSE; goto ERROR2; } @@ -1055,7 +1058,7 @@ ERROR2: psiconv_free_sheet_cell_list(*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Cells List failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Cells List failed"); if (length) *length = 0; if (!res) @@ -1143,7 +1146,7 @@ ERROR2: psiconv_free_sheet_worksheet_list(*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of worksheet list failed"); + psiconv_error(config,lev+1,off,"Reading of worksheet list failed"); if (length) *length = 0; if (!res) @@ -1215,7 +1218,7 @@ return 0; ERROR1: - psiconv_warn(config,lev+1,off,"Reading of sheet cell layout failed"); + psiconv_error(config,lev+1,off,"Reading of sheet cell layout failed"); if (length) *length = 0; if (!res) @@ -1370,7 +1373,7 @@ ERROR2: free (*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Worksheet Section failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Worksheet Section failed"); if (length) *length = 0; if (!res) @@ -1420,7 +1423,7 @@ ERROR2: free (*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of the sheet line failed"); + psiconv_error(config,lev+1,off,"Reading of the sheet line failed"); if (length) *length = 0; if (!res) @@ -1491,7 +1494,7 @@ ERROR2: psiconv_free_sheet_line_list(*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Line List failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Line List failed"); if (length) *length = 0; if (!res) @@ -1547,8 +1550,8 @@ } else if (marker == 0x02) { (*result)->type = psiconv_var_string; psiconv_progress(config,lev+2,off+len,"Going to read a string"); - (*result)->data.dat_string = psiconv_read_string(config,buf,lev+2,off+len,&leng, - &res); + (*result)->data.dat_string = psiconv_read_string(config,buf,lev+2,off+len, + &leng, &res); if (res) goto ERROR3; len += leng; @@ -1570,7 +1573,7 @@ goto ERROR3; len += leng; } else { - psiconv_warn(config,lev+2,off+len,"Sheet variable unknown type marker"); + psiconv_error(config,lev+2,off+len,"Sheet variable unknown type marker"); res = -PSICONV_E_PARSE; goto ERROR3; } @@ -1597,7 +1600,7 @@ ERROR2: free (*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Variable failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Variable failed"); if (length) *length = 0; if (!res) @@ -1665,7 +1668,7 @@ ERROR2: psiconv_list_free(*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Variable list failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Variable list failed"); if (length) *length = 0; if (!res) @@ -1933,7 +1936,7 @@ ERROR2: free(*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Grid Section failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Grid Section failed"); if (length) *length = 0; if (!res) @@ -1988,7 +1991,7 @@ ERROR2: psiconv_list_free(*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Grid Size List failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Grid Size List failed"); if (length) *length = 0; if (!res) @@ -2035,7 +2038,7 @@ ERROR2: free (*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Grid Size failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Grid Size failed"); if (length) *length = 0; if (!res) @@ -2088,7 +2091,7 @@ ERROR2: psiconv_list_free(*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Sheet Grid break List failed"); + psiconv_error(config,lev+1,off,"Reading of Sheet Grid break List failed"); if (length) *length = 0; if (!res)