mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 11:26:01 +01:00
Updated index links
This commit is contained in:
parent
8c7892c263
commit
08f68723b6
1 changed files with 4 additions and 9 deletions
11
zathura.c
11
zathura.c
|
@ -2652,23 +2652,18 @@ cb_index_selection_changed(GtkTreeSelection* treeselection, GtkWidget* action_vi
|
||||||
PopplerDest* destination;
|
PopplerDest* destination;
|
||||||
|
|
||||||
gtk_tree_model_get(model, &iter, 1, &action, -1);
|
gtk_tree_model_get(model, &iter, 1, &action, -1);
|
||||||
|
|
||||||
if(action->type == POPPLER_ACTION_GOTO_DEST)
|
if(action->type == POPPLER_ACTION_GOTO_DEST)
|
||||||
{
|
{
|
||||||
destination = action->goto_dest.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);
|
set_page(page_number - 1);
|
||||||
|
|
||||||
if(destination)
|
|
||||||
{
|
|
||||||
set_page(destination->page_num - 1);
|
|
||||||
update_status();
|
update_status();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue