… | |
… | |
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_workbook_section |
|
|
47 | psiconv_empty_sheet_workbook_section(void); |
|
|
48 | static psiconv_sheet_f psiconv_empty_sheet_f(void); |
45 | static psiconv_texted_f psiconv_empty_texted_f(void); |
49 | static psiconv_texted_f psiconv_empty_texted_f(void); |
46 | static psiconv_paint_data_section psiconv_empty_paint_data_section(void); |
50 | static psiconv_paint_data_section psiconv_empty_paint_data_section(void); |
47 | static psiconv_pictures psiconv_empty_pictures(void); |
51 | static psiconv_pictures psiconv_empty_pictures(void); |
48 | static psiconv_mbm_f psiconv_empty_mbm_f(void); |
52 | static psiconv_mbm_f psiconv_empty_mbm_f(void); |
49 | static psiconv_sketch_section psiconv_empty_sketch_section(void); |
53 | static psiconv_sketch_section psiconv_empty_sketch_section(void); |
… | |
… | |
534 | psiconv_free_word_styles_section(file->styles_sec); |
538 | psiconv_free_word_styles_section(file->styles_sec); |
535 | free(file); |
539 | free(file); |
536 | } |
540 | } |
537 | } |
541 | } |
538 | |
542 | |
|
|
543 | void psiconv_free_sheet_status_section(psiconv_sheet_status_section section) |
|
|
544 | { |
|
|
545 | if (section) |
|
|
546 | free(section); |
|
|
547 | } |
|
|
548 | |
|
|
549 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
|
|
550 | { |
|
|
551 | if (section) |
|
|
552 | free(section); |
|
|
553 | } |
|
|
554 | |
|
|
555 | void psiconv_free_sheet_f(psiconv_sheet_f file) |
|
|
556 | { |
|
|
557 | if (file) { |
|
|
558 | psiconv_free_page_layout_section(file->page_sec); |
|
|
559 | psiconv_free_sheet_status_section(file->status_sec); |
|
|
560 | psiconv_free_sheet_workbook_section(file->workbook_sec); |
|
|
561 | free(file); |
|
|
562 | } |
|
|
563 | } |
|
|
564 | |
539 | void psiconv_free_texted_f(psiconv_texted_f file) |
565 | void psiconv_free_texted_f(psiconv_texted_f file) |
540 | { |
566 | { |
541 | if (file) { |
567 | if (file) { |
542 | psiconv_free_page_layout_section(file->page_sec); |
568 | psiconv_free_page_layout_section(file->page_sec); |
543 | psiconv_free_texted_section(file->texted_sec); |
569 | psiconv_free_texted_section(file->texted_sec); |
… | |
… | |
638 | psiconv_free_mbm_f((psiconv_mbm_f) file->file); |
664 | psiconv_free_mbm_f((psiconv_mbm_f) file->file); |
639 | else if (file->type == psiconv_sketch_file) |
665 | else if (file->type == psiconv_sketch_file) |
640 | psiconv_free_sketch_f((psiconv_sketch_f) file->file); |
666 | psiconv_free_sketch_f((psiconv_sketch_f) file->file); |
641 | else if (file->type == psiconv_clipart_file) |
667 | else if (file->type == psiconv_clipart_file) |
642 | psiconv_free_clipart_f((psiconv_clipart_f) file->file); |
668 | psiconv_free_clipart_f((psiconv_clipart_f) file->file); |
|
|
669 | else if (file->type == psiconv_sheet_file) |
|
|
670 | psiconv_free_sheet_f((psiconv_sheet_f) file->file); |
643 | free(file); |
671 | free(file); |
644 | } |
672 | } |
645 | } |
673 | } |
646 | |
674 | |
647 | int psiconv_compare_color(const psiconv_color value1, |
675 | int psiconv_compare_color(const psiconv_color value1, |
… | |
… | |
856 | psiconv_page_layout_section psiconv_empty_page_layout_section(void) |
884 | psiconv_page_layout_section psiconv_empty_page_layout_section(void) |
857 | { |
885 | { |
858 | psiconv_page_layout_section result; |
886 | psiconv_page_layout_section result; |
859 | if (!(result = malloc(sizeof(*result)))) |
887 | if (!(result = malloc(sizeof(*result)))) |
860 | goto ERROR1; |
888 | goto ERROR1; |
861 | result->first_page_nr = 0; |
889 | result->first_page_nr = 1; |
862 | result->header_dist = result->footer_dist = 1.27; |
890 | result->header_dist = result->footer_dist = 1.27; |
863 | result->left_margin = result->right_margin = 3.175; |
891 | result->left_margin = result->right_margin = 3.175; |
864 | result->top_margin = result->bottom_margin = 2.54; |
892 | result->top_margin = result->bottom_margin = 2.54; |
865 | result->page_width = 21.0; |
893 | result->page_width = 21.0; |
866 | result->page_height = 29.7; |
894 | result->page_height = 29.7; |
… | |
… | |
918 | free(result); |
946 | free(result); |
919 | ERROR1: |
947 | ERROR1: |
920 | return NULL; |
948 | return NULL; |
921 | } |
949 | } |
922 | |
950 | |
|
|
951 | psiconv_sheet_status_section psiconv_empty_sheet_status_section(void) |
|
|
952 | { |
|
|
953 | psiconv_sheet_status_section result; |
|
|
954 | if (!(result = malloc(sizeof(*result)))) |
|
|
955 | return NULL; |
|
|
956 | result->show_horizontal_scrollbar = result->show_vertical_scrollbar = |
|
|
957 | psiconv_triple_auto; |
|
|
958 | result->show_graph = psiconv_bool_false; |
|
|
959 | result->show_top_sheet_toolbar = result->show_side_sheet_toolbar = |
|
|
960 | result->show_top_graph_toolbar = result->show_side_graph_toolbar = |
|
|
961 | psiconv_bool_true; |
|
|
962 | result->cursor_row = result->cursor_column = 0; |
|
|
963 | result->sheet_display_size = result->graph_display_size = 1000; |
|
|
964 | return result; |
|
|
965 | } |
|
|
966 | |
|
|
967 | psiconv_sheet_workbook_section psiconv_empty_sheet_workbook_section(void) |
|
|
968 | { |
|
|
969 | psiconv_sheet_workbook_section result; |
|
|
970 | if (!(result = malloc(sizeof(*result)))) |
|
|
971 | return NULL; |
|
|
972 | return result; |
|
|
973 | } |
|
|
974 | |
|
|
975 | psiconv_sheet_f psiconv_empty_sheet_f(void) |
|
|
976 | { |
|
|
977 | psiconv_sheet_f result; |
|
|
978 | if (!(result = malloc(sizeof(*result)))) |
|
|
979 | goto ERROR1; |
|
|
980 | if (!(result->page_sec = psiconv_empty_page_layout_section())) |
|
|
981 | goto ERROR2; |
|
|
982 | if (!(result->status_sec = psiconv_empty_sheet_status_section())) |
|
|
983 | goto ERROR3; |
|
|
984 | if (!(result->workbook_sec = psiconv_empty_sheet_workbook_section())) |
|
|
985 | goto ERROR4; |
|
|
986 | return result; |
|
|
987 | ERROR4: |
|
|
988 | psiconv_free_sheet_status_section(result->status_sec); |
|
|
989 | ERROR3: |
|
|
990 | psiconv_free_page_layout_section(result->page_sec); |
|
|
991 | ERROR2: |
|
|
992 | free(result); |
|
|
993 | ERROR1: |
|
|
994 | return NULL; |
|
|
995 | } |
|
|
996 | |
923 | psiconv_texted_f psiconv_empty_texted_f(void) |
997 | psiconv_texted_f psiconv_empty_texted_f(void) |
924 | { |
998 | { |
925 | psiconv_texted_f result; |
999 | psiconv_texted_f result; |
926 | if (!(result = malloc(sizeof(*result)))) |
1000 | if (!(result = malloc(sizeof(*result)))) |
927 | goto ERROR1; |
1001 | goto ERROR1; |
… | |
… | |
1059 | if (!(result = malloc(sizeof(*result)))) |
1133 | if (!(result = malloc(sizeof(*result)))) |
1060 | return NULL; |
1134 | return NULL; |
1061 | result->type = type; |
1135 | result->type = type; |
1062 | if (type == psiconv_word_file) { |
1136 | if (type == psiconv_word_file) { |
1063 | if (!(result->file = psiconv_empty_word_f())) |
1137 | if (!(result->file = psiconv_empty_word_f())) |
|
|
1138 | goto ERROR; |
|
|
1139 | } else if (type == psiconv_sheet_file) { |
|
|
1140 | if (!(result->file = psiconv_empty_sheet_f())) |
1064 | goto ERROR; |
1141 | goto ERROR; |
1065 | } else if (type == psiconv_texted_file) { |
1142 | } else if (type == psiconv_texted_file) { |
1066 | if (!(result->file = psiconv_empty_texted_f())) |
1143 | if (!(result->file = psiconv_empty_texted_f())) |
1067 | goto ERROR; |
1144 | goto ERROR; |
1068 | } else if (type == psiconv_mbm_file) { |
1145 | } else if (type == psiconv_mbm_file) { |