… | |
… | |
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_f psiconv_empty_sheet_f(void); |
45 | static psiconv_texted_f psiconv_empty_texted_f(void); |
47 | static psiconv_texted_f psiconv_empty_texted_f(void); |
46 | static psiconv_paint_data_section psiconv_empty_paint_data_section(void); |
48 | static psiconv_paint_data_section psiconv_empty_paint_data_section(void); |
47 | static psiconv_pictures psiconv_empty_pictures(void); |
49 | static psiconv_pictures psiconv_empty_pictures(void); |
48 | static psiconv_mbm_f psiconv_empty_mbm_f(void); |
50 | static psiconv_mbm_f psiconv_empty_mbm_f(void); |
49 | static psiconv_sketch_section psiconv_empty_sketch_section(void); |
51 | static psiconv_sketch_section psiconv_empty_sketch_section(void); |
… | |
… | |
534 | psiconv_free_word_styles_section(file->styles_sec); |
536 | psiconv_free_word_styles_section(file->styles_sec); |
535 | free(file); |
537 | free(file); |
536 | } |
538 | } |
537 | } |
539 | } |
538 | |
540 | |
|
|
541 | void psiconv_free_sheet_status_section(psiconv_sheet_status_section section) |
|
|
542 | { |
|
|
543 | if (section) |
|
|
544 | free(section); |
|
|
545 | } |
|
|
546 | |
|
|
547 | void psiconv_free_sheet_f(psiconv_sheet_f file) |
|
|
548 | { |
|
|
549 | if (file) { |
|
|
550 | psiconv_free_page_layout_section(file->page_sec); |
|
|
551 | psiconv_free_sheet_status_section(file->status_sec); |
|
|
552 | free(file); |
|
|
553 | } |
|
|
554 | } |
|
|
555 | |
539 | void psiconv_free_texted_f(psiconv_texted_f file) |
556 | void psiconv_free_texted_f(psiconv_texted_f file) |
540 | { |
557 | { |
541 | if (file) { |
558 | if (file) { |
542 | psiconv_free_page_layout_section(file->page_sec); |
559 | psiconv_free_page_layout_section(file->page_sec); |
543 | psiconv_free_texted_section(file->texted_sec); |
560 | psiconv_free_texted_section(file->texted_sec); |
… | |
… | |
638 | psiconv_free_mbm_f((psiconv_mbm_f) file->file); |
655 | psiconv_free_mbm_f((psiconv_mbm_f) file->file); |
639 | else if (file->type == psiconv_sketch_file) |
656 | else if (file->type == psiconv_sketch_file) |
640 | psiconv_free_sketch_f((psiconv_sketch_f) file->file); |
657 | psiconv_free_sketch_f((psiconv_sketch_f) file->file); |
641 | else if (file->type == psiconv_clipart_file) |
658 | else if (file->type == psiconv_clipart_file) |
642 | psiconv_free_clipart_f((psiconv_clipart_f) file->file); |
659 | psiconv_free_clipart_f((psiconv_clipart_f) file->file); |
|
|
660 | else if (file->type == psiconv_sheet_file) |
|
|
661 | psiconv_free_sheet_f((psiconv_sheet_f) file->file); |
643 | free(file); |
662 | free(file); |
644 | } |
663 | } |
645 | } |
664 | } |
646 | |
665 | |
647 | int psiconv_compare_color(const psiconv_color value1, |
666 | int psiconv_compare_color(const psiconv_color value1, |
… | |
… | |
918 | free(result); |
937 | free(result); |
919 | ERROR1: |
938 | ERROR1: |
920 | return NULL; |
939 | return NULL; |
921 | } |
940 | } |
922 | |
941 | |
|
|
942 | psiconv_sheet_status_section psiconv_empty_sheet_status_section(void) |
|
|
943 | { |
|
|
944 | psiconv_sheet_status_section result; |
|
|
945 | if (!(result = malloc(sizeof(*result)))) |
|
|
946 | return NULL; |
|
|
947 | result->show_horizontal_scrollbar = result->show_vertical_scrollbar = |
|
|
948 | psiconv_triple_auto; |
|
|
949 | result->show_graph = psiconv_bool_false; |
|
|
950 | result->show_top_sheet_toolbar = result->show_side_sheet_toolbar = |
|
|
951 | result->show_top_graph_toolbar = result->show_side_graph_toolbar = |
|
|
952 | psiconv_bool_true; |
|
|
953 | result->cursor_row = result->cursor_column = 0; |
|
|
954 | result->sheet_display_size = result->graph_display_size = 1000; |
|
|
955 | return result; |
|
|
956 | } |
|
|
957 | |
|
|
958 | psiconv_sheet_f psiconv_empty_sheet_f(void) |
|
|
959 | { |
|
|
960 | psiconv_sheet_f result; |
|
|
961 | if (!(result = malloc(sizeof(*result)))) |
|
|
962 | goto ERROR1; |
|
|
963 | if (!(result->page_sec = psiconv_empty_page_layout_section())) |
|
|
964 | goto ERROR2; |
|
|
965 | if (!(result->status_sec = psiconv_empty_sheet_status_section())) |
|
|
966 | goto ERROR3; |
|
|
967 | return result; |
|
|
968 | ERROR3: |
|
|
969 | psiconv_free_page_layout_section(result->page_sec); |
|
|
970 | ERROR2: |
|
|
971 | free(result); |
|
|
972 | ERROR1: |
|
|
973 | return NULL; |
|
|
974 | } |
|
|
975 | |
923 | psiconv_texted_f psiconv_empty_texted_f(void) |
976 | psiconv_texted_f psiconv_empty_texted_f(void) |
924 | { |
977 | { |
925 | psiconv_texted_f result; |
978 | psiconv_texted_f result; |
926 | if (!(result = malloc(sizeof(*result)))) |
979 | if (!(result = malloc(sizeof(*result)))) |
927 | goto ERROR1; |
980 | goto ERROR1; |
… | |
… | |
1059 | if (!(result = malloc(sizeof(*result)))) |
1112 | if (!(result = malloc(sizeof(*result)))) |
1060 | return NULL; |
1113 | return NULL; |
1061 | result->type = type; |
1114 | result->type = type; |
1062 | if (type == psiconv_word_file) { |
1115 | if (type == psiconv_word_file) { |
1063 | if (!(result->file = psiconv_empty_word_f())) |
1116 | if (!(result->file = psiconv_empty_word_f())) |
|
|
1117 | goto ERROR; |
|
|
1118 | } else if (type == psiconv_sheet_file) { |
|
|
1119 | if (!(result->file = psiconv_empty_sheet_f())) |
1064 | goto ERROR; |
1120 | goto ERROR; |
1065 | } else if (type == psiconv_texted_file) { |
1121 | } else if (type == psiconv_texted_file) { |
1066 | if (!(result->file = psiconv_empty_texted_f())) |
1122 | if (!(result->file = psiconv_empty_texted_f())) |
1067 | goto ERROR; |
1123 | goto ERROR; |
1068 | } else if (type == psiconv_mbm_file) { |
1124 | } else if (type == psiconv_mbm_file) { |