diff options
Diffstat (limited to 'widgets/table/e-table.c')
-rw-r--r-- | widgets/table/e-table.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index 110d7a25e5..e730dabbc7 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -342,7 +342,7 @@ check_row (ETable *et, int model_row, int col, ETableSearchFunc search, char *st } static gboolean -et_search_search (ETableSearch *search, char *string, ETable *et) +et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, ETable *et) { int cursor; int rows; @@ -362,6 +362,9 @@ et_search_search (ETableSearch *search, char *string, ETable *et) "cursor_row", &cursor, NULL); + if ((flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST) && cursor < rows && cursor >= 0 && check_row (et, cursor, col, search_func, string)) + return TRUE; + cursor = e_sorter_model_to_sorted (E_SORTER (et->sorter), cursor); for (i = cursor + 1; i < rows; i++) { @@ -383,7 +386,7 @@ et_search_search (ETableSearch *search, char *string, ETable *et) cursor = e_sorter_sorted_to_model (E_SORTER (et->sorter), cursor); /* Check if the cursor row is the only matching row. */ - return (cursor < rows && cursor >= 0 && check_row (et, cursor, col, search_func, string)); + return (!(flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST) && cursor < rows && cursor >= 0 && check_row (et, cursor, col, search_func, string)); } static void |