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/html/html-layout.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/html/html-layout.c')
-rw-r--r-- | source/html/html-layout.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/source/html/html-layout.c b/source/html/html-layout.c index 54a96c1d..b700b59b 100644 --- a/source/html/html-layout.c +++ b/source/html/html-layout.c @@ -1902,7 +1902,7 @@ static fz_link *load_link_flow(fz_context *ctx, fz_html_flow *flow, fz_link *hea fz_html_flow *next; char path[2048]; fz_rect bbox; - fz_link_dest dest; + char *dest; char *href; float end; @@ -1951,20 +1951,14 @@ static fz_link *load_link_flow(fz_context *ctx, fz_html_flow *flow, fz_link *hea fz_urldecode(path); fz_cleanname(path); - memset(&dest, 0, sizeof dest); - dest.kind = FZ_LINK_GOTO; - dest.ld.gotor.dest = fz_strdup(ctx, path); - dest.ld.gotor.page = 0; /* computed in epub_load_links */ + dest = path; } else { - memset(&dest, 0, sizeof dest); - dest.kind = FZ_LINK_URI; - dest.ld.uri.uri = fz_strdup(ctx, href); - dest.ld.uri.is_map = 0; + dest = href; } - link = fz_new_link(ctx, &bbox, dest); + link = fz_new_link(ctx, &bbox, NULL, dest); link->next = head; head = link; } |