]> www.fi.muni.cz Git - evince.git/commitdiff
Fix of by one errors.
authorKristian Høgsberg <krh@redhat.com>
Wed, 6 Apr 2005 03:48:58 +0000 (03:48 +0000)
committerKristian Høgsberg <krh@src.gnome.org>
Wed, 6 Apr 2005 03:48:58 +0000 (03:48 +0000)
2005-04-05  Kristian Høgsberg  <krh@redhat.com>

        * backend/ev-page-cache.c (ev_page_cache_next_page):
        * shell/ev-window.c (ev_window_cmd_go_next_page)
        (ev_window_cmd_go_first_page): Fix of by one errors.

ChangeLog
backend/ev-page-cache.c
shell/ev-window.c

index 3ca29d8418bffe9cbe518451334f2a15a99f0fe5..8d83d0c5855d6d2e4111821b234a4ab96e390097 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-05  Kristian Høgsberg  <krh@redhat.com>
+
+       * backend/ev-page-cache.c (ev_page_cache_next_page): 
+       * shell/ev-window.c (ev_window_cmd_go_next_page) 
+       (ev_window_cmd_go_first_page): Fix of by one errors.
+
 2005-04-05  Marco Pesenti Gritti <mpg@redhat.com>
 
        * ps/ps-document.c: (get_page_box):
index 7960cb43be9535670bd439f74b7fd3d89b72be81..7f6622a853a5e0c6e481d8353d3f40f37828ea47 100644 (file)
@@ -290,7 +290,7 @@ ev_page_cache_next_page (EvPageCache *page_cache)
 {
        g_return_val_if_fail (EV_IS_PAGE_CACHE (page_cache), FALSE);
 
-       if (page_cache->current_page > page_cache->n_pages)
+       if (page_cache->current_page >= page_cache->n_pages)
                return FALSE;
 
        ev_page_cache_set_current_page (page_cache, page_cache->current_page + 1);
index 64b072e13d95be89a46060899be5a15d77029ab6..92e68f4b45f10893c84877a269b3c3455ada6c56 100644 (file)
@@ -1491,7 +1491,7 @@ ev_window_cmd_go_first_page (GtkAction *action, EvWindow *ev_window)
 {
         g_return_if_fail (EV_IS_WINDOW (ev_window));
 
-       ev_page_cache_set_current_page (ev_window->priv->page_cache, 1);
+       ev_page_cache_set_current_page (ev_window->priv->page_cache, 0);
 }
 
 static void
@@ -1502,7 +1502,7 @@ ev_window_cmd_go_last_page (GtkAction *action, EvWindow *ev_window)
         g_return_if_fail (EV_IS_WINDOW (ev_window));
 
        n_pages = ev_page_cache_get_n_pages (ev_window->priv->page_cache);
-       ev_page_cache_set_current_page (ev_window->priv->page_cache, n_pages);
+       ev_page_cache_set_current_page (ev_window->priv->page_cache, n_pages - 1);
 }
 
 static void