summaryrefslogtreecommitdiff
path: root/fitz/base_link.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-12-28 14:09:26 +0000
committerRobin Watts <robin.watts@artifex.com>2011-12-28 14:25:45 +0000
commitd442ada2f85d91077ef8cc20d43a48d832037635 (patch)
treea086095579001390c82a70ebd44498776069a6f2 /fitz/base_link.c
parent0d70079719b89aae1e5342d098389ef04bf313bc (diff)
downloadmupdf-d442ada2f85d91077ef8cc20d43a48d832037635.tar.xz
Outline/link destination tweaks.
Move 'kind' into the fz_link_dest structure (as this makes more sense). Put an fz_link_dest rather than just a page number into the outlines structure. Correct parsing of actions and dests from pdf outlines.
Diffstat (limited to 'fitz/base_link.c')
-rw-r--r--fitz/base_link.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fitz/base_link.c b/fitz/base_link.c
index 3f25c82d..de19dbf1 100644
--- a/fitz/base_link.c
+++ b/fitz/base_link.c
@@ -1,29 +1,30 @@
#include "fitz.h"
static void
-free_link_dest(fz_context *ctx, fz_link_kind kind, fz_link_dest *dest)
+free_link_dest(fz_context *ctx, fz_link_dest *dest)
{
- switch(kind)
+ switch(dest->kind)
{
+ case FZ_LINK_NONE:
case FZ_LINK_GOTO:
break;
case FZ_LINK_URI:
- fz_free(ctx, dest->uri.uri);
+ fz_free(ctx, dest->ld.uri.uri);
break;
case FZ_LINK_LAUNCH:
- fz_free(ctx, dest->launch.file_spec);
+ fz_free(ctx, dest->ld.launch.file_spec);
break;
case FZ_LINK_NAMED:
- fz_free(ctx, dest->named.named);
+ fz_free(ctx, dest->ld.named.named);
break;
case FZ_LINK_GOTOR:
- fz_free(ctx, dest->gotor.file_spec);
+ fz_free(ctx, dest->ld.gotor.file_spec);
break;
}
}
fz_link *
-fz_new_link(fz_context *ctx, fz_link_kind kind, fz_rect bbox, fz_link_dest dest)
+fz_new_link(fz_context *ctx, fz_rect bbox, fz_link_dest dest)
{
fz_link *link;
@@ -33,10 +34,9 @@ fz_new_link(fz_context *ctx, fz_link_kind kind, fz_rect bbox, fz_link_dest dest)
}
fz_catch(ctx)
{
- free_link_dest(ctx, kind, &dest);
+ free_link_dest(ctx, &dest);
fz_rethrow(ctx);
}
- link->kind = kind;
link->dest = dest;
link->rect = bbox;
link->next = NULL;
@@ -51,7 +51,7 @@ fz_free_link(fz_context *ctx, fz_link *link)
while (link)
{
next = link->next;
- free_link_dest(ctx, link->kind, &link->dest);
+ free_link_dest(ctx, &link->dest);
fz_free(ctx, link);
link = next;
}