From 8a07b7fb14f11204a0d840792ab9f4bd54b066e5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 17 Oct 2016 17:13:32 +0200 Subject: Clean up link destination handling. All link destinations should be URIs, and a document specific function can be called to resolve them to actual page numbers. Outlines have cached page numbers as well as string URIs. --- source/pdf/pdf-outline.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/pdf/pdf-outline.c') diff --git a/source/pdf/pdf-outline.c b/source/pdf/pdf-outline.c index c9fd35fe..d82db02c 100644 --- a/source/pdf/pdf-outline.c +++ b/source/pdf/pdf-outline.c @@ -27,9 +27,13 @@ pdf_load_outline_imp(fz_context *ctx, pdf_document *doc, pdf_obj *dict) node->title = pdf_to_utf8(ctx, obj); if ((obj = pdf_dict_get(ctx, dict, PDF_NAME_Dest)) != NULL) - node->dest = pdf_parse_link_dest(ctx, doc, FZ_LINK_GOTO, obj); + node->uri = pdf_parse_link_dest(ctx, doc, obj); else if ((obj = pdf_dict_get(ctx, dict, PDF_NAME_A)) != NULL) - node->dest = pdf_parse_action(ctx, doc, obj); + node->uri = pdf_parse_link_action(ctx, doc, obj); + else + node->uri = NULL; + + node->page = pdf_resolve_link(ctx, doc, node->uri); obj = pdf_dict_get(ctx, dict, PDF_NAME_First); if (obj) -- cgit v1.2.3