diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-10-17 17:13:32 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-10-28 16:18:38 +0200 |
commit | 8a07b7fb14f11204a0d840792ab9f4bd54b066e5 (patch) | |
tree | e617a898c17aeb353f35d7b362ca2de290cf2b82 /platform/ios/Classes/MuDocumentController.m | |
parent | 4029b45e494634361a4205f8896ec429d11e990a (diff) | |
download | mupdf-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/ios/Classes/MuDocumentController.m')
-rw-r--r-- | platform/ios/Classes/MuDocumentController.m | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/platform/ios/Classes/MuDocumentController.m b/platform/ios/Classes/MuDocumentController.m index 02efe1ee..1e9f954c 100644 --- a/platform/ios/Classes/MuDocumentController.m +++ b/platform/ios/Classes/MuDocumentController.m @@ -28,15 +28,12 @@ static void flattenOutline(NSMutableArray *titles, NSMutableArray *pages, fz_out indent[level * 4] = 0; while (outline) { - if (outline->dest.kind == FZ_LINK_GOTO) + int page = outline->page; + if (page >= 0 && outline->title) { - int page = outline->dest.ld.gotor.page; - if (page >= 0 && outline->title) - { - NSString *title = @(outline->title); - [titles addObject: [NSString stringWithFormat: @"%s%@", indent, title]]; - [pages addObject: @(page)]; - } + NSString *title = @(outline->title); + [titles addObject: [NSString stringWithFormat: @"%s%@", indent, title]]; + [pages addObject: @(page)]; } flattenOutline(titles, pages, outline->down, level + 1); outline = outline->next; |