diff options
author | Paul Gardiner <paulg.artifex@glidos.net> | 2012-08-02 15:32:33 +0100 |
---|---|---|
committer | Paul Gardiner <paulg.artifex@glidos.net> | 2012-08-02 15:32:33 +0100 |
commit | 8068b7ba7ac0f103f4770736518fe7e545ceba30 (patch) | |
tree | 1a59b6679afa111bbf61c57d60c873824d977636 /pdf/pdf_form.c | |
parent | 201eeb77a65b25263daf8015746a0127692b87df (diff) | |
download | mupdf-8068b7ba7ac0f103f4770736518fe7e545ceba30.tar.xz |
Forms: add document dirty flag
Diffstat (limited to 'pdf/pdf_form.c')
-rw-r--r-- | pdf/pdf_form.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pdf/pdf_form.c b/pdf/pdf_form.c index d74316fa..d1ca8474 100644 --- a/pdf/pdf_form.c +++ b/pdf/pdf_form.c @@ -1387,6 +1387,8 @@ static void reset_field(pdf_document *doc, pdf_obj *obj) { fz_context *ctx = doc->ctx; + doc->dirty = 1; + switch (pdf_field_getType(doc, obj)) { case FZ_WIDGET_TYPE_RADIOBUTTON: @@ -1670,6 +1672,11 @@ static void toggle_check_box(pdf_document *doc, pdf_obj *obj) /* FIXME: should probably update the V entry in the field dictionary too */ } +int pdf_has_unsaved_changes(pdf_document *doc) +{ + return doc->dirty; +} + int pdf_pass_event(pdf_document *doc, pdf_page *page, fz_ui_event *ui_event) { pdf_annot *annot; @@ -1826,6 +1833,8 @@ static void recalculate(pdf_document *doc) void pdf_field_setValue(pdf_document *doc, pdf_obj *field, char *text) { + doc->dirty = 1; + update_text_field_value(doc->ctx, field, text); recalculate(doc); pdf_field_mark_dirty(doc->ctx, field); |