/[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 69 Revision 78
623 else if (file->type == psiconv_clipart_file) 623 else if (file->type == psiconv_clipart_file)
624 psiconv_free_clipart_f((psiconv_clipart_f) file->file); 624 psiconv_free_clipart_f((psiconv_clipart_f) file->file);
625 free(file); 625 free(file);
626 } 626 }
627} 627}
628
629int psiconv_compare_color(const psiconv_color value1,
630 const psiconv_color value2)
631{
632 if (!value1 || !value2)
633 return 1;
634 if ((value1->red == value2->red) &&
635 (value1->green == value2->green) &&
636 (value1->blue == value2->blue))
637 return 0;
638 else
639 return 1;
640}
641
642int psiconv_compare_font(const psiconv_font value1,
643 const psiconv_font value2)
644{
645 if (!value1 || !value2 || !value1->name || !value2->name)
646 return 1;
647 if ((value1->screenfont == value2->screenfont) &&
648 !strcmp(value1->name,value2->name))
649 return 0;
650 else
651 return 1;
652}
653
654int psiconv_compare_border(const psiconv_border value1,
655 const psiconv_border value2)
656{
657 if (!value1 || !value2)
658 return 1;
659 if ((value1->kind == value2->kind) &&
660 (value1->thickness == value2->thickness) &&
661 !psiconv_compare_color(value1->color,value2->color))
662 return 0;
663 else
664 return 1;
665}
666
667int psiconv_compare_bullet(const psiconv_bullet value1,
668 const psiconv_bullet value2)
669{
670 if (!value1 || !value2)
671 return 1;
672 if ((value1->on == value2->on) &&
673 (value1->font_size == value2->font_size) &&
674 (value1->character == value2->character) &&
675 (value1->indent == value2->indent) &&
676 !psiconv_compare_color(value1->color,value2->color) &&
677 !psiconv_compare_font(value1->font,value2->font))
678 return 0;
679 else
680 return 1;
681}
682
683int psiconv_compare_tab(const psiconv_tab value1, const psiconv_tab value2)
684{
685 if (!value1 || !value2)
686 return 1;
687 if ((value1->location == value2->location) &&
688 (value1->kind == value2->kind))
689 return 0;
690 else
691 return 1;
692}
693
694int psiconv_compare_all_tabs(const psiconv_all_tabs value1,
695 const psiconv_all_tabs value2)
696{
697 int i;
698
699 if (!value1 || !value2 || !value1->extras || !value2->extras)
700 return 1;
701
702 if ((value1->normal != value2->normal) ||
703 psiconv_list_length(value1->extras) !=
704 psiconv_list_length(value2->extras))
705 return 1;
706 for (i = 0; i < psiconv_list_length(value1->extras); i++)
707 if (psiconv_compare_tab(psiconv_list_get(value1->extras,i),
708 psiconv_list_get(value2->extras,i)))
709
710 return 1;
711 return 0;
712}
713
714int psiconv_compare_paragraph_layout(const psiconv_paragraph_layout value1,
715 const psiconv_paragraph_layout value2)
716{
717 if (!value1 || !value2)
718 return 1;
719 if ((value1->indent_left == value2->indent_left) &&
720 (value1->indent_right == value2->indent_right) &&
721 (value1->indent_first == value2->indent_first) &&
722 (value1->justify_hor == value2->justify_hor) &&
723 (value1->justify_ver == value2->justify_ver) &&
724 (value1->linespacing == value2->linespacing) &&
725 (value1->space_above == value2->space_above) &&
726 (value1->space_below == value2->space_below) &&
727 (value1->keep_together == value2->keep_together) &&
728 (value1->keep_with_next == value2->keep_with_next) &&
729 (value1->on_next_page == value2->on_next_page) &&
730 (value1->no_widow_protection == value2->no_widow_protection) &&
731 (value1->border_distance == value2->border_distance) &&
732 !psiconv_compare_color(value1->back_color,value2->back_color) &&
733 !psiconv_compare_bullet(value1->bullet,value2->bullet) &&
734 !psiconv_compare_border(value1->left_border,value2->left_border) &&
735 !psiconv_compare_border(value1->right_border,value2->right_border) &&
736 !psiconv_compare_border(value1->top_border,value2->top_border) &&
737 !psiconv_compare_border(value1->bottom_border,value2->bottom_border) &&
738 !psiconv_compare_all_tabs(value1->tabs,value2->tabs))
739 return 0;
740 else
741 return 1;
742}
743
744
745int psiconv_compare_character_layout(const psiconv_character_layout value1,
746 const psiconv_character_layout value2)
747{
748 if (!value1 || !value2)
749 return 1;
750 if ((value1->font_size == value2->font_size) &&
751 (value1->italic == value2->italic) &&
752 (value1->bold == value2->bold) &&
753 (value1->super_sub == value2->super_sub) &&
754 (value1->underline == value2->underline) &&
755 (value1->strikethrough == value2->strikethrough) &&
756 !psiconv_compare_color(value1->color,value2->color) &&
757 !psiconv_compare_color(value1->back_color,value2->back_color) &&
758 !psiconv_compare_font(value1->font,value2->font))
759 return 0;
760 else
761 return 1;
762}

Legend:
Removed from v.69  
changed lines
  Added in v.78

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