… | |
… | |
21 | #include "compat.h" |
21 | #include "compat.h" |
22 | #include <stdlib.h> |
22 | #include <stdlib.h> |
23 | #include <string.h> |
23 | #include <string.h> |
24 | #include "data.h" |
24 | #include "data.h" |
25 | #include "list.h" |
25 | #include "list.h" |
|
|
26 | |
|
|
27 | #ifdef DMALLOC |
|
|
28 | #include <dmalloc.h> |
|
|
29 | #endif |
26 | |
30 | |
27 | static psiconv_color clone_color(psiconv_color color); |
31 | static psiconv_color clone_color(psiconv_color color); |
28 | static psiconv_font clone_font(psiconv_font font); |
32 | static psiconv_font clone_font(psiconv_font font); |
29 | static psiconv_border clone_border(psiconv_border border); |
33 | static psiconv_border clone_border(psiconv_border border); |
30 | static psiconv_bullet clone_bullet(psiconv_bullet bullet); |
34 | static psiconv_bullet clone_bullet(psiconv_bullet bullet); |
… | |
… | |
438 | { |
442 | { |
439 | if (styles) { |
443 | if (styles) { |
440 | psiconv_free_word_style(styles->normal); |
444 | psiconv_free_word_style(styles->normal); |
441 | if (styles->styles) |
445 | if (styles->styles) |
442 | psiconv_list_free_el(styles->styles,psiconv_free_style_aux); |
446 | psiconv_list_free_el(styles->styles,psiconv_free_style_aux); |
|
|
447 | free(styles); |
443 | } |
448 | } |
444 | } |
449 | } |
445 | |
450 | |
446 | void psiconv_free_header_section(psiconv_header_section header) |
451 | void psiconv_free_header_section(psiconv_header_section header) |
447 | { |
452 | { |
… | |
… | |
468 | free(section->name); |
473 | free(section->name); |
469 | free(section); |
474 | free(section); |
470 | } |
475 | } |
471 | } |
476 | } |
472 | |
477 | |
|
|
478 | void psiconv_free_object_icon_section(psiconv_object_icon_section section) |
|
|
479 | { |
|
|
480 | if (section) { |
|
|
481 | if (section->icon_name) |
|
|
482 | free(section->icon_name); |
|
|
483 | free(section); |
|
|
484 | } |
|
|
485 | } |
|
|
486 | |
|
|
487 | void psiconv_free_object_display_section(psiconv_object_display_section section) |
|
|
488 | { |
|
|
489 | if (section) |
|
|
490 | free(section); |
|
|
491 | } |
|
|
492 | |
|
|
493 | void psiconv_free_object(psiconv_object object) |
|
|
494 | { |
|
|
495 | if (object) { |
|
|
496 | psiconv_free_object_icon_section(object->icon); |
|
|
497 | psiconv_free_object_display_section(object->display); |
|
|
498 | psiconv_free_file(object->object); |
|
|
499 | free(object); |
|
|
500 | } |
|
|
501 | } |
|
|
502 | |
473 | void psiconv_free_in_line_layout_aux(void * layout) |
503 | void psiconv_free_in_line_layout_aux(void * layout) |
474 | { |
504 | { |
475 | psiconv_free_character_layout(((psiconv_in_line_layout) layout)->layout); |
505 | psiconv_free_character_layout(((psiconv_in_line_layout) layout)->layout); |
|
|
506 | psiconv_free_object(((psiconv_in_line_layout) layout)->object); |
476 | } |
507 | } |
477 | |
508 | |
478 | void psiconv_free_in_line_layout(psiconv_in_line_layout layout) |
509 | void psiconv_free_in_line_layout(psiconv_in_line_layout layout) |
479 | { |
510 | { |
480 | if (layout) { |
511 | if (layout) { |
… | |
… | |
629 | psiconv_free_sheet_line_aux(line); |
660 | psiconv_free_sheet_line_aux(line); |
630 | free(line); |
661 | free(line); |
631 | } |
662 | } |
632 | } |
663 | } |
633 | |
664 | |
|
|
665 | |
634 | void psiconv_free_sheet_line_list(psiconv_sheet_line_list list) |
666 | void psiconv_free_sheet_line_list(psiconv_sheet_line_list list) |
635 | { |
667 | { |
636 | if (list) |
668 | if (list) |
637 | psiconv_list_free_el(list,psiconv_free_sheet_line_aux); |
669 | psiconv_list_free_el(list,psiconv_free_sheet_line_aux); |
|
|
670 | } |
|
|
671 | |
|
|
672 | void psiconv_free_sheet_grid_break_list(psiconv_sheet_grid_break_list list) |
|
|
673 | { |
|
|
674 | if (list) |
|
|
675 | psiconv_list_free(list); |
|
|
676 | } |
|
|
677 | |
|
|
678 | void psiconv_free_sheet_grid_size(psiconv_sheet_grid_size s) |
|
|
679 | { |
|
|
680 | if (s) |
|
|
681 | free(s); |
|
|
682 | } |
|
|
683 | |
|
|
684 | void psiconv_free_sheet_grid_size_list(psiconv_sheet_grid_size_list list) |
|
|
685 | { |
|
|
686 | if (list) |
|
|
687 | psiconv_list_free(list); |
|
|
688 | } |
|
|
689 | |
|
|
690 | void psiconv_free_sheet_grid_section(psiconv_sheet_grid_section sec) |
|
|
691 | { |
|
|
692 | if (sec) { |
|
|
693 | psiconv_free_sheet_grid_size_list(sec->row_heights); |
|
|
694 | psiconv_free_sheet_grid_size_list(sec->column_heights); |
|
|
695 | psiconv_free_sheet_grid_break_list(sec->row_page_breaks); |
|
|
696 | psiconv_free_sheet_grid_break_list(sec->column_page_breaks); |
|
|
697 | free(sec); |
|
|
698 | } |
638 | } |
699 | } |
639 | |
700 | |
640 | void psiconv_free_sheet_worksheet_aux (void *data) |
701 | void psiconv_free_sheet_worksheet_aux (void *data) |
641 | { |
702 | { |
642 | psiconv_sheet_worksheet section = data; |
703 | psiconv_sheet_worksheet section = data; |
643 | psiconv_free_sheet_cell_layout(section->default_layout); |
704 | psiconv_free_sheet_cell_layout(section->default_layout); |
644 | psiconv_free_sheet_cell_list(section->cells); |
705 | psiconv_free_sheet_cell_list(section->cells); |
645 | psiconv_free_sheet_line_list(section->row_default_layouts); |
706 | psiconv_free_sheet_line_list(section->row_default_layouts); |
646 | psiconv_free_sheet_line_list(section->col_default_layouts); |
707 | psiconv_free_sheet_line_list(section->col_default_layouts); |
|
|
708 | psiconv_free_sheet_grid_section(section->grid); |
647 | } |
709 | } |
648 | |
710 | |
649 | void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet) |
711 | void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet) |
650 | { |
712 | { |
651 | if (sheet) { |
713 | if (sheet) { |