… | |
… | |
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); |
… | |
… | |
150 | 0.0, /* space_below */ |
151 | 0.0, /* space_below */ |
151 | psiconv_bool_false, /* keep_together */ |
152 | psiconv_bool_false, /* keep_together */ |
152 | psiconv_bool_false, /* keep_with_next */ |
153 | psiconv_bool_false, /* keep_with_next */ |
153 | psiconv_bool_false, /* on_next_page */ |
154 | psiconv_bool_false, /* on_next_page */ |
154 | psiconv_bool_false, /* no_widow_protection */ |
155 | psiconv_bool_false, /* no_widow_protection */ |
|
|
156 | psiconv_bool_false, /* wrap_to_fit_cell */ |
155 | 0.0, /* left_margin */ |
157 | 0.0, /* left_margin */ |
156 | &bullet, /* bullet */ |
158 | &bullet, /* bullet */ |
157 | &no_border, /* left_border */ |
159 | &no_border, /* left_border */ |
158 | &no_border, /* right_border */ |
160 | &no_border, /* right_border */ |
159 | &no_border, /* top_border */ |
161 | &no_border, /* top_border */ |
… | |
… | |
545 | { |
547 | { |
546 | if (section) |
548 | if (section) |
547 | free(section); |
549 | free(section); |
548 | } |
550 | } |
549 | |
551 | |
550 | /* TODO: Free sublists, strings etc. depending on formula->type */ |
552 | void psiconv_free_numberformat(psiconv_numberformat numberformat) |
|
|
553 | { |
|
|
554 | if (numberformat) |
|
|
555 | free(numberformat); |
|
|
556 | } |
|
|
557 | |
|
|
558 | void psiconv_free_sheet_cell(psiconv_sheet_cell cell) |
|
|
559 | { |
|
|
560 | if (cell) { |
|
|
561 | psiconv_free_paragraph_layout(cell->paragraph); |
|
|
562 | psiconv_free_character_layout(cell->character); |
|
|
563 | psiconv_free_numberformat(cell->numberformat); |
|
|
564 | |
|
|
565 | if ((cell->type == psiconv_cell_string) && (cell->data.dat_string)) |
|
|
566 | free(cell->data.dat_string); |
|
|
567 | |
|
|
568 | free(cell); |
|
|
569 | } |
|
|
570 | } |
|
|
571 | |
|
|
572 | void psiconv_free_sheet_cell_aux(void *data) |
|
|
573 | { |
|
|
574 | psiconv_sheet_cell cell; |
|
|
575 | cell = data; |
|
|
576 | psiconv_free_sheet_cell(cell); |
|
|
577 | } |
|
|
578 | |
|
|
579 | void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list) |
|
|
580 | { |
|
|
581 | if (list) |
|
|
582 | psiconv_list_free_el(list,psiconv_free_sheet_cell_aux); |
|
|
583 | } |
|
|
584 | |
|
|
585 | void psiconv_free_sheet_worksheet_section( |
|
|
586 | psiconv_sheet_worksheet_section section) |
|
|
587 | { |
|
|
588 | if (section) { |
|
|
589 | psiconv_free_paragraph_layout(section->paragraph); |
|
|
590 | psiconv_free_character_layout(section->character); |
|
|
591 | psiconv_free_numberformat(section->numberformat); |
|
|
592 | psiconv_free_sheet_cell_list(section->cells); |
|
|
593 | free(section); |
|
|
594 | } |
|
|
595 | } |
|
|
596 | |
|
|
597 | void psiconv_free_formula_aux(void *data) |
|
|
598 | { |
|
|
599 | psiconv_formula formula; |
|
|
600 | formula = data; |
|
|
601 | if (formula->type == psiconv_formula_dat_string) |
|
|
602 | free(formula->data.dat_string); |
|
|
603 | else if ((formula->type != psiconv_formula_dat_int) && |
|
|
604 | (formula->type != psiconv_formula_dat_var) && |
|
|
605 | (formula->type != psiconv_formula_dat_float) && |
|
|
606 | (formula->type != psiconv_formula_dat_cellref) && |
|
|
607 | (formula->type != psiconv_formula_dat_cellblock) && |
|
|
608 | (formula->type != psiconv_formula_dat_vcellblock) && |
|
|
609 | (formula->type != psiconv_formula_mark_opsep) && |
|
|
610 | (formula->type != psiconv_formula_mark_opend) && |
|
|
611 | (formula->type != psiconv_formula_mark_eof) && |
|
|
612 | (formula->type != psiconv_formula_unknown)) |
|
|
613 | psiconv_free_formula_list(formula->data.fun_operands); |
|
|
614 | } |
|
|
615 | |
551 | void psiconv_free_formula(psiconv_formula formula) |
616 | void psiconv_free_formula(psiconv_formula formula) |
552 | { |
617 | { |
553 | if (formula) |
618 | if (formula) { |
|
|
619 | psiconv_free_formula_aux(formula); |
554 | free(formula); |
620 | free(formula); |
|
|
621 | } |
555 | } |
622 | } |
556 | |
623 | |
557 | void psiconv_free_formula_list(psiconv_formula_list list) |
624 | void psiconv_free_formula_list(psiconv_formula_list list) |
558 | { |
625 | { |
559 | if (list) |
626 | if (list) |
560 | psiconv_list_free(list); |
627 | psiconv_list_free_el(list,psiconv_free_formula_aux); |
561 | } |
628 | } |
562 | |
629 | |
563 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
630 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
564 | { |
631 | { |
565 | if (section) { |
632 | if (section) { |
566 | psiconv_free_formula_list(section->formulas); |
633 | psiconv_free_formula_list(section->formulas); |
|
|
634 | psiconv_free_sheet_worksheet_section(section->worksheet); |
567 | free(section); |
635 | free(section); |
568 | } |
636 | } |
569 | } |
637 | } |
570 | |
638 | |
571 | void psiconv_free_sheet_f(psiconv_sheet_f file) |
639 | void psiconv_free_sheet_f(psiconv_sheet_f file) |