… | |
… | |
41 | static psiconv_page_header psiconv_empty_page_header(void); |
41 | static psiconv_page_header psiconv_empty_page_header(void); |
42 | static psiconv_page_layout_section psiconv_empty_page_layout_section(void); |
42 | static psiconv_page_layout_section psiconv_empty_page_layout_section(void); |
43 | static psiconv_word_status_section psiconv_empty_word_status_section(void); |
43 | static psiconv_word_status_section psiconv_empty_word_status_section(void); |
44 | static psiconv_word_f psiconv_empty_word_f(void); |
44 | static psiconv_word_f psiconv_empty_word_f(void); |
45 | static psiconv_sheet_status_section psiconv_empty_sheet_status_section(void); |
45 | static psiconv_sheet_status_section psiconv_empty_sheet_status_section(void); |
|
|
46 | static psiconv_formula_list psiconv_empty_formula_list(void); |
46 | static psiconv_sheet_workbook_section |
47 | static psiconv_sheet_workbook_section |
47 | psiconv_empty_sheet_workbook_section(void); |
48 | psiconv_empty_sheet_workbook_section(void); |
48 | static psiconv_sheet_f psiconv_empty_sheet_f(void); |
49 | static psiconv_sheet_f psiconv_empty_sheet_f(void); |
49 | static psiconv_texted_f psiconv_empty_texted_f(void); |
50 | static psiconv_texted_f psiconv_empty_texted_f(void); |
50 | static psiconv_paint_data_section psiconv_empty_paint_data_section(void); |
51 | static psiconv_paint_data_section psiconv_empty_paint_data_section(void); |
… | |
… | |
544 | { |
545 | { |
545 | if (section) |
546 | if (section) |
546 | free(section); |
547 | free(section); |
547 | } |
548 | } |
548 | |
549 | |
|
|
550 | /* TODO: Free sublists, strings etc. depending on formula->type */ |
|
|
551 | void psiconv_free_formula(psiconv_formula formula) |
|
|
552 | { |
|
|
553 | if (formula) |
|
|
554 | free(formula); |
|
|
555 | } |
|
|
556 | |
|
|
557 | void psiconv_free_formula_list(psiconv_formula_list list) |
|
|
558 | { |
|
|
559 | if (list) |
|
|
560 | psiconv_list_free(list); |
|
|
561 | } |
|
|
562 | |
549 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
563 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
550 | { |
564 | { |
551 | if (section) |
565 | if (section) { |
|
|
566 | psiconv_free_formula_list(section->formulas); |
552 | free(section); |
567 | free(section); |
|
|
568 | } |
553 | } |
569 | } |
554 | |
570 | |
555 | void psiconv_free_sheet_f(psiconv_sheet_f file) |
571 | void psiconv_free_sheet_f(psiconv_sheet_f file) |
556 | { |
572 | { |
557 | if (file) { |
573 | if (file) { |
… | |
… | |
962 | result->cursor_row = result->cursor_column = 0; |
978 | result->cursor_row = result->cursor_column = 0; |
963 | result->sheet_display_size = result->graph_display_size = 1000; |
979 | result->sheet_display_size = result->graph_display_size = 1000; |
964 | return result; |
980 | return result; |
965 | } |
981 | } |
966 | |
982 | |
|
|
983 | psiconv_formula_list psiconv_empty_formula_list(void) |
|
|
984 | { |
|
|
985 | return psiconv_list_new(sizeof(struct psiconv_formula_s)); |
|
|
986 | } |
|
|
987 | |
967 | psiconv_sheet_workbook_section psiconv_empty_sheet_workbook_section(void) |
988 | psiconv_sheet_workbook_section psiconv_empty_sheet_workbook_section(void) |
968 | { |
989 | { |
969 | psiconv_sheet_workbook_section result; |
990 | psiconv_sheet_workbook_section result; |
970 | if (!(result = malloc(sizeof(*result)))) |
991 | if (!(result = malloc(sizeof(*result)))) |
|
|
992 | goto ERROR1; |
|
|
993 | if (!(result->formulas = psiconv_empty_formula_list())) |
|
|
994 | goto ERROR2; |
|
|
995 | return result; |
|
|
996 | ERROR2: |
|
|
997 | free(result); |
|
|
998 | ERROR1: |
971 | return NULL; |
999 | return NULL; |
972 | return result; |
|
|
973 | } |
1000 | } |
|
|
1001 | |
974 | |
1002 | |
975 | psiconv_sheet_f psiconv_empty_sheet_f(void) |
1003 | psiconv_sheet_f psiconv_empty_sheet_f(void) |
976 | { |
1004 | { |
977 | psiconv_sheet_f result; |
1005 | psiconv_sheet_f result; |
978 | if (!(result = malloc(sizeof(*result)))) |
1006 | if (!(result = malloc(sizeof(*result)))) |