From 8e244f7e2add3606283c0c797d75067fd01ad740 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 22 Sep 2016 16:00:21 +0200 Subject: Remove separate tmp/deleted/changed annotation lists. Use a flag in the pdf_annot struct instead. Don't pass pdf_document to annotation edit functions. --- platform/ios/Classes/MuPageViewNormal.m | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'platform/ios/Classes') diff --git a/platform/ios/Classes/MuPageViewNormal.m b/platform/ios/Classes/MuPageViewNormal.m index 496b62ce..f5afdcee 100644 --- a/platform/ios/Classes/MuPageViewNormal.m +++ b/platform/ios/Classes/MuPageViewNormal.m @@ -504,19 +504,21 @@ static rect_list *updatePage(fz_document *doc, fz_page *page) fz_try(ctx) { pdf_document *idoc = pdf_specifics(ctx, doc); - if (idoc) { - fz_annot *annot; + pdf_page *page = (pdf_page*)page; + pdf_annot *pannot; - pdf_update_page(ctx, idoc, (pdf_page *)page); - while ((annot = (fz_annot *)pdf_poll_changed_annot(ctx, idoc, (pdf_page *)page)) != NULL) + pdf_update_page(ctx, (pdf_page *)page); + for (pannot = pdf_first_annot(ctx, ppage); pannot; pannot = pdf_next_annot(ctx, pannot)) { - rect_list *node = fz_malloc_struct(ctx, rect_list); - - fz_bound_annot(ctx, annot, &node->rect); - node->next = list; - list = node; + if (pannot->changed) + { + rect_list *node = fz_malloc_struct(ctx, rect_list); + fz_bound_annot(ctx, (fz_annot*)pannot, &node->rect); + node->next = list; + list = node; + } } } } -- cgit v1.2.3