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/xps/xps-link.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/xps/xps-link.c')
-rw-r--r-- | source/xps/xps-link.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/source/xps/xps-link.c b/source/xps/xps-link.c index 9986d25f..1b2423ad 100644 --- a/source/xps/xps-link.c +++ b/source/xps/xps-link.c @@ -10,23 +10,7 @@ xps_load_links_in_element(fz_context *ctx, xps_document *doc, const fz_matrix *c static void xps_add_link(fz_context *ctx, xps_document *doc, const fz_rect *area, char *base_uri, char *target_uri, fz_link **head) { - fz_link_dest dest; - fz_link *link; - - memset(&dest, 0, sizeof dest); - - if (xps_url_is_remote(ctx, doc, target_uri)) - { - dest.kind = FZ_LINK_URI; - dest.ld.uri.uri = fz_strdup(ctx, target_uri); - } - else - { - dest.kind = FZ_LINK_GOTO; - dest.ld.gotor.page = xps_lookup_link_target(ctx, doc, target_uri); - } - - link = fz_new_link(ctx, area, dest); + fz_link *link = fz_new_link(ctx, area, doc, target_uri); link->next = *head; *head = link; } |