]> www.fi.muni.cz Git - evince.git/commitdiff
Clamp page number, dont try to move to not existant pages.
authorMarco Pesenti Gritti <marco@gnome.org>
Fri, 4 Feb 2005 14:31:03 +0000 (14:31 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Fri, 4 Feb 2005 14:31:03 +0000 (14:31 +0000)
2005-02-04  Marco Pesenti Gritti  <marco@gnome.org>

        * TODO:
        * shell/ev-view.c: (set_document_page):

        Clamp page number, dont try to move to
        not existant pages.

ChangeLog
TODO
shell/ev-view.c

index c32c7a8b9c667b54ab99169a151074db02ba766b..0224ec0c60c8c9980e2a5366ce59dde63381ca6e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-02-04  Marco Pesenti Gritti  <marco@gnome.org>
+
+       * 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  <marco@gnome.org>
 
        * backend/ev-document-find.c: (ev_document_find_changed):
diff --git a/TODO b/TODO
index 65c5dd1f4039ad87433a6867ac940790fdb33cfd..4e6ef58b6f2d415914997daa824c316f6eea373f 100644 (file)
--- 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
index 6d071a9d71e9e928d6628c2096add49de8033710..68767d4a2bc640c59852fc457d3dee75a3c0c7be 100644 (file)
@@ -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;