]> www.fi.muni.cz Git - evince.git/commitdiff
Fix the mess we did with thumbnails and 1-basedness
authorMarco Pesenti Gritti <marco@gnome.org>
Sat, 12 Mar 2005 09:56:03 +0000 (09:56 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Sat, 12 Mar 2005 09:56:03 +0000 (09:56 +0000)
2005-03-12  Marco Pesenti Gritti  <marco@gnome.org>

        * 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
pdf/pdf-document.cc
shell/ev-sidebar-thumbnails.c

index 3dd502d06cceee88dca20b9128a04eeb48002d61..30bb671cc703b94440314519e11c93dc40d2caa2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-03-12  Marco Pesenti Gritti  <marco@gnome.org>
+
+       * 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  <cwryu@debian.org>
 
        * configure.ac (ALL_LINGUAS): Added "ko" (Korean).
index 8d74c864785eab72aab7bfae318d3f15b4b64cd8..fc2568ba75b77f8e61ca05c020573c7748b821a2 100644 (file)
@@ -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())) {
index b602bb26ae7dfa2beaabd47d1504b89a0fe96e47..b4622f6ebb9523d0975cfedf98226f87346bc3f0 100644 (file)
@@ -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;
 }