summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermán Poo-Caamaño <[email protected]>2013-06-13 16:15:35 -0700
committerraveit65 <[email protected]>2017-08-31 13:28:21 +0200
commite3575888c1b7569bc862879dd7da7cbd081d87a1 (patch)
treeb90980fbf5a9a498fb055aba1815ac86eccd2686
parent2fb770b3245c3066cd9c556f12793f4ed69ee52d (diff)
downloadatril-e3575888c1b7569bc862879dd7da7cbd081d87a1.tar.bz2
atril-e3575888c1b7569bc862879dd7da7cbd081d87a1.tar.xz
libview: Don't update current_page to negative number
In continuous mode with dual page view, there is a chance that the pages were outside of the scroll view. When opening a document in such circumstances, the current page should not be updated to a negative number when already has the first page as default. This fixes a crash when searching with a negative current page. Fix https://bugzilla.gnome.org/show_bug.cgi?id=683172 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=8fe6917
-rw-r--r--libview/ev-view.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 9125e361..14a9fae0 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -754,7 +754,7 @@ view_update_range_and_current_page (EvView *view)
if (view->pending_scroll == SCROLL_TO_KEEP_POSITION) {
best_current_page = MAX (best_current_page, view->start_page);
- if (view->current_page != best_current_page) {
+ if (best_current_page >= 0 && view->current_page != best_current_page) {
view->current_page = best_current_page;
hide_loading_window (view);
ev_document_model_set_page (view->model, best_current_page);
@@ -6332,6 +6332,7 @@ jump_to_find_page (EvView *view, EvViewFindDirection direction, gint shift)
void
ev_view_find_changed (EvView *view, GList **results, gint page)
{
+ g_return_if_fail (view->current_page >= 0);
view->find_pages = results;
if (view->jump_to_find_result == TRUE) {