summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-font.c12
-rw-r--r--source/pdf/pdf-image.c2
-rw-r--r--source/pdf/pdf-xref.c8
3 files changed, 10 insertions, 12 deletions
diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c
index ebefde78..26a5cb9d 100644
--- a/source/pdf/pdf-font.c
+++ b/source/pdf/pdf-font.c
@@ -1695,7 +1695,7 @@ pdf_add_cid_font_widths(fz_context *ctx, pdf_document *doc, pdf_obj *fobj, fz_fo
fz_var(run_obj);
- fw = pdf_add_object_drop(ctx, doc, pdf_new_array(ctx, doc, 10));
+ fw = pdf_add_new_array(ctx, doc, 10);
fz_try(ctx)
{
prev_code = 0;
@@ -2025,7 +2025,7 @@ pdf_add_cid_font(fz_context *ctx, pdf_document *doc, fz_font *font)
if (fref)
return fref;
- fobj = pdf_add_object_drop(ctx, doc, pdf_new_dict(ctx, doc, 10));
+ fobj = pdf_add_new_dict(ctx, doc, 10);
fz_try(ctx)
{
pdf_dict_put(ctx, fobj, PDF_NAME_Type, PDF_NAME_Font);
@@ -2110,7 +2110,7 @@ pdf_add_simple_font(fz_context *ctx, pdf_document *doc, fz_font *font, int encod
case PDF_SIMPLE_ENCODING_CYRILLIC: enc = pdf_glyph_name_from_koi8u; break;
}
- fobj = pdf_add_object_drop(ctx, doc, pdf_new_dict(ctx, doc, 10));
+ fobj = pdf_add_new_dict(ctx, doc, 10);
fz_try(ctx)
{
pdf_dict_put(ctx, fobj, PDF_NAME_Type, PDF_NAME_Font);
@@ -2209,7 +2209,7 @@ pdf_add_cjk_font(fz_context *ctx, pdf_document *doc, fz_font *fzfont, int script
if (fref)
return fref;
- font = pdf_add_object_drop(ctx, doc, pdf_new_dict(ctx, doc, 5));
+ font = pdf_add_new_dict(ctx, doc, 5);
fz_try(ctx)
{
pdf_dict_put(ctx, font, PDF_NAME_Type, PDF_NAME_Font);
@@ -2217,13 +2217,13 @@ pdf_add_cjk_font(fz_context *ctx, pdf_document *doc, fz_font *fzfont, int script
pdf_dict_put_name(ctx, font, PDF_NAME_BaseFont, basefont);
pdf_dict_put_name(ctx, font, PDF_NAME_Encoding, encoding);
dfonts = pdf_dict_put_array(ctx, font, PDF_NAME_DescendantFonts, 1);
- pdf_array_push_drop(ctx, dfonts, pdf_add_object_drop(ctx, doc, subfont = pdf_new_dict(ctx, doc, 5)));
+ pdf_array_push_drop(ctx, dfonts, subfont = pdf_add_new_dict(ctx, doc, 5));
{
pdf_dict_put(ctx, subfont, PDF_NAME_Type, PDF_NAME_Font);
pdf_dict_put(ctx, subfont, PDF_NAME_Subtype, PDF_NAME_CIDFontType0);
pdf_dict_put_name(ctx, subfont, PDF_NAME_BaseFont, basefont);
pdf_add_cid_system_info(ctx, doc, subfont, "Adobe", ordering, supplement);
- fontdesc = pdf_add_object_drop(ctx, doc, pdf_new_dict(ctx, doc, 8));
+ fontdesc = pdf_add_new_dict(ctx, doc, 8);
pdf_dict_put_drop(ctx, subfont, PDF_NAME_FontDescriptor, fontdesc);
{
pdf_dict_put(ctx, fontdesc, PDF_NAME_Type, PDF_NAME_FontDescriptor);
diff --git a/source/pdf/pdf-image.c b/source/pdf/pdf-image.c
index 35eff099..02e7ddf7 100644
--- a/source/pdf/pdf-image.c
+++ b/source/pdf/pdf-image.c
@@ -323,7 +323,7 @@ pdf_add_image(fz_context *ctx, pdf_document *doc, fz_image *image, int mask)
if (imref)
return imref;
- imobj = pdf_add_object_drop(ctx, doc, pdf_new_dict(ctx, doc, 3));
+ imobj = pdf_add_new_dict(ctx, doc, 3);
fz_try(ctx)
{
dp = pdf_dict_put_dict(ctx, imobj, PDF_NAME_DecodeParms, 3);
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index 2f3741d0..c48cf83f 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -2694,7 +2694,7 @@ pdf_add_stream(fz_context *ctx, pdf_document *doc, fz_buffer *buf, pdf_obj *obj,
{
pdf_obj *ind;
if (!obj)
- ind = pdf_add_object_drop(ctx, doc, pdf_new_dict(ctx, doc, 4));
+ ind = pdf_add_new_dict(ctx, doc, 4);
else
ind = pdf_add_object(ctx, doc, obj);
fz_try(ctx)
@@ -2730,11 +2730,9 @@ pdf_document *pdf_create_document(fz_context *ctx)
trailer = pdf_new_dict(ctx, doc, 2);
pdf_dict_put_int(ctx, trailer, PDF_NAME_Size, 3);
- root = pdf_new_dict(ctx, doc, 2);
- pdf_dict_put_drop(ctx, trailer, PDF_NAME_Root, pdf_add_object_drop(ctx, doc, root));
+ pdf_dict_put_drop(ctx, trailer, PDF_NAME_Root, root = pdf_add_new_dict(ctx, doc, 2));
pdf_dict_put(ctx, root, PDF_NAME_Type, PDF_NAME_Catalog);
- pages = pdf_new_dict(ctx, doc, 3);
- pdf_dict_put_drop(ctx, root, PDF_NAME_Pages, pdf_add_object_drop(ctx, doc, pages));
+ pdf_dict_put_drop(ctx, root, PDF_NAME_Pages, pages = pdf_add_new_dict(ctx, doc, 3));
pdf_dict_put(ctx, pages, PDF_NAME_Type, PDF_NAME_Pages);
pdf_dict_put_int(ctx, pages, PDF_NAME_Count, 0);
pdf_dict_put_array(ctx, pages, PDF_NAME_Kids, 1);