[gnumeric] fix criticals in ODF export
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnumeric] fix criticals in ODF export
- Date: Sat, 16 May 2009 03:38:05 -0400 (EDT)
commit e87f3c04dda09b404575adc4dc0132ef3714b3ed
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date: Sat May 16 01:37:31 2009 -0600
fix criticals in ODF export
2009-05-15 Andreas J. Guelzow <aguelzow pyrshep ca>
* openoffice-write.c (odf_write_cell): watch for empty rendered
strings
---
plugins/openoffice/ChangeLog | 5 +++++
plugins/openoffice/openoffice-write.c | 12 ++++++++----
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 94d6356..a23c18d 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,10 @@
2009-05-15 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * openoffice-write.c (odf_write_cell): watch for empty rendered
+ strings
+
+2009-05-15 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* openoffice-write.c (gnm_xml_out_add_hex_color): new
(odf_write_style): write more aspects of this style
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 553702d..c569d59 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -358,7 +358,7 @@ odf_write_table_style (GnmOOExport *state,
sheet->visibility == GNM_SHEET_VISIBILITY_VISIBLE);
gsf_xml_out_add_cstr_unchecked (state->xml, STYLE "writing-mode",
sheet->text_is_rtl ? "rl-tb" : "lr-tb");
- gsf_xml_out_end_element (state->xml); /* </style:properties> */
+ gsf_xml_out_end_element (state->xml); /* </style:table-properties> */
gsf_xml_out_end_element (state->xml); /* </style:style> */
}
@@ -881,9 +881,13 @@ odf_write_cell (GnmOOExport *state, GnmCell *cell, GnmRange const *merge_range,
char *rendered_string = gnm_cell_get_rendered_text (cell);
gboolean white_written = TRUE;
- gsf_xml_out_start_element (state->xml, TEXT "p");
- odf_add_chars (state, rendered_string, strlen (rendered_string), &white_written);
- gsf_xml_out_end_element (state->xml); /* p */
+ if (*rendered_string != '\0') {
+ gsf_xml_out_start_element (state->xml, TEXT "p");
+ odf_add_chars (state, rendered_string,
+ strlen (rendered_string),
+ &white_written);
+ gsf_xml_out_end_element (state->xml); /* p */
+ }
g_free (rendered_string);
} else if ((cell->value != NULL) && (VALUE_FMT (cell->value) != NULL)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]