From f06e050d41051f1ea95b40981aee32ef8e0b0bae Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sat, 12 Mar 2005 09:56:03 +0000 Subject: [PATCH] Fix the mess we did with thumbnails and 1-basedness 2005-03-12 Marco Pesenti Gritti * pdf/pdf-document.cc: * shell/ev-sidebar-thumbnails.c: (adjustment_changed_cb), (do_one_iteration), (ev_sidebar_thumbnails_set_document): Fix the mess we did with thumbnails and 1-basedness --- ChangeLog | 8 ++++++++ pdf/pdf-document.cc | 7 +++---- shell/ev-sidebar-thumbnails.c | 10 +++++----- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3dd502d0..30bb671c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-03-12 Marco Pesenti Gritti + + * pdf/pdf-document.cc: + * shell/ev-sidebar-thumbnails.c: (adjustment_changed_cb), + (do_one_iteration), (ev_sidebar_thumbnails_set_document): + + Fix the mess we did with thumbnails and 1-basedness + 2005-03-12 Changwoo Ryu * configure.ac (ALL_LINGUAS): Added "ko" (Korean). diff --git a/pdf/pdf-document.cc b/pdf/pdf-document.cc index 8d74c864..fc2568ba 100644 --- a/pdf/pdf-document.cc +++ b/pdf/pdf-document.cc @@ -1252,7 +1252,7 @@ pdf_document_thumbnails_get_page_pixbuf (PdfDocument *pdf_document, output = new SplashOutputDev (splashModeRGB8, gFalse, color); output->startDoc (pdf_document->doc->getXRef()); pdf_document->doc->displayPage (output, - page_num + 1, + page_num, 72*scale_factor, 72*scale_factor, 0, gTrue, gFalse); @@ -1287,7 +1287,7 @@ pdf_document_thumbnails_get_dimensions (EvDocumentThumbnails *document_thumbnail Object the_thumb; Thumb *thumb = NULL; - the_page = pdf_document->doc->getCatalog ()->getPage (page + 1); + the_page = pdf_document->doc->getCatalog ()->getPage (page); the_page->getThumb (&the_thumb); if (!(the_thumb.isNull () || the_thumb.isNone())) { @@ -1326,8 +1326,7 @@ pdf_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document_thumbnails Thumb *thumb = NULL; gboolean have_ethumbs = FALSE; - /* getPage seems to want page + 1 for some reason; */ - the_page = pdf_document->doc->getCatalog ()->getPage (page + 1); + the_page = pdf_document->doc->getCatalog ()->getPage (page); the_page->getThumb(&the_thumb); if (!(the_thumb.isNull () || the_thumb.isNone())) { diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index b602bb26..b4622f6e 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -111,7 +111,7 @@ adjustment_changed_cb (GtkAdjustment *adjustment, if (!path) return; - page = gtk_tree_path_get_indices (path)[0]; + page = gtk_tree_path_get_indices (path)[0] + 1; if (page == priv->current_page) return; gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->list_store), @@ -119,7 +119,7 @@ adjustment_changed_cb (GtkAdjustment *adjustment, gtk_tree_model_get (GTK_TREE_MODEL (priv->list_store), &iter, COLUMN_THUMBNAIL_SET, &thumbnail_set, -1); - if (! thumbnail_set) { + if (!thumbnail_set) { priv->current_page = page; priv->current_page_iter = iter; @@ -239,8 +239,8 @@ do_one_iteration (EvSidebarThumbnails *ev_sidebar_thumbnails) priv->current_page++; - if (priv->current_page == priv->n_pages) { - priv->current_page = 0; + if (priv->current_page > priv->n_pages) { + priv->current_page = 1; gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->list_store), &(priv->current_page_iter)); } else { @@ -378,7 +378,7 @@ ev_sidebar_thumbnails_set_document (EvSidebarThumbnails *sidebar_thumbnails, g_object_unref (loading_icon); gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->list_store), &(priv->current_page_iter)); - priv->current_page = 0; + priv->current_page = 1; priv->pages_done = 0; } -- 2.43.5