/[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 98 Revision 111
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);
38static void psiconv_free_sheet_worksheet_aux (void *data);
37 39
38static psiconv_word_styles_section psiconv_empty_word_styles_section(void); 40static psiconv_word_styles_section psiconv_empty_word_styles_section(void);
39static psiconv_text_and_layout psiconv_empty_text_and_layout(void); 41static psiconv_text_and_layout psiconv_empty_text_and_layout(void);
40static psiconv_texted_section psiconv_empty_texted_section(void); 42static psiconv_texted_section psiconv_empty_texted_section(void);
41static psiconv_page_header psiconv_empty_page_header(void); 43static psiconv_page_header psiconv_empty_page_header(void);
150 0.0, /* space_below */ 152 0.0, /* space_below */
151 psiconv_bool_false, /* keep_together */ 153 psiconv_bool_false, /* keep_together */
152 psiconv_bool_false, /* keep_with_next */ 154 psiconv_bool_false, /* keep_with_next */
153 psiconv_bool_false, /* on_next_page */ 155 psiconv_bool_false, /* on_next_page */
154 psiconv_bool_false, /* no_widow_protection */ 156 psiconv_bool_false, /* no_widow_protection */
157 psiconv_bool_false, /* wrap_to_fit_cell */
155 0.0, /* left_margin */ 158 0.0, /* left_margin */
156 &bullet, /* bullet */ 159 &bullet, /* bullet */
157 &no_border, /* left_border */ 160 &no_border, /* left_border */
158 &no_border, /* right_border */ 161 &no_border, /* right_border */
159 &no_border, /* top_border */ 162 &no_border, /* top_border */
545{ 548{
546 if (section) 549 if (section)
547 free(section); 550 free(section);
548} 551}
549 552
550/* TODO: Free sublists, strings etc. depending on formula->type */ 553void psiconv_free_sheet_numberformat(psiconv_sheet_numberformat numberformat)
554{
555 if (numberformat)
556 free(numberformat);
557}
558
559void psiconv_free_sheet_cell_layout(psiconv_sheet_cell_layout layout)
560{
561 psiconv_free_paragraph_layout(layout->paragraph);
562 psiconv_free_character_layout(layout->character);
563 psiconv_free_sheet_numberformat(layout->numberformat);
564}
565
566void psiconv_free_sheet_cell(psiconv_sheet_cell cell)
567{
568 if (cell) {
569 psiconv_free_sheet_cell_layout(cell->layout);
570
571 if ((cell->type == psiconv_cell_string) && (cell->data.dat_string))
572 free(cell->data.dat_string);
573 free(cell);
574 }
575}
576
577void psiconv_free_sheet_cell_aux(void *data)
578{
579 psiconv_sheet_cell cell;
580 cell = data;
581 psiconv_free_sheet_cell(cell);
582}
583
584void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list)
585{
586 if (list)
587 psiconv_list_free_el(list,psiconv_free_sheet_cell_aux);
588}
589
590void psiconv_free_sheet_worksheet_aux (void *data)
591{
592 psiconv_sheet_worksheet section = data;
593 psiconv_free_sheet_cell_layout(section->default_layout);
594 psiconv_free_sheet_cell_list(section->cells);
595}
596
597void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet)
598{
599 if (sheet) {
600 psiconv_free_sheet_worksheet_aux(sheet);
601 free(sheet);
602 }
603}
604
605void psiconv_free_sheet_worksheet_list(psiconv_sheet_worksheet_list list)
606{
607 if (list)
608 psiconv_list_free_el(list,psiconv_free_sheet_worksheet_aux);
609}
610
611void psiconv_free_formula_aux(void *data)
612{
613 psiconv_formula formula;
614 formula = data;
615 if (formula->type == psiconv_formula_dat_string)
616 free(formula->data.dat_string);
617 else if ((formula->type != psiconv_formula_dat_int) &&
618 (formula->type != psiconv_formula_dat_var) &&
619 (formula->type != psiconv_formula_dat_float) &&
620 (formula->type != psiconv_formula_dat_cellref) &&
621 (formula->type != psiconv_formula_dat_cellblock) &&
622 (formula->type != psiconv_formula_dat_vcellblock) &&
623 (formula->type != psiconv_formula_mark_opsep) &&
624 (formula->type != psiconv_formula_mark_opend) &&
625 (formula->type != psiconv_formula_mark_eof) &&
626 (formula->type != psiconv_formula_unknown))
627 psiconv_free_formula_list(formula->data.fun_operands);
628}
629
551void psiconv_free_formula(psiconv_formula formula) 630void psiconv_free_formula(psiconv_formula formula)
552{ 631{
553 if (formula) 632 if (formula) {
633 psiconv_free_formula_aux(formula);
554 free(formula); 634 free(formula);
635 }
555} 636}
556 637
557void psiconv_free_formula_list(psiconv_formula_list list) 638void psiconv_free_formula_list(psiconv_formula_list list)
558{ 639{
559 if (list) 640 if (list)
560 psiconv_list_free(list); 641 psiconv_list_free_el(list,psiconv_free_formula_aux);
561} 642}
562 643
563void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) 644void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section)
564{ 645{
565 if (section) { 646 if (section) {
566 psiconv_free_formula_list(section->formulas); 647 psiconv_free_formula_list(section->formulas);
648 psiconv_free_sheet_worksheet_list(section->worksheets);
567 free(section); 649 free(section);
568 } 650 }
569} 651}
570 652
571void psiconv_free_sheet_f(psiconv_sheet_f file) 653void psiconv_free_sheet_f(psiconv_sheet_f file)

Legend:
Removed from v.98  
changed lines
  Added in v.111

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