… | |
… | |
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_sheet_formula_list psiconv_empty_sheet_formula_list(void); |
|
|
47 | static psiconv_sheet_workbook_section |
|
|
48 | psiconv_empty_sheet_workbook_section(void); |
46 | static psiconv_sheet_f psiconv_empty_sheet_f(void); |
49 | static psiconv_sheet_f psiconv_empty_sheet_f(void); |
47 | static psiconv_texted_f psiconv_empty_texted_f(void); |
50 | static psiconv_texted_f psiconv_empty_texted_f(void); |
48 | static psiconv_paint_data_section psiconv_empty_paint_data_section(void); |
51 | static psiconv_paint_data_section psiconv_empty_paint_data_section(void); |
49 | static psiconv_pictures psiconv_empty_pictures(void); |
52 | static psiconv_pictures psiconv_empty_pictures(void); |
50 | static psiconv_mbm_f psiconv_empty_mbm_f(void); |
53 | static psiconv_mbm_f psiconv_empty_mbm_f(void); |
… | |
… | |
542 | { |
545 | { |
543 | if (section) |
546 | if (section) |
544 | free(section); |
547 | free(section); |
545 | } |
548 | } |
546 | |
549 | |
|
|
550 | void psiconv_free_sheet_formula(psiconv_sheet_formula formula) |
|
|
551 | { |
|
|
552 | if (formula) |
|
|
553 | free(formula); |
|
|
554 | } |
|
|
555 | |
|
|
556 | void psiconv_free_sheet_formula_list(psiconv_sheet_formula_list list) |
|
|
557 | { |
|
|
558 | if (list) |
|
|
559 | psiconv_list_free(list); |
|
|
560 | } |
|
|
561 | |
|
|
562 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
|
|
563 | { |
|
|
564 | if (section) { |
|
|
565 | psiconv_free_sheet_formula_list(section->formulas); |
|
|
566 | free(section); |
|
|
567 | } |
|
|
568 | } |
|
|
569 | |
547 | void psiconv_free_sheet_f(psiconv_sheet_f file) |
570 | void psiconv_free_sheet_f(psiconv_sheet_f file) |
548 | { |
571 | { |
549 | if (file) { |
572 | if (file) { |
550 | psiconv_free_page_layout_section(file->page_sec); |
573 | psiconv_free_page_layout_section(file->page_sec); |
551 | psiconv_free_sheet_status_section(file->status_sec); |
574 | psiconv_free_sheet_status_section(file->status_sec); |
|
|
575 | psiconv_free_sheet_workbook_section(file->workbook_sec); |
552 | free(file); |
576 | free(file); |
553 | } |
577 | } |
554 | } |
578 | } |
555 | |
579 | |
556 | void psiconv_free_texted_f(psiconv_texted_f file) |
580 | void psiconv_free_texted_f(psiconv_texted_f file) |
… | |
… | |
953 | result->cursor_row = result->cursor_column = 0; |
977 | result->cursor_row = result->cursor_column = 0; |
954 | result->sheet_display_size = result->graph_display_size = 1000; |
978 | result->sheet_display_size = result->graph_display_size = 1000; |
955 | return result; |
979 | return result; |
956 | } |
980 | } |
957 | |
981 | |
|
|
982 | psiconv_sheet_formula_list psiconv_empty_sheet_formula_list(void) |
|
|
983 | { |
|
|
984 | return psiconv_list_new(sizeof(struct psiconv_sheet_formula_s)); |
|
|
985 | } |
|
|
986 | |
|
|
987 | psiconv_sheet_workbook_section psiconv_empty_sheet_workbook_section(void) |
|
|
988 | { |
|
|
989 | psiconv_sheet_workbook_section result; |
|
|
990 | if (!(result = malloc(sizeof(*result)))) |
|
|
991 | goto ERROR1; |
|
|
992 | if (!(result->formulas = psiconv_empty_sheet_formula_list())) |
|
|
993 | goto ERROR2; |
|
|
994 | return result; |
|
|
995 | ERROR2: |
|
|
996 | free(result); |
|
|
997 | ERROR1: |
|
|
998 | return NULL; |
|
|
999 | } |
|
|
1000 | |
|
|
1001 | |
958 | psiconv_sheet_f psiconv_empty_sheet_f(void) |
1002 | psiconv_sheet_f psiconv_empty_sheet_f(void) |
959 | { |
1003 | { |
960 | psiconv_sheet_f result; |
1004 | psiconv_sheet_f result; |
961 | if (!(result = malloc(sizeof(*result)))) |
1005 | if (!(result = malloc(sizeof(*result)))) |
962 | goto ERROR1; |
1006 | goto ERROR1; |
963 | if (!(result->page_sec = psiconv_empty_page_layout_section())) |
1007 | if (!(result->page_sec = psiconv_empty_page_layout_section())) |
964 | goto ERROR2; |
1008 | goto ERROR2; |
965 | if (!(result->status_sec = psiconv_empty_sheet_status_section())) |
1009 | if (!(result->status_sec = psiconv_empty_sheet_status_section())) |
966 | goto ERROR3; |
1010 | goto ERROR3; |
|
|
1011 | if (!(result->workbook_sec = psiconv_empty_sheet_workbook_section())) |
|
|
1012 | goto ERROR4; |
967 | return result; |
1013 | return result; |
|
|
1014 | ERROR4: |
|
|
1015 | psiconv_free_sheet_status_section(result->status_sec); |
968 | ERROR3: |
1016 | ERROR3: |
969 | psiconv_free_page_layout_section(result->page_sec); |
1017 | psiconv_free_page_layout_section(result->page_sec); |
970 | ERROR2: |
1018 | ERROR2: |
971 | free(result); |
1019 | free(result); |
972 | ERROR1: |
1020 | ERROR1: |