… | |
… | |
33 | static void psiconv_free_in_line_layout_aux(void * layout); |
33 | static void psiconv_free_in_line_layout_aux(void * layout); |
34 | static void psiconv_free_paragraph_aux(void * paragraph); |
34 | static void psiconv_free_paragraph_aux(void * paragraph); |
35 | static void psiconv_free_paint_data_section_aux(void * section); |
35 | static void psiconv_free_paint_data_section_aux(void * section); |
36 | static void psiconv_free_clipart_section_aux(void * section); |
36 | static void psiconv_free_clipart_section_aux(void * section); |
37 | static void psiconv_free_formula_aux(void *data); |
37 | static void psiconv_free_formula_aux(void *data); |
|
|
38 | static void psiconv_free_sheet_worksheet_aux (void *data); |
38 | |
39 | |
39 | static psiconv_word_styles_section psiconv_empty_word_styles_section(void); |
40 | static psiconv_word_styles_section psiconv_empty_word_styles_section(void); |
40 | static psiconv_text_and_layout psiconv_empty_text_and_layout(void); |
41 | static psiconv_text_and_layout psiconv_empty_text_and_layout(void); |
41 | static psiconv_texted_section psiconv_empty_texted_section(void); |
42 | static psiconv_texted_section psiconv_empty_texted_section(void); |
42 | static psiconv_page_header psiconv_empty_page_header(void); |
43 | static psiconv_page_header psiconv_empty_page_header(void); |
… | |
… | |
316 | return ss->normal; |
317 | return ss->normal; |
317 | else |
318 | else |
318 | return psiconv_list_get(ss->styles,0xff - nr); |
319 | return psiconv_list_get(ss->styles,0xff - nr); |
319 | } |
320 | } |
320 | |
321 | |
|
|
322 | psiconv_formula psiconv_get_formula (psiconv_formula_list ss, int nr) |
|
|
323 | { |
|
|
324 | return psiconv_list_get(ss,psiconv_list_length(ss)-nr-1); |
|
|
325 | } |
|
|
326 | |
|
|
327 | |
321 | void psiconv_free_color (psiconv_color color) |
328 | void psiconv_free_color (psiconv_color color) |
322 | { |
329 | { |
323 | if (color) |
330 | if (color) |
324 | free(color); |
331 | free(color); |
325 | } |
332 | } |
… | |
… | |
547 | { |
554 | { |
548 | if (section) |
555 | if (section) |
549 | free(section); |
556 | free(section); |
550 | } |
557 | } |
551 | |
558 | |
552 | void psiconv_free_numberformat(psiconv_numberformat numberformat) |
559 | void psiconv_free_sheet_numberformat(psiconv_sheet_numberformat numberformat) |
553 | { |
560 | { |
554 | if (numberformat) |
561 | if (numberformat) |
555 | free(numberformat); |
562 | free(numberformat); |
556 | } |
563 | } |
557 | |
564 | |
|
|
565 | void psiconv_free_sheet_cell_layout(psiconv_sheet_cell_layout layout) |
|
|
566 | { |
|
|
567 | psiconv_free_paragraph_layout(layout->paragraph); |
|
|
568 | psiconv_free_character_layout(layout->character); |
|
|
569 | psiconv_free_sheet_numberformat(layout->numberformat); |
|
|
570 | } |
|
|
571 | |
|
|
572 | void psiconv_free_sheet_cell_aux(void *cell) |
|
|
573 | { |
|
|
574 | psiconv_sheet_cell data = cell; |
|
|
575 | |
|
|
576 | psiconv_free_sheet_cell_layout(data->layout); |
|
|
577 | |
|
|
578 | if ((data->type == psiconv_cell_string) && (data->data.dat_string)) |
|
|
579 | free(data->data.dat_string); |
|
|
580 | } |
|
|
581 | |
558 | void psiconv_free_sheet_cell(psiconv_sheet_cell cell) |
582 | void psiconv_free_sheet_cell(psiconv_sheet_cell cell) |
559 | { |
583 | { |
560 | if (cell) { |
584 | if (cell) { |
561 | psiconv_free_paragraph_layout(cell->paragraph); |
|
|
562 | psiconv_free_character_layout(cell->character); |
|
|
563 | psiconv_free_numberformat(cell->numberformat); |
|
|
564 | |
|
|
565 | if ((cell->type == psiconv_cell_string) && (cell->data.dat_string)) |
|
|
566 | free(cell->data.dat_string); |
|
|
567 | |
|
|
568 | free(cell); |
|
|
569 | } |
|
|
570 | } |
|
|
571 | |
|
|
572 | void psiconv_free_sheet_cell_aux(void *data) |
|
|
573 | { |
|
|
574 | psiconv_sheet_cell cell; |
|
|
575 | cell = data; |
|
|
576 | psiconv_free_sheet_cell(cell); |
585 | psiconv_free_sheet_cell_aux(cell); |
|
|
586 | free(cell); |
|
|
587 | } |
577 | } |
588 | } |
578 | |
589 | |
579 | void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list) |
590 | void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list) |
580 | { |
591 | { |
581 | if (list) |
592 | if (list) |
582 | psiconv_list_free_el(list,psiconv_free_sheet_cell_aux); |
593 | psiconv_list_free_el(list,psiconv_free_sheet_cell_aux); |
583 | } |
594 | } |
584 | |
595 | |
585 | void psiconv_free_sheet_worksheet_section( |
596 | void psiconv_free_sheet_worksheet_aux (void *data) |
586 | psiconv_sheet_worksheet_section section) |
|
|
587 | { |
597 | { |
588 | if (section) { |
598 | psiconv_sheet_worksheet section = data; |
589 | psiconv_free_paragraph_layout(section->paragraph); |
599 | psiconv_free_sheet_cell_layout(section->default_layout); |
590 | psiconv_free_character_layout(section->character); |
|
|
591 | psiconv_free_numberformat(section->numberformat); |
|
|
592 | psiconv_free_sheet_cell_list(section->cells); |
600 | psiconv_free_sheet_cell_list(section->cells); |
|
|
601 | } |
|
|
602 | |
|
|
603 | void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet) |
|
|
604 | { |
|
|
605 | if (sheet) { |
|
|
606 | psiconv_free_sheet_worksheet_aux(sheet); |
593 | free(section); |
607 | free(sheet); |
594 | } |
608 | } |
|
|
609 | } |
|
|
610 | |
|
|
611 | void psiconv_free_sheet_worksheet_list(psiconv_sheet_worksheet_list list) |
|
|
612 | { |
|
|
613 | if (list) |
|
|
614 | psiconv_list_free_el(list,psiconv_free_sheet_worksheet_aux); |
595 | } |
615 | } |
596 | |
616 | |
597 | void psiconv_free_formula_aux(void *data) |
617 | void psiconv_free_formula_aux(void *data) |
598 | { |
618 | { |
599 | psiconv_formula formula; |
619 | psiconv_formula formula; |
… | |
… | |
629 | |
649 | |
630 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
650 | void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section) |
631 | { |
651 | { |
632 | if (section) { |
652 | if (section) { |
633 | psiconv_free_formula_list(section->formulas); |
653 | psiconv_free_formula_list(section->formulas); |
634 | psiconv_free_sheet_worksheet_section(section->worksheet); |
654 | psiconv_free_sheet_worksheet_list(section->worksheets); |
635 | free(section); |
655 | free(section); |
636 | } |
656 | } |
637 | } |
657 | } |
638 | |
658 | |
639 | void psiconv_free_sheet_f(psiconv_sheet_f file) |
659 | void psiconv_free_sheet_f(psiconv_sheet_f file) |