- gint i;
- gint cx = 0;
-
- if (x < 0) return -1;
- for (i = 0;
- i < g_sheet_column_get_column_count (sheet->column_geometry); i++)
- {
- if (x >= cx &&
- x <= (cx + g_sheet_column_get_width (sheet->column_geometry, i)))
- return i;
-
- cx += g_sheet_column_get_width (sheet->column_geometry, i);
- }
-
- /* no match */
- return g_sheet_column_get_column_count (sheet->column_geometry) - 1;