From 165cedc275554b07c33006ead54c06c3ce8c46ed Mon Sep 17 00:00:00 2001 From: neldoreth Date: Tue, 2 Feb 2010 17:17:03 +0100 Subject: [PATCH] Updated index links --- zathura.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/zathura.c b/zathura.c index 7ca2f55..d40d91d 100644 --- a/zathura.c +++ b/zathura.c @@ -2652,20 +2652,15 @@ cb_index_selection_changed(GtkTreeSelection* treeselection, GtkWidget* action_vi PopplerDest* destination; gtk_tree_model_get(model, &iter, 1, &action, -1); - if(action->type == POPPLER_ACTION_GOTO_DEST) { destination = action->goto_dest.dest; + int page_number = destination->page_num; - if(destination->type == POPPLER_DEST_NAMED) + if(page_number >= 0 && page_number <= Zathura.PDF.number_of_pages) { - destination = poppler_document_find_dest(Zathura.PDF.document, destination->named_dest); - - if(destination) - { - set_page(destination->page_num - 1); - update_status(); - } + set_page(page_number - 1); + update_status(); } } }