summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-04-25 15:35:32 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-04-26 15:12:57 +0200
commitc304a128c51939dd507b2cb87c89daf56a659388 (patch)
treeb9d5b78cf6e6acb1466c9061191c4ecdea986df6 /source/pdf
parent34bf864107a499d55383ad5709082dbc2e2864df (diff)
downloadmupdf-c304a128c51939dd507b2cb87c89daf56a659388.tar.xz
Change order of arguments to pdf_add_page etc.
Resources are defined before they are used; so it's only logical to have the resource dictionary before the content buffer in the argument list.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-appearance.c2
-rw-r--r--source/pdf/pdf-device.c6
-rw-r--r--source/pdf/pdf-page.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/source/pdf/pdf-appearance.c b/source/pdf/pdf-appearance.c
index 45d81c63..122f36ac 100644
--- a/source/pdf/pdf-appearance.c
+++ b/source/pdf/pdf-appearance.c
@@ -1617,7 +1617,7 @@ void pdf_set_annot_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *ann
contents = fz_new_buffer(ctx, 0);
- dev = pdf_new_pdf_device(ctx, doc, &fz_identity, &trect, contents, resources);
+ dev = pdf_new_pdf_device(ctx, doc, &fz_identity, &trect, resources, contents);
fz_run_display_list(ctx, disp_list, dev, &ctm, &fz_infinite_rect, NULL);
fz_drop_device(ctx, dev);
diff --git a/source/pdf/pdf-device.c b/source/pdf/pdf-device.c
index 6831f788..9c38dd41 100644
--- a/source/pdf/pdf-device.c
+++ b/source/pdf/pdf-device.c
@@ -1062,7 +1062,7 @@ pdf_dev_drop_imp(fz_context *ctx, fz_device *dev)
fz_free(ctx, pdev->gstates);
}
-fz_device *pdf_new_pdf_device(fz_context *ctx, pdf_document *doc, const fz_matrix *topctm, const fz_rect *mediabox, fz_buffer *buf, pdf_obj *resources)
+fz_device *pdf_new_pdf_device(fz_context *ctx, pdf_document *doc, const fz_matrix *topctm, const fz_rect *mediabox, pdf_obj *resources, fz_buffer *buf)
{
pdf_device *dev = fz_new_device(ctx, sizeof *dev);
@@ -1130,10 +1130,10 @@ fz_device *pdf_new_pdf_device(fz_context *ctx, pdf_document *doc, const fz_matri
}
fz_device *pdf_page_write(fz_context *ctx, pdf_document *doc,
- const fz_rect *mediabox, fz_buffer **pcontents, pdf_obj **presources)
+ const fz_rect *mediabox, pdf_obj **presources, fz_buffer **pcontents)
{
fz_matrix pagectm = { 1, 0, 0, -1, -mediabox->x0, mediabox->y1 };
*presources = pdf_new_dict(ctx, doc, 0);
*pcontents = fz_new_buffer(ctx, 0);
- return pdf_new_pdf_device(ctx, doc, &pagectm, mediabox, *pcontents, *presources);
+ return pdf_new_pdf_device(ctx, doc, &pagectm, mediabox, *presources, *pcontents);
}
diff --git a/source/pdf/pdf-page.c b/source/pdf/pdf-page.c
index de8ffe2f..45482c6e 100644
--- a/source/pdf/pdf-page.c
+++ b/source/pdf/pdf-page.c
@@ -628,7 +628,7 @@ pdf_delete_page_range(fz_context *ctx, pdf_document *doc, int start, int end)
}
pdf_obj *
-pdf_add_page(fz_context *ctx, pdf_document *doc, const fz_rect *mediabox, int rotate, fz_buffer *contents, pdf_obj *resources)
+pdf_add_page(fz_context *ctx, pdf_document *doc, const fz_rect *mediabox, int rotate, pdf_obj *resources, fz_buffer *contents)
{
pdf_obj *page_obj = pdf_new_dict(ctx, doc, 5);
fz_try(ctx)
@@ -636,8 +636,8 @@ pdf_add_page(fz_context *ctx, pdf_document *doc, const fz_rect *mediabox, int ro
pdf_dict_put_drop(ctx, page_obj, PDF_NAME_Type, PDF_NAME_Page);
pdf_dict_put_drop(ctx, page_obj, PDF_NAME_MediaBox, pdf_new_rect(ctx, doc, mediabox));
pdf_dict_put_drop(ctx, page_obj, PDF_NAME_Rotate, pdf_new_int(ctx, doc, rotate));
- pdf_dict_put_drop(ctx, page_obj, PDF_NAME_Contents, pdf_add_stream(ctx, doc, contents));
pdf_dict_put_drop(ctx, page_obj, PDF_NAME_Resources, pdf_add_object(ctx, doc, resources));
+ pdf_dict_put_drop(ctx, page_obj, PDF_NAME_Contents, pdf_add_stream(ctx, doc, contents));
}
fz_catch(ctx)
{