void graphic_format_properties::apply_from(const graphic_format_properties * Other)
{
	if (Other == NULL) return;

	_CP_APPLY_PROP3(draw_stroke_); 
	_CP_APPLY_PROP3(draw_stroke_dash_); 
	_CP_APPLY_PROP3(draw_marker_start_); 
	_CP_APPLY_PROP3(draw_marker_end_); 
	_CP_APPLY_PROP3(draw_textarea_horizontal_align_); 
	_CP_APPLY_PROP3(draw_textarea_vertical_align_); 
	_CP_APPLY_PROP3(draw_auto_grow_height_);
	_CP_APPLY_PROP3(draw_auto_grow_width_);
	_CP_APPLY_PROP3(draw_fit_to_size_);
	_CP_APPLY_PROP3(draw_fit_to_contour_);
	
	_CP_APPLY_PROP3(svg_stroke_color_); 
	_CP_APPLY_PROP3(svg_stroke_width_);	
	_CP_APPLY_PROP3(svg_stroke_opacity_); 
	
	_CP_APPLY_PROP3(fo_min_width_);
    _CP_APPLY_PROP3(fo_min_height_);
    _CP_APPLY_PROP3(fo_max_width_);
    _CP_APPLY_PROP3(fo_max_height_);
	_CP_APPLY_PROP3(fo_wrap_option_);

    _CP_APPLY_PROP3(style_print_content_);
    _CP_APPLY_PROP3(style_protect_);
	_CP_APPLY_PROP3(style_editable_);
    _CP_APPLY_PROP3(style_wrap_);
    _CP_APPLY_PROP3(style_wrap_dynamic_treshold_);
    _CP_APPLY_PROP3(style_number_wrapped_paragraphs_);
    _CP_APPLY_PROP3(style_wrap_contour_);
    _CP_APPLY_PROP3(style_wrap_contour_mode_);
    _CP_APPLY_PROP3(style_run_through_); 
    _CP_APPLY_PROP3(style_flow_with_text_);
    _CP_APPLY_PROP3(style_overflow_behavior_);
    _CP_APPLY_PROP3(style_mirror_);
    _CP_APPLY_PROP3(fo_clip_);
    _CP_APPLY_PROP3(draw_wrap_influence_on_position_);

    common_draw_fill_attlist_.apply_from		(Other->common_draw_fill_attlist_);
    common_draw_rel_size_attlist_.apply_from	(Other->common_draw_rel_size_attlist_);
    common_horizontal_margin_attlist_.apply_from(Other->common_horizontal_margin_attlist_);
    common_vertical_margin_attlist_.apply_from	(Other->common_vertical_margin_attlist_);
    common_margin_attlist_.apply_from			(Other->common_margin_attlist_);    
    common_horizontal_pos_attlist_.apply_from	(Other->common_horizontal_pos_attlist_);
    common_horizontal_rel_attlist_.apply_from	(Other->common_horizontal_rel_attlist_);
    common_vertical_pos_attlist_.apply_from		(Other->common_vertical_pos_attlist_);
    common_vertical_rel_attlist_.apply_from		(Other->common_vertical_rel_attlist_);
    common_text_anchor_attlist_.apply_from		(Other->common_text_anchor_attlist_);
    common_border_attlist_.apply_from			(Other->common_border_attlist_);
    common_border_line_width_attlist_.apply_from(Other->common_border_line_width_attlist_);
    common_padding_attlist_.apply_from			(Other->common_padding_attlist_);
    common_shadow_attlist_.apply_from			(Other->common_shadow_attlist_);
    common_background_color_attlist_.apply_from	(Other->common_background_color_attlist_);
     

    _CP_APPLY_PROP(style_background_image_,	Other->style_background_image_);
}
void paragraph_format_properties::apply_from(const paragraph_format_properties & Other)
{
    apply_line_width(fo_line_height_, Other.fo_line_height_);
    _CP_APPLY_PROP(style_line_height_at_least_, Other.style_line_height_at_least_);
    _CP_APPLY_PROP(style_line_spacing_, Other.style_line_spacing_);
    _CP_APPLY_PROP(style_font_independent_line_spacing_, Other.style_font_independent_line_spacing_);
    _CP_APPLY_PROP(fo_text_align_, Other.fo_text_align_);
    _CP_APPLY_PROP(fo_text_align_last_, Other.fo_text_align_last_);
    _CP_APPLY_PROP(style_justify_single_word_, Other.style_justify_single_word_);
    _CP_APPLY_PROP(fo_keep_together_, Other.fo_keep_together_);
    _CP_APPLY_PROP(fo_widows_, Other.fo_widows_);
    _CP_APPLY_PROP(fo_orphans_, Other.fo_orphans_);

    // TODO
    _CP_APPLY_PROP(style_tab_stops_, Other.style_tab_stops_);

    _CP_APPLY_PROP(style_tab_stop_distance_, Other.style_tab_stop_distance_);
    _CP_APPLY_PROP(fo_hyphenation_keep_, Other.fo_hyphenation_keep_);
    _CP_APPLY_PROP(fo_hyphenation_ladder_count_, Other.fo_hyphenation_ladder_count_);
    
    // TODO
    _CP_APPLY_PROP(style_drop_cap_, Other.style_drop_cap_);
    
    _CP_APPLY_PROP(style_register_true_, Other.style_register_true_);
    apply_length_or_percent(fo_margin_left_, Other.fo_margin_left_);
    apply_length_or_percent(fo_margin_right_, Other.fo_margin_right_);
    apply_length_or_percent(fo_text_indent_, Other.fo_text_indent_);

    _CP_APPLY_PROP(style_auto_text_indent_, Other.style_auto_text_indent_);

    apply_length_or_percent(fo_margin_top_, Other.fo_margin_top_);
    apply_length_or_percent(fo_margin_bottom_, Other.fo_margin_bottom_);
    apply_length_or_percent(fo_margin_, Other.fo_margin_);
    
    _CP_APPLY_PROP(fo_break_before_, Other.fo_break_before_);
    _CP_APPLY_PROP(fo_break_after_, Other.fo_break_after_);

    _CP_APPLY_PROP(fo_background_color_, Other.fo_background_color_);

    _CP_APPLY_PROP(style_background_image_, Other.style_background_image_);

    _CP_APPLY_PROP(fo_border_, Other.fo_border_);
    _CP_APPLY_PROP(fo_border_top_, Other.fo_border_top_);
    _CP_APPLY_PROP(fo_border_bottom_, Other.fo_border_bottom_);
    _CP_APPLY_PROP(fo_border_left_, Other.fo_border_left_);
    _CP_APPLY_PROP(fo_border_right_, Other.fo_border_right_);
    _CP_APPLY_PROP(style_border_line_width_, Other.style_border_line_width_);
    _CP_APPLY_PROP(style_border_line_width_top_, Other.style_border_line_width_top_);
    _CP_APPLY_PROP(style_border_line_width_bottom_, Other.style_border_line_width_bottom_);
    _CP_APPLY_PROP(style_border_line_width_left_, Other.style_border_line_width_left_);
    _CP_APPLY_PROP(style_border_line_width_right_, Other.style_border_line_width_right_);
    _CP_APPLY_PROP(fo_padding_, Other.fo_padding_);
    _CP_APPLY_PROP(fo_padding_top_, Other.fo_padding_top_);
    _CP_APPLY_PROP(fo_padding_bottom_, Other.fo_padding_bottom_);
    _CP_APPLY_PROP(fo_padding_left_, Other.fo_padding_left_);
    _CP_APPLY_PROP(fo_padding_right_, Other.fo_padding_right_);
    _CP_APPLY_PROP(style_shadow_, Other.style_shadow_);
    _CP_APPLY_PROP(fo_keep_with_next_, Other.fo_keep_with_next_);
    _CP_APPLY_PROP(text_number_lines_, Other.text_number_lines_);
    _CP_APPLY_PROP(text_line_number_, Other.text_line_number_);
    _CP_APPLY_PROP(style_text_autospace_, Other.style_text_autospace_);
    _CP_APPLY_PROP(style_punctuation_wrap_, Other.style_punctuation_wrap_);
    _CP_APPLY_PROP(style_line_break_, Other.style_line_break_);
    _CP_APPLY_PROP(style_vertical_align_, Other.style_vertical_align_);
    _CP_APPLY_PROP(style_writing_mode_, Other.style_writing_mode_);
    _CP_APPLY_PROP(style_writing_mode_automatic_, Other.style_writing_mode_automatic_);
    _CP_APPLY_PROP(style_snap_to_layout_grid_, Other.style_snap_to_layout_grid_);
    _CP_APPLY_PROP(style_page_number_, Other.style_page_number_);
    _CP_APPLY_PROP(style_background_transparency_, Other.style_join_border_);
    _CP_APPLY_PROP(style_join_border_, Other.style_join_border_);
}