summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-annot-edit.c
diff options
context:
space:
mode:
authorFred Ross-Perry <fred.ross-perry@artifex.com>2017-10-23 14:43:16 -0700
committerTor Andersson <tor.andersson@artifex.com>2017-11-22 23:09:51 +0100
commitb13d7c7d2609ae32cb8fd4931eee12084e7b77b3 (patch)
treeefa4951f17d5b4616f3729a8bdd1353e6db8d6a1 /source/pdf/pdf-annot-edit.c
parentc2d7be0947d2c7d730f84270149cf3c3c6180a55 (diff)
downloadmupdf-b13d7c7d2609ae32cb8fd4931eee12084e7b77b3.tar.xz
jni: Make sure to dirty annotation whenever it changes.
Diffstat (limited to 'source/pdf/pdf-annot-edit.c')
-rw-r--r--source/pdf/pdf-annot-edit.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c
index d0ad0915..20aeff11 100644
--- a/source/pdf/pdf-annot-edit.c
+++ b/source/pdf/pdf-annot-edit.c
@@ -232,7 +232,7 @@ pdf_set_annot_flags(fz_context *ctx, pdf_annot *annot, int flags)
{
pdf_document *doc = annot->page->doc;
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_F, pdf_new_int(ctx, doc, flags));
- annot->changed = 1;
+ pdf_dirty_annot(ctx, annot);
}
void
@@ -256,7 +256,7 @@ pdf_set_annot_rect(fz_context *ctx, pdf_annot *annot, const fz_rect *rect)
fz_transform_rect(&trect, &inv_page_ctm);
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_Rect, pdf_new_rect(ctx, doc, &trect));
- annot->changed = 1;
+ pdf_dirty_annot(ctx, annot);
}
const char *
@@ -270,7 +270,7 @@ pdf_set_annot_contents(fz_context *ctx, pdf_annot *annot, const char *text)
{
pdf_document *doc = annot->page->doc;
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_Contents, pdf_new_string(ctx, doc, text, strlen(text)));
- annot->changed = 1;
+ pdf_dirty_annot(ctx, annot);
}
static pdf_obj *open_subtypes[] = {
@@ -300,6 +300,7 @@ pdf_set_annot_is_open(fz_context *ctx, pdf_annot *annot, int is_open)
check_allowed_subtypes(ctx, annot, PDF_NAME_Open, open_subtypes);
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_Open,
pdf_new_bool(ctx, doc, is_open));
+ pdf_dirty_annot(ctx, annot);
}
static pdf_obj *icon_name_subtypes[] = {
@@ -329,6 +330,7 @@ pdf_set_annot_icon_name(fz_context *ctx, pdf_annot *annot, const char *name)
pdf_document *doc = annot->page->doc;
check_allowed_subtypes(ctx, annot, PDF_NAME_Name, icon_name_subtypes);
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_Name, pdf_new_name(ctx, doc, name));
+ pdf_dirty_annot(ctx, annot);
}
static int line_ending_value(fz_context *ctx, pdf_obj *line_ending)
@@ -398,6 +400,7 @@ pdf_set_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, int start_st
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_LE, style);
pdf_array_put_drop(ctx, style, 0, line_ending_name(ctx, start_style));
pdf_array_put_drop(ctx, style, 1, line_ending_name(ctx, end_style));
+ pdf_dirty_annot(ctx, annot);
}
float
@@ -428,8 +431,7 @@ pdf_set_annot_border(fz_context *ctx, pdf_annot *annot, float w)
/* 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);
-
- annot->changed = 1;
+ pdf_dirty_annot(ctx, annot);
}
static void pdf_annot_color_imp(fz_context *ctx, pdf_annot *annot, pdf_obj *key, int *n, float color[4], pdf_obj **allowed)
@@ -521,7 +523,7 @@ static void pdf_set_annot_color_imp(fz_context *ctx, pdf_annot *annot, pdf_obj *
}
pdf_dict_put_drop(ctx, annot->obj, key, arr);
- annot->changed = 1;
+ pdf_dirty_annot(ctx, annot);
}
void
@@ -630,7 +632,7 @@ pdf_set_annot_vertices(fz_context *ctx, pdf_annot *annot, int n, const float *v)
pdf_array_push_drop(ctx, vertices, pdf_new_real(ctx, doc, point.y));
}
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_Vertices, vertices);
- annot->changed = 1;
+ pdf_dirty_annot(ctx, annot);
}
static pdf_obj *quad_point_subtypes[] = {
@@ -708,7 +710,7 @@ pdf_set_annot_quad_points(fz_context *ctx, pdf_annot *annot, int n, const float
}
}
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_QuadPoints, quad_points);
- annot->changed = 1;
+ pdf_dirty_annot(ctx, annot);
}
static pdf_obj *ink_list_subtypes[] = {
@@ -799,7 +801,7 @@ pdf_set_annot_ink_list(fz_context *ctx, pdf_annot *annot, int n, const int *coun
pdf_array_push_drop(ctx, ink_list, stroke);
}
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_InkList, ink_list);
- annot->changed = 1;
+ pdf_dirty_annot(ctx, annot);
}
static void find_free_font_name(fz_context *ctx, pdf_obj *fdict, char *buf, int buf_size)