diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-03-13 16:37:34 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-03-16 14:51:41 +0100 |
commit | 37451d0648a01ffe91ac14e9b27b4ee3b0b881f1 (patch) | |
tree | ae44a740469ba4b3ab4721fc7b31529cead837b9 /source/pdf/pdf-annot-edit.c | |
parent | f449fe60b01482b925fe09b75c4cf8aaa16b95cb (diff) | |
download | mupdf-37451d0648a01ffe91ac14e9b27b4ee3b0b881f1.tar.xz |
Add simpler annotation line ending style accessors.
Diffstat (limited to 'source/pdf/pdf-annot-edit.c')
-rw-r--r-- | source/pdf/pdf-annot-edit.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c index b6cda909..d9a3ec2d 100644 --- a/source/pdf/pdf-annot-edit.c +++ b/source/pdf/pdf-annot-edit.c @@ -442,6 +442,20 @@ pdf_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, *end_style = pdf_line_ending_from_name(ctx, pdf_array_get(ctx, style, 1)); } +enum pdf_line_ending +pdf_annot_line_start_style(fz_context *ctx, pdf_annot *annot) +{ + pdf_obj *le = pdf_dict_get(ctx, annot->obj, PDF_NAME_LE); + return pdf_line_ending_from_name(ctx, pdf_array_get(ctx, le, 0)); +} + +enum pdf_line_ending +pdf_annot_line_end_style(fz_context *ctx, pdf_annot *annot) +{ + pdf_obj *le = pdf_dict_get(ctx, annot->obj, PDF_NAME_LE); + return pdf_line_ending_from_name(ctx, pdf_array_get(ctx, le, 1)); +} + void pdf_set_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending start_style, @@ -457,6 +471,20 @@ pdf_set_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, pdf_dirty_annot(ctx, annot); } +void +pdf_set_annot_line_start_style(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending s) +{ + enum pdf_line_ending e = pdf_annot_line_end_style(ctx, annot); + pdf_set_annot_line_ending_styles(ctx, annot, s, e); +} + +void +pdf_set_annot_line_end_style(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending e) +{ + enum pdf_line_ending s = pdf_annot_line_start_style(ctx, annot); + pdf_set_annot_line_ending_styles(ctx, annot, s, e); +} + float pdf_annot_border(fz_context *ctx, pdf_annot *annot) { |