From 8a07b7fb14f11204a0d840792ab9f4bd54b066e5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 17 Oct 2016 17:13:32 +0200 Subject: 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. --- platform/ios/Classes/MuDocumentController.m | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'platform/ios/Classes/MuDocumentController.m') 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; -- cgit v1.2.3