From bfccd5b470c3bcc0d23d619e9c0d93f0fdc80cce Mon Sep 17 00:00:00 2001
From: Christopher James Lahey <clahey@ximian.com>
Date: Fri, 14 Jun 2002 22:26:43 +0000
Subject: Don't draw or interact with the popup button if a cell isn't editable

2002-06-14  Christopher James Lahey  <clahey@ximian.com>

	* e-cell-popup.c (ecp_draw, ecp_event): Don't draw or interact
	with the popup button if a cell isn't editable (based on a patch
	by JPR.)

	* e-table-col.c, e-table-col.h: Added the compare_col field to
	this structure.  Added a GtkArg to set it.

	* e-table-column-specification.c, e-table-column-specification.h:
	Added the compare_col field here.  Made it load properly from xml.

	* e-table-sorting-utils.c: Sort based on the compare_col in the
	ETableCol instead of the col_idx.

	* e-table-utils.c (et_col_spec_to_col): Set the compare_col field
	in the ETableCol properly.

	* e-table.c, e-table.h: Removed the drag_get_data_row and
	drag_get_data_col fields since they're not used any longer.
	(e_table_construct): If specification loading fails, return a NULL
	ETable instead of just ignoring it.
	(e_table_drag_highlight): Only destroy table->drop_highlight if it
	exists.

svn path=/trunk/; revision=17190
---
 widgets/table/e-table-sorting-utils.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'widgets/table/e-table-sorting-utils.c')

diff --git a/widgets/table/e-table-sorting-utils.c b/widgets/table/e-table-sorting-utils.c
index fac9666384..80a9564a36 100644
--- a/widgets/table/e-table-sorting-utils.c
+++ b/widgets/table/e-table-sorting-utils.c
@@ -43,8 +43,8 @@ etsu_compare(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_
 		col = e_table_header_get_column_by_col_idx(full_header, column.column);
 		if (col == NULL)
 			col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
-		comp_val = (*col->compare)(e_table_model_value_at (source, col->col_idx, row1),
-					   e_table_model_value_at (source, col->col_idx, row2));
+		comp_val = (*col->compare)(e_table_model_value_at (source, col->compare_col, row1),
+					   e_table_model_value_at (source, col->compare_col, row2));
 		ascending = column.ascending;
 		if (comp_val != 0)
 			break;
@@ -133,7 +133,7 @@ e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETabl
 		if (col == NULL)
 			col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
 		for (i = 0; i < rows; i++) {
-			closure.vals[map_table[i] * cols + j] = e_table_model_value_at (source, col->col_idx, map_table[i]);
+			closure.vals[map_table[i] * cols + j] = e_table_model_value_at (source, col->compare_col, map_table[i]);
 		}
 		closure.compare[j] = col->compare;
 		closure.ascending[j] = column.ascending;
@@ -167,7 +167,7 @@ e_table_sorting_utils_affects_sort  (ETableSortInfo *sort_info,
 		tablecol = e_table_header_get_column_by_col_idx(full_header, column.column);
 		if (tablecol == NULL)
 			tablecol = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
-		if (col == tablecol->col_idx)
+		if (col == tablecol->compare_col)
 			return TRUE;
 	}
 	return FALSE;
@@ -229,8 +229,8 @@ etsu_tree_compare(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *f
 		col = e_table_header_get_column_by_col_idx(full_header, column.column);
 		if (col == NULL)
 			col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
-		comp_val = (*col->compare)(e_tree_model_value_at (source, path1, col->col_idx),
-					   e_tree_model_value_at (source, path2, col->col_idx));
+		comp_val = (*col->compare)(e_tree_model_value_at (source, path1, col->compare_col),
+					   e_tree_model_value_at (source, path2, col->compare_col));
 		ascending = column.ascending;
 		if (comp_val != 0)
 			break;
@@ -281,7 +281,7 @@ e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, E
 			col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
 
 		for (i = 0; i < count; i++) {
-			closure.vals[i * cols + j] = e_tree_model_value_at (source, map_table[i], col->col_idx);
+			closure.vals[i * cols + j] = e_tree_model_value_at (source, map_table[i], col->compare_col);
 		}
 		closure.ascending[j] = column.ascending;
 		closure.compare[j] = col->compare;
-- 
cgit