[evince/collembola_bug: 11/11] text search: if match not in page keep looking for others




commit 30a720557d14fe22057d55a861300940edd8f8e6
Author: Nelson Benítez León <nbenitezl gmail com>
Date:   Sun Jan 24 14:31:55 2021 -0400

    text search: if match not in page keep looking for others
    
    It may happen that a vertical text match has
    no corresponding text area, skip that but keep
    iterating to show any other matches in page.
    
    Issue #1545

 shell/ev-find-sidebar.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/shell/ev-find-sidebar.c b/shell/ev-find-sidebar.c
index 25b1d842..04a63586 100644
--- a/shell/ev-find-sidebar.c
+++ b/shell/ev-find-sidebar.c
@@ -492,13 +492,17 @@ process_matches_idle (EvFindSidebar *sidebar)
                         EvRectangle *match = (EvRectangle *)l->data;
                         gchar       *markup;
                         GtkTreeIter  iter;
+                        gint         new_offset;
 
-                        offset = get_match_offset (areas, n_areas, match, offset);
-                        if (offset == -1) {
+                        new_offset = get_match_offset (areas, n_areas, match, offset);
+                        if (new_offset == -1) {
                                 g_warning ("No offset found for match \"%s\" at page %d after processing %d 
results\n",
                                            priv->job->text, current_page, result);
-                                break;
+                                /* It may happen that a vertical text match has no corresponding text area, 
skip
+                                 * that but keep iterating to show any other matches in page (issue #1545) */
+                                continue;
                         }
+                        offset = new_offset;
 
                         if (current_page >= priv->job->start_page) {
                                 gtk_list_store_append (GTK_LIST_STORE (model), &iter);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]