From 834243dbfc8ab3e9269b7a789d61e3fe0f8e71f7 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 22 Jun 2016 22:14:17 +0100 Subject: Tweak PDF annot API. The values returned from the pdf_annot_{contents, author, date} functions should not be altered, hence make it const. --- source/pdf/pdf-annot-edit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/pdf/pdf-annot-edit.c') diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c index d073a699..7cd344a4 100644 --- a/source/pdf/pdf-annot-edit.c +++ b/source/pdf/pdf-annot-edit.c @@ -373,17 +373,17 @@ void pdf_set_annot_contents(fz_context *ctx, pdf_document *doc, pdf_annot *annot pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_Contents, pdf_new_string(ctx, doc, text, strlen(text))); } -char *pdf_annot_contents(fz_context *ctx, pdf_annot *annot) +const char *pdf_annot_contents(fz_context *ctx, pdf_annot *annot) { return pdf_to_str_buf(ctx, pdf_dict_get(ctx, annot->obj, PDF_NAME_Contents)); } -char *pdf_annot_author(fz_context *ctx, pdf_annot *annot) +const char *pdf_annot_author(fz_context *ctx, pdf_annot *annot) { return pdf_to_str_buf(ctx, pdf_dict_get(ctx, annot->obj, PDF_NAME_T)); } -char *pdf_annot_date(fz_context *ctx, pdf_annot *annot) +const char *pdf_annot_date(fz_context *ctx, pdf_annot *annot) { return pdf_to_str_buf(ctx, pdf_dict_get(ctx, annot->obj, PDF_NAME_CreationDate)); } -- cgit v1.2.3