+2005-04-28 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
+
+ * shell/ev-page-action.c: (ev_page_action_dispose):
+ * shell/ev-view.c: (view_update_range_and_current_page):
+ * shell/ev-window.c: (ev_window_dispose):
+
+ Set page on scroll in continuous mode. Fixes bug 301986.
+ Also cleanup callbacks on destroy of EvWindow and EvPageAction.
+
2005-04-26 Marco Pesenti Gritti <mpg@redhat.com>
* configure.ac:
EvPageAction *page = EV_PAGE_ACTION (object);
if (page->priv->page_cache) {
+ g_signal_handlers_disconnect_matched (page->priv->page_cache, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, page_changed_cb, NULL);
g_object_unref (page->priv->page_cache);
page->priv->page_cache = NULL;
}
int *max_height);
static void view_update_range_and_current_page (EvView *view);
+static void page_changed_cb (EvPageCache *page_cache,
+ int new_page,
+ EvView *view);
+
G_DEFINE_TYPE (EvView, ev_view, GTK_TYPE_WIDGET)
static void
view_update_range_and_current_page (EvView *view)
{
-
/* Presentation trumps all other modes */
if (view->presentation) {
view->start_page = view->current_page;
view->end_page = view->current_page;
} else if (view->continuous) {
GdkRectangle current_area, unused, page_area;
+ gint current_page;
gboolean found = FALSE;
int i;
if (! found) {
view->start_page = i;
found = TRUE;
+
}
view->end_page = i;
} else if (found) {
page_area.y += page_area.height + view->spacing;
}
}
+
+ current_page = ev_page_cache_get_current_page (view->page_cache);
+
+ if (current_page < view->start_page || current_page > view->end_page) {
+ g_signal_handlers_block_by_func (view->page_cache, page_changed_cb, view);
+ ev_page_cache_set_current_page (view->page_cache, view->start_page);
+ g_signal_handlers_unblock_by_func (view->page_cache, page_changed_cb, view);
+ }
} else {
if (view->dual_page) {
if (view->current_page % 2 == 0) {
ev_pixbuf_cache_set_page_range (view->pixbuf_cache,
view->start_page,
view->end_page,
- view->scale);
+ view->scale);
}
/*** Virtual function implementations ***/
priv->action_group = NULL;
}
+ if (priv->page_cache) {
+ g_signal_handlers_disconnect_by_func (priv->page_cache, page_changed_cb, window);
+ priv->page_cache = NULL;
+ }
+
if (priv->document) {
g_object_unref (priv->document);
priv->document = NULL;
}
-
+
if (priv->view) {
g_object_unref (priv->view);
priv->view = NULL;