summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-12-28 15:18:21 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-01-05 14:47:37 +0100
commitd5394cbcf3a98dcabc49264172d4ce6618535d91 (patch)
tree9cf89de9fa95ddc14ffdb78d2dd8ff25d7d480cd /source/pdf
parentcc4bd1b4f82a67f70c7ccad4da874d6e7451eeae (diff)
downloadmupdf-d5394cbcf3a98dcabc49264172d4ce6618535d91.tar.xz
Remove fz_page argument from fz_annot function calls.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-annot.c13
-rw-r--r--source/pdf/pdf-page.c3
-rw-r--r--source/pdf/pdf-run.c3
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;