summaryrefslogtreecommitdiff
path: root/source/html
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-02-06 13:31:47 +0100
committerTor Andersson <tor.andersson@artifex.com>2017-02-06 17:10:40 +0100
commitf95ec7d7093dec14c2fdf00eb9dace54d4cbe1f5 (patch)
treed3e9e807344d658531eb5be44acbd4178395f523 /source/html
parentc100c4c77a88782ba5c4634994171db611952d44 (diff)
downloadmupdf-f95ec7d7093dec14c2fdf00eb9dace54d4cbe1f5.tar.xz
Make sure to fill in 'doc' field of HTML links.
Diffstat (limited to 'source/html')
-rw-r--r--source/html/epub-doc.c2
-rw-r--r--source/html/html-doc.c2
-rw-r--r--source/html/html-layout.c5
3 files changed, 6 insertions, 3 deletions
diff --git a/source/html/epub-doc.c b/source/html/epub-doc.c
index 3cfa3f06..dab46155 100644
--- a/source/html/epub-doc.c
+++ b/source/html/epub-doc.c
@@ -171,7 +171,7 @@ epub_load_links(fz_context *ctx, fz_page *page_)
{
int cn = ceilf(ch->html->root->h / ch->html->page_h);
if (n < count + cn)
- return fz_load_html_links(ctx, ch->html, n - count, ch->path);
+ return fz_load_html_links(ctx, ch->html, n - count, ch->path, doc);
count += cn;
}
diff --git a/source/html/html-doc.c b/source/html/html-doc.c
index 47225c06..5802e460 100644
--- a/source/html/html-doc.c
+++ b/source/html/html-doc.c
@@ -94,7 +94,7 @@ htdoc_load_links(fz_context *ctx, fz_page *page_)
{
html_page *page = (html_page*)page_;
html_document *doc = page->doc;
- return fz_load_html_links(ctx, doc->html, page->number, "");
+ return fz_load_html_links(ctx, doc->html, page->number, "", doc);
}
static fz_bookmark
diff --git a/source/html/html-layout.c b/source/html/html-layout.c
index 1cac935b..5793de0e 100644
--- a/source/html/html-layout.c
+++ b/source/html/html-layout.c
@@ -2021,7 +2021,7 @@ static fz_link *load_link_box(fz_context *ctx, fz_html_box *box, fz_link *head,
}
fz_link *
-fz_load_html_links(fz_context *ctx, fz_html *html, int page, const char *file)
+fz_load_html_links(fz_context *ctx, fz_html *html, int page, const char *file, void *doc)
{
fz_link *link, *head;
char dir[2048];
@@ -2036,6 +2036,9 @@ fz_load_html_links(fz_context *ctx, fz_html *html, int page, const char *file)
link->rect.x1 += html->page_margin[L];
link->rect.y0 += html->page_margin[T];
link->rect.y1 += html->page_margin[T];
+
+ /* Set document pointer */
+ link->doc = doc;
}
return head;