diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-04-25 15:35:32 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-04-26 15:12:57 +0200 |
commit | c304a128c51939dd507b2cb87c89daf56a659388 (patch) | |
tree | b9d5b78cf6e6acb1466c9061191c4ecdea986df6 /source/tools | |
parent | 34bf864107a499d55383ad5709082dbc2e2864df (diff) | |
download | mupdf-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/tools')
-rw-r--r-- | source/tools/mudraw.c | 4 | ||||
-rw-r--r-- | source/tools/murun.c | 6 | ||||
-rw-r--r-- | source/tools/pdfcreate.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c index 9e45a4b1..1effc070 100644 --- a/source/tools/mudraw.c +++ b/source/tools/mudraw.c @@ -641,7 +641,7 @@ static void drawpage(fz_context *ctx, fz_document *doc, int pagenum) fz_buffer *contents; pdf_obj *resources; - dev = pdf_page_write(ctx, pdfout, &mediabox, &contents, &resources); + dev = pdf_page_write(ctx, pdfout, &mediabox, &resources, &contents); fz_try(ctx) { pdf_obj *page_obj; @@ -651,7 +651,7 @@ static void drawpage(fz_context *ctx, fz_document *doc, int pagenum) else fz_run_page(ctx, page, dev, &fz_identity, &cookie); - page_obj = pdf_add_page(ctx, pdfout, &mediabox, rotation, contents, resources); + page_obj = pdf_add_page(ctx, pdfout, &mediabox, rotation, resources, contents); pdf_insert_page(ctx, pdfout, -1, page_obj); pdf_drop_obj(ctx, page_obj); } diff --git a/source/tools/murun.c b/source/tools/murun.c index 2f3d7e64..8825d5af 100644 --- a/source/tools/murun.c +++ b/source/tools/murun.c @@ -2388,12 +2388,12 @@ static void ffi_PDFDocument_addPage(js_State *J) pdf_document *pdf = js_touserdata(J, 0, "pdf_document"); fz_rect mediabox = ffi_torect(J, 1); int rotate = js_tonumber(J, 2); - fz_buffer *contents = ffi_tobuffer(J, 3); /* FIXME: leak if ffi_toobj throws */ - pdf_obj *resources = ffi_toobj(J, pdf, 4); + pdf_obj *resources = ffi_toobj(J, pdf, 3); /* FIXME: leak if ffi_tobuffer throws */ + fz_buffer *contents = ffi_tobuffer(J, 4); pdf_obj *ind; fz_try(ctx) - ind = pdf_add_page(ctx, pdf, &mediabox, rotate, contents, resources); + ind = pdf_add_page(ctx, pdf, &mediabox, rotate, resources, contents); fz_always(ctx) { fz_drop_buffer(ctx, contents); pdf_drop_obj(ctx, resources); diff --git a/source/tools/pdfcreate.c b/source/tools/pdfcreate.c index c2a330c2..6f116c6a 100644 --- a/source/tools/pdfcreate.c +++ b/source/tools/pdfcreate.c @@ -133,7 +133,7 @@ static void create_page(char *input) } fz_drop_stream(ctx, stm); - page = pdf_add_page(ctx, doc, &mediabox, rotate, contents, resources); + page = pdf_add_page(ctx, doc, &mediabox, rotate, resources, contents); pdf_insert_page(ctx, doc, -1, page); pdf_drop_obj(ctx, page); |