From 4d473e7f6a6ec72265270c03a26b48e27db11282 Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Fri, 1 Jun 2018 19:26:10 +0100 Subject: Fix loss of reference to focussed annotation when rereading annotations --- source/pdf/pdf-annot.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/pdf/pdf-annot.c b/source/pdf/pdf-annot.c index d142d454..cb09f84c 100644 --- a/source/pdf/pdf-annot.c +++ b/source/pdf/pdf-annot.c @@ -420,6 +420,7 @@ pdf_annot *pdf_new_annot(fz_context *ctx, pdf_page *page, pdf_obj *obj) void pdf_load_annots(fz_context *ctx, pdf_page *page, pdf_obj *annots) { + pdf_document *doc = page->doc; pdf_annot *annot; pdf_obj *subtype; int i, n; @@ -445,6 +446,9 @@ pdf_load_annots(fz_context *ctx, pdf_page *page, pdf_obj *annots) fz_catch(ctx) fz_warn(ctx, "could not update appearance for annotation"); + if (doc->focus_obj == obj) + doc->focus = annot; + *page->annot_tailp = annot; page->annot_tailp = &annot->next; } -- cgit v1.2.3