… | |
… | |
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); |
42 | static psiconv_page_layout_section psiconv_empty_page_layout_section(void); |
43 | static psiconv_page_layout_section psiconv_empty_page_layout_section(void); |
43 | static psiconv_word_status_section psiconv_empty_word_status_section(void); |
44 | static psiconv_word_status_section psiconv_empty_word_status_section(void); |
44 | static psiconv_word_f psiconv_empty_word_f(void); |
45 | static psiconv_word_f psiconv_empty_word_f(void); |
45 | static psiconv_sheet_status_section psiconv_empty_sheet_status_section(void); |
46 | static psiconv_sheet_status_section psiconv_empty_sheet_status_section(void); |
46 | static psiconv_sheet_formula_list psiconv_empty_sheet_formula_list(void); |
47 | static psiconv_formula_list psiconv_empty_formula_list(void); |
47 | static psiconv_sheet_workbook_section |
48 | static psiconv_sheet_workbook_section |
48 | psiconv_empty_sheet_workbook_section(void); |
49 | psiconv_empty_sheet_workbook_section(void); |
49 | static psiconv_sheet_f psiconv_empty_sheet_f(void); |
50 | static psiconv_sheet_f psiconv_empty_sheet_f(void); |
50 | static psiconv_texted_f psiconv_empty_texted_f(void); |
51 | static psiconv_texted_f psiconv_empty_texted_f(void); |
51 | static psiconv_paint_data_section psiconv_empty_paint_data_section(void); |
52 | static psiconv_paint_data_section psiconv_empty_paint_data_section(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 | |
|
|
552 | void psiconv_free_formula_aux(void *data) |
|
|
553 | { |
|
|
554 | psiconv_formula formula; |
|
|
555 | formula = data; |
|
|
556 | if (formula->type == psiconv_formula_dat_string) |
|
|
557 | free(formula->data.dat_string); |
|
|
558 | else if ((formula->type != psiconv_formula_dat_int) && |
|
|
559 | (formula->type != psiconv_formula_dat_var) && |
|
|
560 | (formula->type != psiconv_formula_dat_float) && |
|
|
561 | (formula->type != psiconv_formula_dat_cellref) && |
|
|
562 | (formula->type != psiconv_formula_dat_cellblock) && |
|
|
563 | (formula->type != psiconv_formula_dat_vcellblock) && |
|
|
564 | (formula->type != psiconv_formula_mark_opsep) && |
|
|
565 | (formula->type != psiconv_formula_mark_opend) && |
|
|
566 | (formula->type != psiconv_formula_mark_eof) && |
|
|
567 | (formula->type != psiconv_formula_unknown)) |
|
|
568 | psiconv_free_formula_list(formula->data.fun_operands); |
|
|
569 | } |
|
|
570 | |
550 | void psiconv_free_sheet_formula(psiconv_sheet_formula formula) |
571 | void psiconv_free_formula(psiconv_formula formula) |
551 | { |
572 | { |
552 | if (formula) |
573 | if (formula) { |
|
|
574 | psiconv_free_formula_aux(formula); |
553 | free(formula); |
575 | free(formula); |
|
|
576 | } |
554 | } |
577 | } |
555 | |
578 | |
556 | void psiconv_free_sheet_formula_list(psiconv_sheet_formula_list list) |
579 | void psiconv_free_formula_list(psiconv_formula_list list) |
557 | { |
580 | { |
558 | if (list) |
581 | if (list) |
559 | psiconv_list_free(list); |
582 | psiconv_list_free_el(list,psiconv_free_formula_aux); |
560 | } |
583 | } |
561 | |
584 | |
562 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
585 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
563 | { |
586 | { |
564 | if (section) { |
587 | if (section) { |
565 | psiconv_free_sheet_formula_list(section->formulas); |
588 | psiconv_free_formula_list(section->formulas); |
566 | free(section); |
589 | free(section); |
567 | } |
590 | } |
568 | } |
591 | } |
569 | |
592 | |
570 | void psiconv_free_sheet_f(psiconv_sheet_f file) |
593 | void psiconv_free_sheet_f(psiconv_sheet_f file) |
… | |
… | |
977 | result->cursor_row = result->cursor_column = 0; |
1000 | result->cursor_row = result->cursor_column = 0; |
978 | result->sheet_display_size = result->graph_display_size = 1000; |
1001 | result->sheet_display_size = result->graph_display_size = 1000; |
979 | return result; |
1002 | return result; |
980 | } |
1003 | } |
981 | |
1004 | |
982 | psiconv_sheet_formula_list psiconv_empty_sheet_formula_list(void) |
1005 | psiconv_formula_list psiconv_empty_formula_list(void) |
983 | { |
1006 | { |
984 | return psiconv_list_new(sizeof(struct psiconv_sheet_formula_s)); |
1007 | return psiconv_list_new(sizeof(struct psiconv_formula_s)); |
985 | } |
1008 | } |
986 | |
1009 | |
987 | psiconv_sheet_workbook_section psiconv_empty_sheet_workbook_section(void) |
1010 | psiconv_sheet_workbook_section psiconv_empty_sheet_workbook_section(void) |
988 | { |
1011 | { |
989 | psiconv_sheet_workbook_section result; |
1012 | psiconv_sheet_workbook_section result; |
990 | if (!(result = malloc(sizeof(*result)))) |
1013 | if (!(result = malloc(sizeof(*result)))) |
991 | goto ERROR1; |
1014 | goto ERROR1; |
992 | if (!(result->formulas = psiconv_empty_sheet_formula_list())) |
1015 | if (!(result->formulas = psiconv_empty_formula_list())) |
993 | goto ERROR2; |
1016 | goto ERROR2; |
994 | return result; |
1017 | return result; |
995 | ERROR2: |
1018 | ERROR2: |
996 | free(result); |
1019 | free(result); |
997 | ERROR1: |
1020 | ERROR1: |