diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-12-11 17:56:14 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-12-11 17:56:14 +0800 |
commit | ef46478b1c9801a141e24a8a4b43897ee5b0ff82 (patch) | |
tree | 474c0b677d7f362f33f9e750373ea87f01d73071 /widgets | |
parent | b9cdb00a646854112666c37c48fbda3d29faca08 (diff) | |
download | gsoc2013-evolution-ef46478b1c9801a141e24a8a4b43897ee5b0ff82.tar gsoc2013-evolution-ef46478b1c9801a141e24a8a4b43897ee5b0ff82.tar.gz gsoc2013-evolution-ef46478b1c9801a141e24a8a4b43897ee5b0ff82.tar.bz2 gsoc2013-evolution-ef46478b1c9801a141e24a8a4b43897ee5b0ff82.tar.lz gsoc2013-evolution-ef46478b1c9801a141e24a8a4b43897ee5b0ff82.tar.xz gsoc2013-evolution-ef46478b1c9801a141e24a8a4b43897ee5b0ff82.tar.zst gsoc2013-evolution-ef46478b1c9801a141e24a8a4b43897ee5b0ff82.zip |
Merging changes:
2001-12-05 Christopher James Lahey <clahey@ximian.com>
* e-table-header-item.c (ethi_find_col_by_x,
ethi_find_col_by_x_nearest): Made these return 0 to the left of
all columns and ethi_find_col_by_x return cols - 1 if to the right
of all columns. Fixes Ximian bug #14414.
svn path=/trunk/; revision=14971
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/table/e-table-header-item.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index de0b1bb407..617b438dd9 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -71,6 +71,7 @@ static guint ethi_signals [LAST_SIGNAL] = { 0, }; #define PARENT_OBJECT_TYPE gnome_canvas_item_get_type () #define ELEMENTS(x) (sizeof (x) / sizeof (x[0])) +#define d(x) static GnomeCanvasItemClass *ethi_parent_class; @@ -384,21 +385,28 @@ ethi_find_col_by_x (ETableHeaderItem *ethi, int x) const int cols = e_table_header_count (ethi->eth); int x1 = 0; int col; - - if (x < x1) - return -1; + + d(g_print ("%s:%d: x = %d, x1 = %d\n", __FUNCTION__, __LINE__, x, x1)); x1 += ethi->group_indent_width; + if (x < x1) { + d(g_print ("%s:%d: Returning 0\n", __FUNCTION__, __LINE__)); + return 0; + } + for (col = 0; col < cols; col++){ ETableCol *ecol = e_table_header_get_column (ethi->eth, col); - if ((x >= x1) && (x <= x1 + ecol->width)) + if ((x >= x1) && (x <= x1 + ecol->width)) { + d(g_print ("%s:%d: Returning %d\n", __FUNCTION__, __LINE__, col)); return col; + } x1 += ecol->width; } - return -1; + d(g_print ("%s:%d: Returning %d\n", __FUNCTION__, __LINE__, cols - 1)); + return cols - 1; } static int @@ -408,11 +416,11 @@ ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, int x) int x1 = 0; int col; - if (x < x1) - return -1; - x1 += ethi->group_indent_width; + if (x < x1) + return 0; + for (col = 0; col < cols; col++){ ETableCol *ecol = e_table_header_get_column (ethi->eth, col); |