Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2005-02-04 12:18:26 (GMT)
committer Marco Pesenti Gritti <marco@src.gnome.org>2005-02-04 12:18:26 (GMT)
commit1cb865554fcb40760784a30c7700b6a751567762 (patch)
tree38864ca275068726b29186065f5546ae5a8dd267 /shell
parent826131fb75fadb602b375ba29e593d1e0ab3dde8 (diff)
Fix several bugs with find
2005-02-04 Marco Pesenti Gritti <marco@gnome.org> * backend/ev-document-find.c: (ev_document_find_changed): * backend/ev-document-find.h: * pdf/xpdf/pdf-document.cc: * shell/ev-view.c: (jump_to_find_result), (ev_view_set_document): * shell/ev-window.c: (find_bar_search_changed_cb): Fix several bugs with find
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-view.c20
-rw-r--r--shell/ev-window.c1
2 files changed, 14 insertions, 7 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c
index a5fc7ce..6d071a9 100644
--- a/shell/ev-view.c
+++ b/shell/ev-view.c
@@ -1018,11 +1018,17 @@ ensure_rectangle_is_visible (EvView *view, GdkRectangle *rect)
static void
jump_to_find_result (EvView *view)
{
+ EvDocumentFind *find = EV_DOCUMENT_FIND (view->document);
GdkRectangle rect;
+ int n_results;
+
+ n_results = ev_document_find_get_n_results (find);
- ev_document_find_get_result (EV_DOCUMENT_FIND (view->document),
- view->find_result, &rect);
- ensure_rectangle_is_visible (view, &rect);
+ if (n_results > view->find_result) {
+ ev_document_find_get_result
+ (find, view->find_result, &rect);
+ ensure_rectangle_is_visible (view, &rect);
+ }
}
static void
@@ -1090,9 +1096,8 @@ ev_view_set_document (EvView *view,
if (document != view->document) {
if (view->document) {
- g_signal_handlers_disconnect_by_func (view->document,
- find_changed_cb,
- view);
+ g_signal_handlers_disconnect_by_func
+ (view->document, find_changed_cb, view);
g_object_unref (view->document);
}
@@ -1102,11 +1107,12 @@ ev_view_set_document (EvView *view,
if (view->document) {
g_object_ref (view->document);
- if (EV_IS_DOCUMENT_FIND (view->document))
+ if (EV_IS_DOCUMENT_FIND (view->document)) {
g_signal_connect (view->document,
"find_changed",
G_CALLBACK (find_changed_cb),
view);
+ }
g_signal_connect (view->document,
"changed",
G_CALLBACK (document_changed_callback),
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 01c4f8a..368919a 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1384,6 +1384,7 @@ find_bar_search_changed_cb (EggFindBar *find_bar,
ev_document_find_cancel (EV_DOCUMENT_FIND (ev_window->priv->document));
egg_find_bar_set_status_text (EGG_FIND_BAR (ev_window->priv->find_bar),
NULL);
+ gtk_widget_queue_draw (GTK_WIDGET (ev_window->priv->view));
}
}
}