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/html/html-layout.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'source/html/html-layout.c') 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; } -- cgit v1.2.3