summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gardiner <paul@Pauls-Laptop-Mac.local>2018-06-01 19:26:10 +0100
committerPaul Gardiner <paul@Pauls-Laptop-Mac.local>2018-06-01 19:26:10 +0100
commit4d473e7f6a6ec72265270c03a26b48e27db11282 (patch)
tree7217b814bf31f3cd44c3773415bb3de06e013e1f
parenta7dc8ede59f63a5d4c4fb6dd845da328645f11a8 (diff)
downloadmupdf-4d473e7f6a6ec72265270c03a26b48e27db11282.tar.xz
Fix loss of reference to focussed annotation when rereading annotations
-rw-r--r--source/pdf/pdf-annot.c4
1 files changed, 4 insertions, 0 deletions
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;
}