diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-11-15 19:05:59 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-11-17 18:32:06 +0000 |
commit | 2be04fd23c9650820fa5abd1196647ccf1b73921 (patch) | |
tree | 0828c91a4154cc8a3d4041db4f64611c43a93a2d /fitz | |
parent | 9b56c6c88522b7ff6c592c93ff8ec33ee158747a (diff) | |
download | mupdf-2be04fd23c9650820fa5abd1196647ccf1b73921.tar.xz |
Bug 692487: Make pdfclean keep internal links where possible.
Take on a (cosmetically tweaked) version of Zenikos patch to allow
pdfclean to keep link destinations that are in preserved pages.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/base_object.c | 12 | ||||
-rw-r--r-- | fitz/fitz.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/fitz/base_object.c b/fitz/base_object.c index 6881fffb..64fafad0 100644 --- a/fitz/base_object.c +++ b/fitz/base_object.c @@ -497,6 +497,18 @@ fz_array_insert(fz_obj *obj, fz_obj *item) } } +int +fz_array_contains(fz_obj *arr, fz_obj *obj) +{ + int i; + + for (i = 0; i < fz_array_len(arr); i++) + if (!fz_objcmp(fz_array_get(arr, i), obj)) + return 1; + + return 0; +} + /* dicts may only have names as keys! */ static int keyvalcmp(const void *ap, const void *bp) diff --git a/fitz/fitz.h b/fitz/fitz.h index a1235c05..ccaa98b8 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -403,6 +403,7 @@ fz_obj *fz_array_get(fz_obj *array, int i); void fz_array_put(fz_obj *array, int i, fz_obj *obj); void fz_array_push(fz_obj *array, fz_obj *obj); void fz_array_insert(fz_obj *array, fz_obj *obj); +int fz_array_contains(fz_obj *array, fz_obj *obj); int fz_dict_len(fz_obj *dict); fz_obj *fz_dict_get_key(fz_obj *dict, int idx); |