aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-header.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/table/e-table-header.c')
-rw-r--r--widgets/table/e-table-header.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c
index 6c1431863a..3f2a363c94 100644
--- a/widgets/table/e-table-header.c
+++ b/widgets/table/e-table-header.c
@@ -373,6 +373,29 @@ e_table_header_get_column (ETableHeader *eth, int column)
}
/**
+ * e_table_header_get_column_by_col_id:
+ * @eth: the ETableHeader to query
+ * @col_id: the col_id to search for.
+ *
+ * Returns: The ETableCol with col_idx = @col_idx in the @eth object
+ */
+ETableCol *
+e_table_header_get_column_by_col_idx (ETableHeader *eth, int col_idx)
+{
+ int i;
+ g_return_val_if_fail (eth != NULL, NULL);
+ g_return_val_if_fail (E_IS_TABLE_HEADER (eth), NULL);
+
+ for (i = 0; i < eth->col_count; i++) {
+ if (eth->columns[i]->col_idx == col_idx) {
+ return eth->columns [i];
+ }
+ }
+
+ return NULL;
+}
+
+/**
* e_table_header_count:
* @eth: the ETableHeader to query
*