/[public]/psiconv/trunk/lib/psiconv/data.c
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/data.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 88 Revision 94
40static psiconv_texted_section psiconv_empty_texted_section(void); 40static psiconv_texted_section psiconv_empty_texted_section(void);
41static psiconv_page_header psiconv_empty_page_header(void); 41static psiconv_page_header psiconv_empty_page_header(void);
42static psiconv_page_layout_section psiconv_empty_page_layout_section(void); 42static psiconv_page_layout_section psiconv_empty_page_layout_section(void);
43static psiconv_word_status_section psiconv_empty_word_status_section(void); 43static psiconv_word_status_section psiconv_empty_word_status_section(void);
44static psiconv_word_f psiconv_empty_word_f(void); 44static psiconv_word_f psiconv_empty_word_f(void);
45static psiconv_sheet_status_section psiconv_empty_sheet_status_section(void);
46static psiconv_sheet_f psiconv_empty_sheet_f(void);
45static psiconv_texted_f psiconv_empty_texted_f(void); 47static psiconv_texted_f psiconv_empty_texted_f(void);
46static psiconv_paint_data_section psiconv_empty_paint_data_section(void); 48static psiconv_paint_data_section psiconv_empty_paint_data_section(void);
47static psiconv_pictures psiconv_empty_pictures(void); 49static psiconv_pictures psiconv_empty_pictures(void);
48static psiconv_mbm_f psiconv_empty_mbm_f(void); 50static psiconv_mbm_f psiconv_empty_mbm_f(void);
49static psiconv_sketch_section psiconv_empty_sketch_section(void); 51static 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
541void psiconv_free_sheet_status_section(psiconv_sheet_status_section section)
542{
543 if (section)
544 free(section);
545}
546
547void 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
539void psiconv_free_texted_f(psiconv_texted_f file) 556void 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
647int psiconv_compare_color(const psiconv_color value1, 666int psiconv_compare_color(const psiconv_color value1,
918 free(result); 937 free(result);
919ERROR1: 938ERROR1:
920 return NULL; 939 return NULL;
921} 940}
922 941
942psiconv_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
958psiconv_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;
968ERROR3:
969 psiconv_free_page_layout_section(result->page_sec);
970ERROR2:
971 free(result);
972ERROR1:
973 return NULL;
974}
975
923psiconv_texted_f psiconv_empty_texted_f(void) 976psiconv_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) {

Legend:
Removed from v.88  
changed lines
  Added in v.94

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26