aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-header.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-02-12 06:08:09 +0800
committerChris Lahey <clahey@src.gnome.org>2000-02-12 06:08:09 +0800
commit4a25f612c0fb701a774d20c19888957c555e54a2 (patch)
tree0e0f46269cd0522aaa793ef5552ec499d0613176 /widgets/table/e-table-header.c
parent4a7411c370d573842a35354f88201a29f180aad0 (diff)
downloadgsoc2013-evolution-4a25f612c0fb701a774d20c19888957c555e54a2.tar
gsoc2013-evolution-4a25f612c0fb701a774d20c19888957c555e54a2.tar.gz
gsoc2013-evolution-4a25f612c0fb701a774d20c19888957c555e54a2.tar.bz2
gsoc2013-evolution-4a25f612c0fb701a774d20c19888957c555e54a2.tar.lz
gsoc2013-evolution-4a25f612c0fb701a774d20c19888957c555e54a2.tar.xz
gsoc2013-evolution-4a25f612c0fb701a774d20c19888957c555e54a2.tar.zst
gsoc2013-evolution-4a25f612c0fb701a774d20c19888957c555e54a2.zip
Added reordering of columns.
2000-02-11 Christopher James Lahey <clahey@helixcode.com> * e-table-header-item.h, e-table-header-item.c: Added reordering of columns. * e-table-header.c: Fixed a couple of bugs in the move column and remove column functions. svn path=/trunk/; revision=1736
Diffstat (limited to 'widgets/table/e-table-header.c')
-rw-r--r--widgets/table/e-table-header.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c
index 7c54bd936e..2147869678 100644
--- a/widgets/table/e-table-header.c
+++ b/widgets/table/e-table-header.c
@@ -100,9 +100,10 @@ e_table_header_new (void)
static void
eth_do_insert (ETableHeader *eth, int pos, ETableCol *val)
{
- memcpy (&eth->columns [pos+1], &eth->columns [pos],
+ memmove (&eth->columns [pos+1], &eth->columns [pos],
sizeof (ETableCol *) * (eth->col_count - pos));
eth->columns [pos] = val;
+ eth->col_count ++;
}
static void
@@ -139,7 +140,6 @@ e_table_header_add_column (ETableHeader *eth, ETableCol *tc, int pos)
gtk_object_sink (GTK_OBJECT (tc));
eth_do_insert (eth, pos, tc);
- eth->col_count++;
eth_update_offsets (eth);
gtk_signal_emit (GTK_OBJECT (eth), eth_signals [STRUCTURE_CHANGE]);
@@ -261,7 +261,7 @@ eth_do_remove (ETableHeader *eth, int idx, gboolean do_unref)
if (do_unref)
gtk_object_unref (GTK_OBJECT (eth->columns [idx]));
- memcpy (&eth->columns [idx], &eth->columns [idx+1],
+ memmove (&eth->columns [idx], &eth->columns [idx+1],
sizeof (ETableCol *) * eth->col_count - idx);
eth->col_count--;
}