/[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 97 Revision 99
32static void psiconv_free_style_aux(void *style); 32static void psiconv_free_style_aux(void *style);
33static void psiconv_free_in_line_layout_aux(void * layout); 33static void psiconv_free_in_line_layout_aux(void * layout);
34static void psiconv_free_paragraph_aux(void * paragraph); 34static void psiconv_free_paragraph_aux(void * paragraph);
35static void psiconv_free_paint_data_section_aux(void * section); 35static void psiconv_free_paint_data_section_aux(void * section);
36static void psiconv_free_clipart_section_aux(void * section); 36static void psiconv_free_clipart_section_aux(void * section);
37static void psiconv_free_formula_aux(void *data);
37 38
38static psiconv_word_styles_section psiconv_empty_word_styles_section(void); 39static psiconv_word_styles_section psiconv_empty_word_styles_section(void);
39static psiconv_text_and_layout psiconv_empty_text_and_layout(void); 40static psiconv_text_and_layout psiconv_empty_text_and_layout(void);
40static psiconv_texted_section psiconv_empty_texted_section(void); 41static psiconv_texted_section psiconv_empty_texted_section(void);
41static psiconv_page_header psiconv_empty_page_header(void); 42static psiconv_page_header psiconv_empty_page_header(void);
42static psiconv_page_layout_section psiconv_empty_page_layout_section(void); 43static psiconv_page_layout_section psiconv_empty_page_layout_section(void);
43static psiconv_word_status_section psiconv_empty_word_status_section(void); 44static psiconv_word_status_section psiconv_empty_word_status_section(void);
44static psiconv_word_f psiconv_empty_word_f(void); 45static psiconv_word_f psiconv_empty_word_f(void);
45static psiconv_sheet_status_section psiconv_empty_sheet_status_section(void); 46static psiconv_sheet_status_section psiconv_empty_sheet_status_section(void);
46static psiconv_sheet_formula_list psiconv_empty_sheet_formula_list(void); 47static psiconv_formula_list psiconv_empty_formula_list(void);
47static psiconv_sheet_workbook_section 48static psiconv_sheet_workbook_section
48 psiconv_empty_sheet_workbook_section(void); 49 psiconv_empty_sheet_workbook_section(void);
49static psiconv_sheet_f psiconv_empty_sheet_f(void); 50static psiconv_sheet_f psiconv_empty_sheet_f(void);
50static psiconv_texted_f psiconv_empty_texted_f(void); 51static psiconv_texted_f psiconv_empty_texted_f(void);
51static psiconv_paint_data_section psiconv_empty_paint_data_section(void); 52static psiconv_paint_data_section psiconv_empty_paint_data_section(void);
545{ 546{
546 if (section) 547 if (section)
547 free(section); 548 free(section);
548} 549}
549 550
551void psiconv_free_formula_aux(void *data)
552{
553 psiconv_formula formula;
554 formula = data;
555 if (formula->type == psiconv_formula_dat_string)
556 free(formula->data.dat_string);
557 else if ((formula->type != psiconv_formula_dat_int) &&
558 (formula->type != psiconv_formula_dat_var) &&
559 (formula->type != psiconv_formula_dat_float) &&
560 (formula->type != psiconv_formula_dat_cellref) &&
561 (formula->type != psiconv_formula_dat_cellblock) &&
562 (formula->type != psiconv_formula_dat_vcellblock) &&
563 (formula->type != psiconv_formula_mark_opsep) &&
564 (formula->type != psiconv_formula_mark_opend) &&
565 (formula->type != psiconv_formula_mark_eof) &&
566 (formula->type != psiconv_formula_unknown))
567 psiconv_free_formula_list(formula->data.fun_operands);
568}
569
550void psiconv_free_sheet_formula(psiconv_sheet_formula formula) 570void psiconv_free_formula(psiconv_formula formula)
551{ 571{
552 if (formula) 572 if (formula) {
573 psiconv_free_formula_aux(formula);
553 free(formula); 574 free(formula);
575 }
554} 576}
555 577
556void psiconv_free_sheet_formula_list(psiconv_sheet_formula_list list) 578void psiconv_free_formula_list(psiconv_formula_list list)
557{ 579{
558 if (list) 580 if (list)
559 psiconv_list_free(list); 581 psiconv_list_free_el(list,psiconv_free_formula_aux);
560} 582}
561 583
562void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) 584void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section)
563{ 585{
564 if (section) { 586 if (section) {
565 psiconv_free_sheet_formula_list(section->formulas); 587 psiconv_free_formula_list(section->formulas);
566 free(section); 588 free(section);
567 } 589 }
568} 590}
569 591
570void psiconv_free_sheet_f(psiconv_sheet_f file) 592void psiconv_free_sheet_f(psiconv_sheet_f file)
977 result->cursor_row = result->cursor_column = 0; 999 result->cursor_row = result->cursor_column = 0;
978 result->sheet_display_size = result->graph_display_size = 1000; 1000 result->sheet_display_size = result->graph_display_size = 1000;
979 return result; 1001 return result;
980} 1002}
981 1003
982psiconv_sheet_formula_list psiconv_empty_sheet_formula_list(void) 1004psiconv_formula_list psiconv_empty_formula_list(void)
983{ 1005{
984 return psiconv_list_new(sizeof(struct psiconv_sheet_formula_s)); 1006 return psiconv_list_new(sizeof(struct psiconv_formula_s));
985} 1007}
986 1008
987psiconv_sheet_workbook_section psiconv_empty_sheet_workbook_section(void) 1009psiconv_sheet_workbook_section psiconv_empty_sheet_workbook_section(void)
988{ 1010{
989 psiconv_sheet_workbook_section result; 1011 psiconv_sheet_workbook_section result;
990 if (!(result = malloc(sizeof(*result)))) 1012 if (!(result = malloc(sizeof(*result))))
991 goto ERROR1; 1013 goto ERROR1;
992 if (!(result->formulas = psiconv_empty_sheet_formula_list())) 1014 if (!(result->formulas = psiconv_empty_formula_list()))
993 goto ERROR2; 1015 goto ERROR2;
994 return result; 1016 return result;
995ERROR2: 1017ERROR2:
996 free(result); 1018 free(result);
997ERROR1: 1019ERROR1:

Legend:
Removed from v.97  
changed lines
  Added in v.99

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