--- psiconv/trunk/lib/psiconv/parse_driver.c 2001/01/17 00:05:08 94 +++ psiconv/trunk/lib/psiconv/parse_driver.c 2001/01/17 12:04:12 95 @@ -686,6 +686,7 @@ psiconv_u32 status_sec = 0; psiconv_u32 page_sec = 0; psiconv_u32 applid_sec = 0; + psiconv_u32 workbook_sec = 0; psiconv_section_table_entry entry; psiconv_u32 sto; int i; @@ -726,6 +727,10 @@ "Password section found - can't read encrypted data"); res = -PSICONV_E_PARSE; goto ERROR3; + } else if (entry->id == PSICONV_ID_SHEET_WORKBOOK_SECTION) { + workbook_sec = entry->offset; + psiconv_debug(lev+3,sto, + "Found the Sheet Workbook section at %08x",workbook_sec); } else if (entry->id == PSICONV_ID_SHEET_STATUS_SECTION) { status_sec = entry->offset; psiconv_debug(lev+3,sto, @@ -774,7 +779,7 @@ if (!(temp_str = psiconv_make_printable(appl_id->name))) goto ERROR5; psiconv_debug(lev+2,applid_sec,"Name: `%s' expected, `%s' found", - "Word.app",temp_str); + "Sheet.app",temp_str); free(temp_str); res = -PSICONV_E_PARSE; goto ERROR5; @@ -795,13 +800,29 @@ goto ERROR5; } + psiconv_progress(lev+2,sto, + "Looking for the Sheet Workbook section"); + if (! workbook_sec) { + psiconv_warn(lev+2,sto, + "Sheet workbook section not found in the section table"); + res = -PSICONV_E_PARSE; + goto ERROR6; + } else { + psiconv_debug(lev+2,sto, + "Sheet workbook section at offset %08x",page_sec); + if ((res = psiconv_parse_sheet_workbook_section(buf,lev+2,workbook_sec,NULL, + &(*result)->workbook_sec))) + goto ERROR6; + } + psiconv_free_application_id_section(appl_id); psiconv_free_section_table_section(table); psiconv_progress(lev+1,off,"End of Sheet file"); return 0; - +ERROR6: + psiconv_free_page_layout_section((*result)->page_sec); ERROR5: psiconv_free_application_id_section(appl_id); ERROR4: