diff options
author | Not Zed <NotZed@Ximian.com> | 2002-02-26 10:27:22 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-02-26 10:27:22 +0800 |
commit | 1b00ce5ca9b8a7c3a0cf0d96579aa04aad5e0820 (patch) | |
tree | 774eb5e2210876050674433cdaa18aad875060d4 /filter/filter-part.c | |
parent | 43a998d8cba35528f094d206b23084e114353e12 (diff) | |
download | gsoc2013-evolution-1b00ce5ca9b8a7c3a0cf0d96579aa04aad5e0820.tar.gz gsoc2013-evolution-1b00ce5ca9b8a7c3a0cf0d96579aa04aad5e0820.tar.zst gsoc2013-evolution-1b00ce5ca9b8a7c3a0cf0d96579aa04aad5e0820.zip |
Copy values across to new part.
2002-02-26 Not Zed <NotZed@Ximian.com>
* filter-filter.c (option_activate): Copy values across to new
part.
* filter-rule.c (option_activate): copy values across to new part,
if they are compatible.
* filter-element.c (filter_element_copy_value): New function to
copy values (where they can be) from one filter element to another.
* filter-part.c (filter_part_copy_values): New function to copy
values of a filter part. #1359.
svn path=/trunk/; revision=15841
Diffstat (limited to 'filter/filter-part.c')
-rw-r--r-- | filter/filter-part.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/filter/filter-part.c b/filter/filter-part.c index 15e78b77b8..e92c42aafb 100644 --- a/filter/filter-part.c +++ b/filter/filter-part.c @@ -273,6 +273,36 @@ filter_part_clone (FilterPart *fp) return new; } +/* only copies values of matching parts in the right order */ +void +filter_part_copy_values (FilterPart *dst, FilterPart *src) +{ + GList *dstl, *srcl, *dstt; + FilterElement *de, *se; + + /* NOTE: we go backwards, it just works better that way */ + + /* for each source type, search the dest type for + a matching type in the same order */ + srcl = g_list_last(src->elements); + dstl = g_list_last(dst->elements); + while (srcl && dstl) { + se = srcl->data; + dstt = dstl; + while (dstt) { + de = dstt->data; + if (((GtkObject *)de)->klass == ((GtkObject *)se)->klass) { + filter_element_copy_value(de, se); + dstl = dstt->prev; + break; + } + dstt = dstt->prev; + } + + srcl = srcl->prev; + } +} + FilterElement * filter_part_find_element (FilterPart *ff, const char *name) { |