[gnumeric] Export validation error message to ODF.
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Export validation error message to ODF.
- Date: Sat, 28 Apr 2012 16:29:50 +0000 (UTC)
commit a11db72361cbbf20cc41a46762aeaa6d4ad62606
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Sat Apr 28 10:28:32 2012 -0600
Export validation error message to ODF.
2012-04-27 Andreas J. Guelzow <aguelzow pyrshep ca>
* openoffice-read.c (odf_hf_file): use the correct attribute name
* openoffice-write.c (odf_print_spreadsheet_content_validations):
write validation error message
NEWS | 1 +
plugins/openoffice/ChangeLog | 2 +
plugins/openoffice/openoffice-write.c | 36 +++++++++++++++++++++++++++++++++
3 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index b86029c..612774a 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Andreas:
* Handle coloured text formatting during ODF import.
* Import text box text formatting during ODF import. [#672815]
* Improve import of page headers from ODF.
+ * Export validation error message to ODF.
--------------------------------------------------------------------------
Gnumeric 1.11.3
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 3b5896d..22da36b 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,6 +1,8 @@
2012-04-27 Andreas J. Guelzow <aguelzow pyrshep ca>
* openoffice-read.c (odf_hf_file): use the correct attribute name
+ * openoffice-write.c (odf_print_spreadsheet_content_validations):
+ write validation error message
2012-04-27 Andreas J. Guelzow <aguelzow pyrshep ca>
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 519525a..0426d23 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -4249,6 +4249,42 @@ odf_print_spreadsheet_content_validations (GnmOOExport *state)
odf_validation_custom (state, val, sheet, sr, &pp);
break;
}
+
+ /* writing error message */
+ if (val->msg != NULL && go_string_get_len (val->msg) > 0) {
+ char const *message_type = NULL;
+ gboolean white_written = TRUE;
+ gboolean pp = TRUE;
+
+ gsf_xml_out_start_element (state->xml,
+ TABLE "error-message");
+ odf_add_bool (state->xml, TABLE "display", TRUE);
+ switch (val->style) {
+ case GNM_VALIDATION_STYLE_NONE:
+ case GNM_VALIDATION_STYLE_INFO:
+ case GNM_VALIDATION_STYLE_PARSE_ERROR:
+ message_type = "information";
+ break;
+ case GNM_VALIDATION_STYLE_STOP:
+ message_type = "stop";
+ break;
+ case GNM_VALIDATION_STYLE_WARNING:
+ message_type = "warning";
+ break;
+ }
+ gsf_xml_out_add_cstr_unchecked (state->xml, TABLE "message-type", message_type);
+ if (val->title != NULL)
+ gsf_xml_out_add_cstr (state->xml, TABLE "title", val->title->str);
+ g_object_get (G_OBJECT (state->xml), "pretty-print", &pp, NULL);
+ g_object_set (G_OBJECT (state->xml), "pretty-print", FALSE, NULL);
+ gsf_xml_out_start_element (state->xml, TEXT "p");
+ odf_add_chars (state, val->msg->str, go_string_get_len (val->msg), &white_written);
+ gsf_xml_out_end_element (state->xml); /* p */
+ g_object_set (G_OBJECT (state->xml), "pretty-print", pp, NULL);
+ gsf_xml_out_end_element (state->xml);
+ }
+ /* error message written */
+
gsf_xml_out_end_element (state->xml);
/* </table:content-validation> */
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]