… | |
… | |
40 | static psiconv_texted_section psiconv_empty_texted_section(void); |
40 | static psiconv_texted_section psiconv_empty_texted_section(void); |
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); |
|
|
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); |
|
|
49 | static psiconv_sheet_f psiconv_empty_sheet_f(void); |
45 | static psiconv_texted_f psiconv_empty_texted_f(void); |
50 | static psiconv_texted_f psiconv_empty_texted_f(void); |
46 | static psiconv_paint_data_section psiconv_empty_paint_data_section(void); |
51 | static psiconv_paint_data_section psiconv_empty_paint_data_section(void); |
47 | static psiconv_pictures psiconv_empty_pictures(void); |
52 | static psiconv_pictures psiconv_empty_pictures(void); |
48 | static psiconv_mbm_f psiconv_empty_mbm_f(void); |
53 | static psiconv_mbm_f psiconv_empty_mbm_f(void); |
49 | static psiconv_sketch_section psiconv_empty_sketch_section(void); |
54 | static psiconv_sketch_section psiconv_empty_sketch_section(void); |
… | |
… | |
534 | psiconv_free_word_styles_section(file->styles_sec); |
539 | psiconv_free_word_styles_section(file->styles_sec); |
535 | free(file); |
540 | free(file); |
536 | } |
541 | } |
537 | } |
542 | } |
538 | |
543 | |
|
|
544 | void psiconv_free_sheet_status_section(psiconv_sheet_status_section section) |
|
|
545 | { |
|
|
546 | if (section) |
|
|
547 | free(section); |
|
|
548 | } |
|
|
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 | |
|
|
570 | void psiconv_free_sheet_f(psiconv_sheet_f file) |
|
|
571 | { |
|
|
572 | if (file) { |
|
|
573 | psiconv_free_page_layout_section(file->page_sec); |
|
|
574 | psiconv_free_sheet_status_section(file->status_sec); |
|
|
575 | psiconv_free_sheet_workbook_section(file->workbook_sec); |
|
|
576 | free(file); |
|
|
577 | } |
|
|
578 | } |
|
|
579 | |
539 | void psiconv_free_texted_f(psiconv_texted_f file) |
580 | void psiconv_free_texted_f(psiconv_texted_f file) |
540 | { |
581 | { |
541 | if (file) { |
582 | if (file) { |
542 | psiconv_free_page_layout_section(file->page_sec); |
583 | psiconv_free_page_layout_section(file->page_sec); |
543 | psiconv_free_texted_section(file->texted_sec); |
584 | psiconv_free_texted_section(file->texted_sec); |
… | |
… | |
638 | psiconv_free_mbm_f((psiconv_mbm_f) file->file); |
679 | psiconv_free_mbm_f((psiconv_mbm_f) file->file); |
639 | else if (file->type == psiconv_sketch_file) |
680 | else if (file->type == psiconv_sketch_file) |
640 | psiconv_free_sketch_f((psiconv_sketch_f) file->file); |
681 | psiconv_free_sketch_f((psiconv_sketch_f) file->file); |
641 | else if (file->type == psiconv_clipart_file) |
682 | else if (file->type == psiconv_clipart_file) |
642 | psiconv_free_clipart_f((psiconv_clipart_f) file->file); |
683 | psiconv_free_clipart_f((psiconv_clipart_f) file->file); |
|
|
684 | else if (file->type == psiconv_sheet_file) |
|
|
685 | psiconv_free_sheet_f((psiconv_sheet_f) file->file); |
643 | free(file); |
686 | free(file); |
644 | } |
687 | } |
645 | } |
688 | } |
646 | |
689 | |
647 | int psiconv_compare_color(const psiconv_color value1, |
690 | int psiconv_compare_color(const psiconv_color value1, |
… | |
… | |
856 | psiconv_page_layout_section psiconv_empty_page_layout_section(void) |
899 | psiconv_page_layout_section psiconv_empty_page_layout_section(void) |
857 | { |
900 | { |
858 | psiconv_page_layout_section result; |
901 | psiconv_page_layout_section result; |
859 | if (!(result = malloc(sizeof(*result)))) |
902 | if (!(result = malloc(sizeof(*result)))) |
860 | goto ERROR1; |
903 | goto ERROR1; |
861 | result->first_page_nr = 0; |
904 | result->first_page_nr = 1; |
862 | result->header_dist = result->footer_dist = 1.27; |
905 | result->header_dist = result->footer_dist = 1.27; |
863 | result->left_margin = result->right_margin = 3.175; |
906 | result->left_margin = result->right_margin = 3.175; |
864 | result->top_margin = result->bottom_margin = 2.54; |
907 | result->top_margin = result->bottom_margin = 2.54; |
865 | result->page_width = 21.0; |
908 | result->page_width = 21.0; |
866 | result->page_height = 29.7; |
909 | result->page_height = 29.7; |
… | |
… | |
918 | free(result); |
961 | free(result); |
919 | ERROR1: |
962 | ERROR1: |
920 | return NULL; |
963 | return NULL; |
921 | } |
964 | } |
922 | |
965 | |
|
|
966 | psiconv_sheet_status_section psiconv_empty_sheet_status_section(void) |
|
|
967 | { |
|
|
968 | psiconv_sheet_status_section result; |
|
|
969 | if (!(result = malloc(sizeof(*result)))) |
|
|
970 | return NULL; |
|
|
971 | result->show_horizontal_scrollbar = result->show_vertical_scrollbar = |
|
|
972 | psiconv_triple_auto; |
|
|
973 | result->show_graph = psiconv_bool_false; |
|
|
974 | result->show_top_sheet_toolbar = result->show_side_sheet_toolbar = |
|
|
975 | result->show_top_graph_toolbar = result->show_side_graph_toolbar = |
|
|
976 | psiconv_bool_true; |
|
|
977 | result->cursor_row = result->cursor_column = 0; |
|
|
978 | result->sheet_display_size = result->graph_display_size = 1000; |
|
|
979 | return result; |
|
|
980 | } |
|
|
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 | |
|
|
1002 | psiconv_sheet_f psiconv_empty_sheet_f(void) |
|
|
1003 | { |
|
|
1004 | psiconv_sheet_f result; |
|
|
1005 | if (!(result = malloc(sizeof(*result)))) |
|
|
1006 | goto ERROR1; |
|
|
1007 | if (!(result->page_sec = psiconv_empty_page_layout_section())) |
|
|
1008 | goto ERROR2; |
|
|
1009 | if (!(result->status_sec = psiconv_empty_sheet_status_section())) |
|
|
1010 | goto ERROR3; |
|
|
1011 | if (!(result->workbook_sec = psiconv_empty_sheet_workbook_section())) |
|
|
1012 | goto ERROR4; |
|
|
1013 | return result; |
|
|
1014 | ERROR4: |
|
|
1015 | psiconv_free_sheet_status_section(result->status_sec); |
|
|
1016 | ERROR3: |
|
|
1017 | psiconv_free_page_layout_section(result->page_sec); |
|
|
1018 | ERROR2: |
|
|
1019 | free(result); |
|
|
1020 | ERROR1: |
|
|
1021 | return NULL; |
|
|
1022 | } |
|
|
1023 | |
923 | psiconv_texted_f psiconv_empty_texted_f(void) |
1024 | psiconv_texted_f psiconv_empty_texted_f(void) |
924 | { |
1025 | { |
925 | psiconv_texted_f result; |
1026 | psiconv_texted_f result; |
926 | if (!(result = malloc(sizeof(*result)))) |
1027 | if (!(result = malloc(sizeof(*result)))) |
927 | goto ERROR1; |
1028 | goto ERROR1; |
… | |
… | |
1059 | if (!(result = malloc(sizeof(*result)))) |
1160 | if (!(result = malloc(sizeof(*result)))) |
1060 | return NULL; |
1161 | return NULL; |
1061 | result->type = type; |
1162 | result->type = type; |
1062 | if (type == psiconv_word_file) { |
1163 | if (type == psiconv_word_file) { |
1063 | if (!(result->file = psiconv_empty_word_f())) |
1164 | if (!(result->file = psiconv_empty_word_f())) |
|
|
1165 | goto ERROR; |
|
|
1166 | } else if (type == psiconv_sheet_file) { |
|
|
1167 | if (!(result->file = psiconv_empty_sheet_f())) |
1064 | goto ERROR; |
1168 | goto ERROR; |
1065 | } else if (type == psiconv_texted_file) { |
1169 | } else if (type == psiconv_texted_file) { |
1066 | if (!(result->file = psiconv_empty_texted_f())) |
1170 | if (!(result->file = psiconv_empty_texted_f())) |
1067 | goto ERROR; |
1171 | goto ERROR; |
1068 | } else if (type == psiconv_mbm_file) { |
1172 | } else if (type == psiconv_mbm_file) { |