From: Kristian Høgsberg Date: Wed, 6 Apr 2005 03:48:58 +0000 (+0000) Subject: Fix of by one errors. X-Git-Tag: EVINCE_0_2_0~2 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=8e19cbbce0b1860b2fdb5bb4453fc30601bea96b;p=evince.git Fix of by one errors. 2005-04-05 Kristian Høgsberg * 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. --- diff --git a/ChangeLog b/ChangeLog index 3ca29d84..8d83d0c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-04-05 Kristian Høgsberg + + * 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 * ps/ps-document.c: (get_page_box): diff --git a/backend/ev-page-cache.c b/backend/ev-page-cache.c index 7960cb43..7f6622a8 100644 --- a/backend/ev-page-cache.c +++ b/backend/ev-page-cache.c @@ -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); diff --git a/shell/ev-window.c b/shell/ev-window.c index 64b072e1..92e68f4b 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -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