From d4311e9d07fca361e09bedffd0fdc3209aa30fd6 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 4 Feb 2005 14:31:03 +0000 Subject: [PATCH] Clamp page number, dont try to move to not existant pages. 2005-02-04 Marco Pesenti Gritti * TODO: * shell/ev-view.c: (set_document_page): Clamp page number, dont try to move to not existant pages. --- ChangeLog | 8 ++++++++ TODO | 6 +++--- shell/ev-view.c | 8 +++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c32c7a8b..0224ec0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-02-04 Marco Pesenti Gritti + + * TODO: + * shell/ev-view.c: (set_document_page): + + Clamp page number, dont try to move to + not existant pages. + 2005-02-04 Marco Pesenti Gritti * backend/ev-document-find.c: (ev_document_find_changed): diff --git a/TODO b/TODO index 65c5dd1f..4e6ef58b 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,6 @@ Hook up recent documents support (though rumors are that it's slow) Improve Find system - Find Next/Previous don't go to other pages - Find Next/Previous doesn't focus the results Display location of results in thumbnails? Only display thumbnails of pages found? @@ -37,4 +35,6 @@ Move to having three sizing types: Create a TODO list Create a project page (http://www.gnome.org/projects/evince/) Encrypted PDF support - +Improve Find system + Find Next/Previous don't go to other pages + Find Next/Previous doesn't focus the results diff --git a/shell/ev-view.c b/shell/ev-view.c index 6d071a9d..68767d4a 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -944,8 +944,14 @@ update_find_status_message (EvView *view) } static void -set_document_page (EvView *view, int page) +set_document_page (EvView *view, int new_page) { + int page; + int pages; + + pages = ev_document_get_n_pages (view->document); + page = CLAMP (new_page, 1, pages); + if (view->document) { int old_page = ev_document_get_page (view->document); int old_width, old_height; -- 2.43.0