summaryrefslogtreecommitdiff
path: root/platform/gl/gl-main.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-10-17 17:13:32 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-10-28 16:18:38 +0200
commit8a07b7fb14f11204a0d840792ab9f4bd54b066e5 (patch)
treee617a898c17aeb353f35d7b362ca2de290cf2b82 /platform/gl/gl-main.c
parent4029b45e494634361a4205f8896ec429d11e990a (diff)
downloadmupdf-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 'platform/gl/gl-main.c')
-rw-r--r--platform/gl/gl-main.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c
index 34d061be..9084827c 100644
--- a/platform/gl/gl-main.c
+++ b/platform/gl/gl-main.c
@@ -464,10 +464,9 @@ static int do_outline_imp(fz_outline *node, int end, int x0, int x1, int x, int
while (node)
{
- if (node->dest.kind == FZ_LINK_GOTO)
+ p = node->page;
+ if (p >= 0)
{
- p = node->dest.ld.gotor.page;
-
if (ui.x >= x0 && ui.x < x1 && ui.y >= y + h && ui.y < y + h + ui.lineheight)
{
ui.hot = node;
@@ -480,9 +479,9 @@ static int do_outline_imp(fz_outline *node, int end, int x0, int x1, int x, int
}
n = end;
- if (node->next && node->next->dest.kind == FZ_LINK_GOTO)
+ if (node->next && node->next->page >= 0)
{
- n = node->next->dest.ld.gotor.page;
+ n = node->next->page;
}
if (currentpage == p || (currentpage > p && currentpage < n))
{
@@ -587,10 +586,10 @@ static void do_links(fz_link *link, int xofs, int yofs)
{
if (ui.hot == link)
{
- if (link->dest.kind == FZ_LINK_GOTO)
- jump_to_page(link->dest.ld.gotor.page);
- else if (link->dest.kind == FZ_LINK_URI)
- open_browser(link->dest.ld.uri.uri);
+ if (fz_is_external_link(ctx, link->uri))
+ open_browser(link->uri);
+ else
+ jump_to_page(fz_resolve_link(ctx, doc, link->uri));
}
ui_needs_update = 1;
}