diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-02-28 16:16:50 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-03-16 14:51:40 +0100 |
commit | df788749fd2377e0c0232bac447e369e59c98b75 (patch) | |
tree | a860e7a05317f3c8d7dcb90f1e8ca995c4dbc409 /source/pdf | |
parent | 187bef3feb8e4ba672bdb8d23d101121a84af557 (diff) | |
download | mupdf-df788749fd2377e0c0232bac447e369e59c98b75.tar.xz |
Only use BS/W for border width.
The Border property is long since deprecated.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-annot-edit.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c index 15541d45..1d042f1f 100644 --- a/source/pdf/pdf-annot-edit.c +++ b/source/pdf/pdf-annot-edit.c @@ -460,10 +460,7 @@ pdf_set_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, float pdf_annot_border(fz_context *ctx, pdf_annot *annot) { - pdf_obj *border, *bs, *bs_w; - border = pdf_dict_get(ctx, annot->obj, PDF_NAME_Border); - if (pdf_is_array(ctx, border)) - return pdf_to_real(ctx, pdf_array_get(ctx, border, 2)); + pdf_obj *bs, *bs_w; bs = pdf_dict_get(ctx, annot->obj, PDF_NAME_BS); bs_w = pdf_dict_get(ctx, bs, PDF_NAME_W); if (pdf_is_number(ctx, bs_w)) @@ -475,21 +472,10 @@ void pdf_set_annot_border(fz_context *ctx, pdf_annot *annot, float w) { pdf_document *doc = annot->page->doc; - pdf_obj *border = pdf_dict_get(ctx, annot->obj, PDF_NAME_Border); - if (pdf_is_array(ctx, border)) - pdf_array_put_drop(ctx, border, 2, pdf_new_real(ctx, doc, w)); - else - { - border = pdf_new_array(ctx, doc, 3); - pdf_array_push_drop(ctx, border, pdf_new_real(ctx, doc, 0)); - pdf_array_push_drop(ctx, border, pdf_new_real(ctx, doc, 0)); - pdf_array_push_drop(ctx, border, pdf_new_real(ctx, doc, w)); - pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_Border, border); - } - - /* Remove border style and effect dictionaries so they won't interfere. */ - pdf_dict_del(ctx, annot->obj, PDF_NAME_BS); - pdf_dict_del(ctx, annot->obj, PDF_NAME_BE); + pdf_obj *bs = pdf_dict_get(ctx, annot->obj, PDF_NAME_BS); + if (!pdf_is_dict(ctx, bs)) + pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_BS, bs = pdf_new_dict(ctx, doc, 1)); + pdf_dict_put_real(ctx, bs, PDF_NAME_W, w); pdf_dirty_annot(ctx, annot); } |