]> www.fi.muni.cz Git - evince.git/commitdiff
Do not lose page position when reloading. Fixes bug #573091.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 1 Mar 2009 16:28:06 +0000 (16:28 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sun, 1 Mar 2009 16:28:06 +0000 (16:28 +0000)
2009-03-01  Carlos Garcia Campos  <carlosgc@gnome.org>

* shell/ev-window.c: (ev_window_set_document),
(ev_window_reload_job_cb):

Do not lose page position when reloading. Fixes bug #573091.

svn path=/trunk/; revision=3503

ChangeLog
shell/ev-window.c

index 18be5f6645655cbf42b09afb8f0b0ee0ccbb53b3..9a93f8025c25a0c1bc48fb36c9d929ebcb482bf6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-03-01  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-window.c: (ev_window_set_document),
+       (ev_window_reload_job_cb):
+
+       Do not lose page position when reloading. Fixes bug #573091.
+       
 2009-03-01  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * backend/pdf/ev-poppler.cc: (make_thumbnail_for_page),
index f950c9b650c103fb9739410909eee90d3ac7ab56..455c6a59a1fbe97f869fc132c4a5bf109a748d11 100644 (file)
@@ -1248,6 +1248,18 @@ ev_window_set_document (EvWindow *ev_window, EvDocument *document)
        g_signal_connect (ev_window->priv->page_cache, "history-changed",
                          G_CALLBACK (history_changed_cb), ev_window);
 
+       if (ev_window->priv->in_reload && ev_window->priv->dest) {
+               gint page;
+
+               /* Restart the current page */
+               page = CLAMP (ev_link_dest_get_page (ev_window->priv->dest),
+                             0,
+                             ev_page_cache_get_n_pages (ev_window->priv->page_cache) - 1);
+               ev_page_cache_set_current_page (ev_window->priv->page_cache, page);
+               g_object_unref (ev_window->priv->dest);
+               ev_window->priv->dest = NULL;
+       }
+
        if (ev_page_cache_get_n_pages (ev_window->priv->page_cache) > 0) {
                ev_view_set_document (view, document);
        } else {
@@ -1486,7 +1498,6 @@ ev_window_reload_job_cb (EvJob    *job,
                         EvWindow *ev_window)
 {
        GtkWidget *widget;
-       gint       page;
 
        if (ev_job_is_failed (job)) {
                ev_window_clear_reload_job (ev_window);
@@ -1498,14 +1509,6 @@ ev_window_reload_job_cb (EvJob    *job,
        }
        
        ev_window_set_document (ev_window, job->document);
-
-       /* Restart the current page */
-       page = CLAMP (ev_link_dest_get_page (ev_window->priv->dest),
-                     0,
-                     ev_page_cache_get_n_pages (ev_window->priv->page_cache) - 1);
-       ev_page_cache_set_current_page (ev_window->priv->page_cache, page);
-       g_object_unref (ev_window->priv->dest);
-       ev_window->priv->dest = NULL;
        
        /* Restart the search after reloading */
        widget = gtk_window_get_focus (GTK_WINDOW (ev_window));