… | |
… | |
32 | static void psiconv_free_style_aux(void *style); |
32 | static void psiconv_free_style_aux(void *style); |
33 | static void psiconv_free_in_line_layout_aux(void * layout); |
33 | static void psiconv_free_in_line_layout_aux(void * layout); |
34 | static void psiconv_free_paragraph_aux(void * paragraph); |
34 | static void psiconv_free_paragraph_aux(void * paragraph); |
35 | static void psiconv_free_paint_data_section_aux(void * section); |
35 | static void psiconv_free_paint_data_section_aux(void * section); |
36 | static void psiconv_free_clipart_section_aux(void * section); |
36 | static void psiconv_free_clipart_section_aux(void * section); |
|
|
37 | static void psiconv_free_formula_aux(void *data); |
37 | |
38 | |
38 | static psiconv_word_styles_section psiconv_empty_word_styles_section(void); |
39 | static psiconv_word_styles_section psiconv_empty_word_styles_section(void); |
39 | static psiconv_text_and_layout psiconv_empty_text_and_layout(void); |
40 | static psiconv_text_and_layout psiconv_empty_text_and_layout(void); |
40 | static psiconv_texted_section psiconv_empty_texted_section(void); |
41 | static psiconv_texted_section psiconv_empty_texted_section(void); |
41 | static psiconv_page_header psiconv_empty_page_header(void); |
42 | static psiconv_page_header psiconv_empty_page_header(void); |
… | |
… | |
545 | { |
546 | { |
546 | if (section) |
547 | if (section) |
547 | free(section); |
548 | free(section); |
548 | } |
549 | } |
549 | |
550 | |
550 | /* TODO: Free sublists, strings etc. depending on formula->type */ |
551 | void psiconv_free_formula_aux(void *data) |
|
|
552 | { |
|
|
553 | psiconv_formula formula; |
|
|
554 | formula = data; |
|
|
555 | if (formula->type == psiconv_formula_dat_string) |
|
|
556 | free(formula->data.dat_string); |
|
|
557 | else if ((formula->type != psiconv_formula_dat_int) && |
|
|
558 | (formula->type != psiconv_formula_dat_var) && |
|
|
559 | (formula->type != psiconv_formula_dat_float) && |
|
|
560 | (formula->type != psiconv_formula_dat_cellref) && |
|
|
561 | (formula->type != psiconv_formula_dat_cellblock) && |
|
|
562 | (formula->type != psiconv_formula_dat_vcellblock) && |
|
|
563 | (formula->type != psiconv_formula_mark_opsep) && |
|
|
564 | (formula->type != psiconv_formula_mark_opend) && |
|
|
565 | (formula->type != psiconv_formula_mark_eof) && |
|
|
566 | (formula->type != psiconv_formula_unknown)) |
|
|
567 | psiconv_free_formula_list(formula->data.fun_operands); |
|
|
568 | } |
|
|
569 | |
551 | void psiconv_free_formula(psiconv_formula formula) |
570 | void psiconv_free_formula(psiconv_formula formula) |
552 | { |
571 | { |
553 | if (formula) |
572 | if (formula) { |
|
|
573 | psiconv_free_formula_aux(formula); |
554 | free(formula); |
574 | free(formula); |
|
|
575 | } |
555 | } |
576 | } |
556 | |
577 | |
557 | void psiconv_free_formula_list(psiconv_formula_list list) |
578 | void psiconv_free_formula_list(psiconv_formula_list list) |
558 | { |
579 | { |
559 | if (list) |
580 | if (list) |
560 | psiconv_list_free(list); |
581 | psiconv_list_free_el(list,psiconv_free_formula_aux); |
561 | } |
582 | } |
562 | |
583 | |
563 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
584 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
564 | { |
585 | { |
565 | if (section) { |
586 | if (section) { |