From 6f9c323060b20673516f786ff19443779f551fae Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 22 Apr 2005 17:23:22 +0000 Subject: [PATCH] Fix find on single page documents 2005-04-22 Marco Pesenti Gritti * pdf/ev-poppler.cc: * shell/ev-view.c: (highlight_find_results): Fix find on single page documents --- ChangeLog | 7 +++++++ pdf/ev-poppler.cc | 9 ++++----- shell/ev-view.c | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index f28db3dd..f46e8467 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-04-22 Marco Pesenti Gritti + + * pdf/ev-poppler.cc: + * shell/ev-view.c: (highlight_find_results): + + Fix find on single page documents + 2005-04-22 Bryan Clark * data/evince.schemas.in: fix for bug 301390 diff --git a/pdf/ev-poppler.cc b/pdf/ev-poppler.cc index d20acb04..7b55b08c 100644 --- a/pdf/ev-poppler.cc +++ b/pdf/ev-poppler.cc @@ -659,7 +659,7 @@ pdf_document_search_idle_callback (void *data) { PdfDocumentSearch *search = (PdfDocumentSearch*) data; PdfDocument *pdf_document = search->document; - int n_pages, changed_page; + int n_pages; GList *matches; PopplerPage *page; @@ -671,9 +671,10 @@ pdf_document_search_idle_callback (void *data) ev_document_doc_mutex_unlock (); search->pages[search->search_page] = matches; - n_pages = pdf_document_get_n_pages (EV_DOCUMENT (search->document)); + ev_document_find_changed (EV_DOCUMENT_FIND (pdf_document), + search->search_page); - changed_page = search->search_page; + n_pages = pdf_document_get_n_pages (EV_DOCUMENT (search->document)); search->search_page += 1; if (search->search_page == n_pages) { /* wrap around */ @@ -681,8 +682,6 @@ pdf_document_search_idle_callback (void *data) } if (search->search_page != search->start_page) { - ev_document_find_changed (EV_DOCUMENT_FIND (pdf_document), - changed_page); return TRUE; } diff --git a/shell/ev-view.c b/shell/ev-view.c index 796aaddb..b9d9ab23 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -537,11 +537,11 @@ highlight_find_results (EvView *view) g_return_if_fail (EV_IS_DOCUMENT_FIND (view->document)); find = EV_DOCUMENT_FIND (view->document); -#if 0 + ev_document_doc_mutex_lock (); results = ev_document_find_get_n_results (find, view->current_page); ev_document_doc_mutex_unlock (); -#endif + for (i = 0; i < results; i++) { EvRectangle rectangle; GdkRectangle view_rectangle; -- 2.43.5