PopplerDocument *document;
gchar *password;
- gboolean modified;
+ gboolean forms_modified;
+ gboolean annots_modified;
PopplerFontInfo *font_info;
PopplerFontsIter *fonts_iter;
gboolean retval;
GError *poppler_error = NULL;
- if (pdf_document->modified) {
+ if (pdf_document->forms_modified || pdf_document->annots_modified) {
retval = poppler_document_save (pdf_document->document,
uri, &poppler_error);
+ if (retval) {
+ pdf_document->forms_modified = FALSE;
+ pdf_document->annots_modified = FALSE;
+ }
} else {
retval = poppler_document_save_a_copy (pdf_document->document,
uri, &poppler_error);
(GDestroyNotify)g_object_unref) : NULL;
}
+static gboolean
+pdf_document_forms_document_is_modified (EvDocumentForms *document)
+{
+ return PDF_DOCUMENT (document)->forms_modified;
+}
+
static gchar *
pdf_document_forms_form_field_text_get_text (EvDocumentForms *document,
EvFormField *field)
return;
poppler_form_field_text_set_text (poppler_field, text);
- PDF_DOCUMENT (document)->modified = TRUE;
+ PDF_DOCUMENT (document)->forms_modified = TRUE;
}
static void
return;
poppler_form_field_button_set_state (poppler_field, state);
- PDF_DOCUMENT (document)->modified = TRUE;
+ PDF_DOCUMENT (document)->forms_modified = TRUE;
}
static gboolean
return;
poppler_form_field_choice_select_item (poppler_field, index);
- PDF_DOCUMENT (document)->modified = TRUE;
+ PDF_DOCUMENT (document)->forms_modified = TRUE;
}
static void
return;
poppler_form_field_choice_toggle_item (poppler_field, index);
- PDF_DOCUMENT (document)->modified = TRUE;
+ PDF_DOCUMENT (document)->forms_modified = TRUE;
}
static void
return;
poppler_form_field_choice_unselect_all (poppler_field);
- PDF_DOCUMENT (document)->modified = TRUE;
+ PDF_DOCUMENT (document)->forms_modified = TRUE;
}
static void
return;
poppler_form_field_choice_set_text (poppler_field, text);
- PDF_DOCUMENT (document)->modified = TRUE;
+ PDF_DOCUMENT (document)->forms_modified = TRUE;
}
static gchar *
pdf_document_document_forms_iface_init (EvDocumentFormsInterface *iface)
{
iface->get_form_fields = pdf_document_forms_get_form_fields;
+ iface->document_is_modified = pdf_document_forms_document_is_modified;
iface->form_field_text_get_text = pdf_document_forms_form_field_text_get_text;
iface->form_field_text_set_text = pdf_document_forms_form_field_text_set_text;
iface->form_field_button_set_state = pdf_document_forms_form_field_button_set_state;
return mapping_list;
}
+static gboolean
+pdf_document_annotations_document_is_modified (EvDocumentAnnotations *document_annotations)
+{
+ return PDF_DOCUMENT (document_annotations)->annots_modified;
+}
+
#ifdef HAVE_POPPLER_PAGE_ADD_ANNOT
static void
pdf_document_annotations_add_annotation (EvDocumentAnnotations *document_annotations,
ev_mapping_list_ref (mapping_list));
}
- pdf_document->modified = TRUE;
+ pdf_document->annots_modified = TRUE;
}
#endif /* HAVE_POPPLER_PAGE_ADD_ANNOT */
}
}
#endif /* HAVE_POPPLER_PAGE_ADD_ANNOT */
- PDF_DOCUMENT (document_annotations)->modified = TRUE;
+ PDF_DOCUMENT (document_annotations)->annots_modified = TRUE;
}
static void
pdf_document_document_annotations_iface_init (EvDocumentAnnotationsInterface *iface)
{
iface->get_annotations = pdf_document_annotations_get_annotations;
+ iface->document_is_modified = pdf_document_annotations_document_is_modified;
#ifdef HAVE_POPPLER_PAGE_ADD_ANNOT
iface->add_annotation = pdf_document_annotations_add_annotation;
#endif