diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-10-17 17:13:32 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-10-28 16:18:38 +0200 |
commit | 8a07b7fb14f11204a0d840792ab9f4bd54b066e5 (patch) | |
tree | e617a898c17aeb353f35d7b362ca2de290cf2b82 /source/pdf/pdf-outline.c | |
parent | 4029b45e494634361a4205f8896ec429d11e990a (diff) | |
download | mupdf-8a07b7fb14f11204a0d840792ab9f4bd54b066e5.tar.xz |
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.
Diffstat (limited to 'source/pdf/pdf-outline.c')
-rw-r--r-- | source/pdf/pdf-outline.c | 8 |
1 files changed, 6 insertions, 2 deletions
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) |