--- psiconv/trunk/lib/psiconv/data.c 2001/07/18 12:24:08 128 +++ psiconv/trunk/lib/psiconv/data.c 2001/07/24 20:32:51 129 @@ -36,6 +36,7 @@ static void psiconv_free_clipart_section_aux(void * section); static void psiconv_free_formula_aux(void *data); static void psiconv_free_sheet_worksheet_aux (void *data); +static void psiconv_free_sheet_variable_aux(void * variable); static psiconv_word_styles_section psiconv_empty_word_styles_section(void); static psiconv_text_and_layout psiconv_empty_text_and_layout(void); @@ -692,11 +693,53 @@ psiconv_list_free_el(list,psiconv_free_formula_aux); } +void psiconv_free_sheet_name_section(psiconv_sheet_name_section section) +{ + if (section) { + if(section->name) + free(section->name); + free(section); + } +} + +void psiconv_free_sheet_info_section(psiconv_sheet_info_section section) +{ + if (section) { + free(section); + } +} + +void psiconv_free_sheet_variable_aux(void * variable) +{ + psiconv_sheet_variable var = variable; + if (var->name) + free(var->name); + if (var->type == psiconv_var_string) + free(var->data.dat_string); +} + +void psiconv_free_sheet_variable(psiconv_sheet_variable var) +{ + if (var) { + psiconv_free_sheet_variable_aux(var); + free(var); + } +} + +void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list) +{ + if (list) + psiconv_list_free_el(list,psiconv_free_sheet_variable_aux); +} + void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) { if (section) { psiconv_free_formula_list(section->formulas); psiconv_free_sheet_worksheet_list(section->worksheets); + psiconv_free_sheet_name_section(section->name); + psiconv_free_sheet_info_section(section->info); + psiconv_free_sheet_variable_list(section->variables); free(section); } }