diff options
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-annot.c | 13 | ||||
-rw-r--r-- | source/pdf/pdf-page.c | 3 | ||||
-rw-r--r-- | source/pdf/pdf-run.c | 3 |
3 files changed, 11 insertions, 8 deletions
diff --git a/source/pdf/pdf-annot.c b/source/pdf/pdf-annot.c index 3718c20a..bfdfe306 100644 --- a/source/pdf/pdf-annot.c +++ b/source/pdf/pdf-annot.c @@ -503,9 +503,14 @@ pdf_load_annots(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_obj *ann for (i = 0; i < len; i++) { obj = pdf_array_get(ctx, annots, i); - annot = fz_malloc_struct(ctx, pdf_annot); - annot->obj = pdf_keep_obj(ctx, obj); + + annot = fz_new_annot(ctx, sizeof(pdf_annot)); + annot->super.bound_annot = (fz_annot_bound_fn*)pdf_bound_annot; + annot->super.run_annot = (fz_annot_run_fn*)pdf_run_annot; + annot->super.next_annot = (fz_annot_next_fn*)pdf_next_annot; + annot->page = page; + annot->obj = pdf_keep_obj(ctx, obj); annot->next = NULL; *itr = annot; @@ -613,13 +618,13 @@ pdf_first_annot(fz_context *ctx, pdf_page *page) } pdf_annot * -pdf_next_annot(fz_context *ctx, pdf_page *page, pdf_annot *annot) +pdf_next_annot(fz_context *ctx, pdf_annot *annot) { return annot ? annot->next : NULL; } fz_rect * -pdf_bound_annot(fz_context *ctx, pdf_page *page, pdf_annot *annot, fz_rect *rect) +pdf_bound_annot(fz_context *ctx, pdf_annot *annot, fz_rect *rect) { if (rect == NULL) return NULL; diff --git a/source/pdf/pdf-page.c b/source/pdf/pdf-page.c index c7ef3422..d763b8c8 100644 --- a/source/pdf/pdf-page.c +++ b/source/pdf/pdf-page.c @@ -436,10 +436,7 @@ pdf_new_page(fz_context *ctx, pdf_document *doc) page->super.load_links = (fz_page_load_links_fn *)pdf_load_links; page->super.bound_page = (fz_page_bound_page_fn *)pdf_bound_page; page->super.first_annot = (fz_page_first_annot_fn *)pdf_first_annot; - page->super.next_annot = (fz_page_next_annot_fn *)pdf_next_annot; - page->super.bound_annot = (fz_page_bound_annot_fn *)pdf_bound_annot; page->super.run_page_contents = (fz_page_run_page_contents_fn *)pdf_run_page_contents; - page->super.run_annot = (fz_page_run_annot_fn *)pdf_run_annot; page->super.page_presentation = (fz_page_page_presentation_fn *)pdf_page_presentation; page->resources = NULL; diff --git a/source/pdf/pdf-run.c b/source/pdf/pdf-run.c index 65460e2a..e84604fb 100644 --- a/source/pdf/pdf-run.c +++ b/source/pdf/pdf-run.c @@ -69,8 +69,9 @@ void pdf_run_page_contents(fz_context *ctx, pdf_page *page, fz_device *dev, cons fz_throw(ctx, FZ_ERROR_TRYLATER, "incomplete rendering"); } -void pdf_run_annot(fz_context *ctx, pdf_page *page, pdf_annot *annot, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie) +void pdf_run_annot(fz_context *ctx, pdf_annot *annot, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie) { + pdf_page *page = annot->page; pdf_document *doc = page->doc; int nocache; |