[gnumeric] fix some criticals
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnumeric] fix some criticals
- Date: Sun, 17 May 2009 21:06:58 -0400 (EDT)
commit 5b517628d73860b2538c73c73c42b6b460b3a072
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date: Sun May 17 19:06:30 2009 -0600
fix some criticals
2009-05-17 Andreas J. Guelzow <aguelzow pyrshep ca>
* html.c (html_write_cell_content): make sure there is
markup before asking for it.
2009-05-17 Andreas J. Guelzow <aguelzow pyrshep ca>
* openoffice-read.c (odf_find_style): make sure that we would
correctly handle the case that we are trying to find a style we
did not write.
---
plugins/html/ChangeLog | 5 +++++
plugins/html/html.c | 4 +++-
plugins/openoffice/ChangeLog | 6 ++++++
plugins/openoffice/openoffice-write.c | 17 ++++++++++-------
4 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/plugins/html/ChangeLog b/plugins/html/ChangeLog
index 04ce1b9..b56f397 100644
--- a/plugins/html/ChangeLog
+++ b/plugins/html/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-17 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * html.c (html_write_cell_content): make sure there is
+ markup before asking for it.
+
2009-05-13 Andreas J. Guelzow <aguelzow pyrshep ca>
* html.c (html_write_cell_content): remember that not
diff --git a/plugins/html/html.c b/plugins/html/html.c
index 2ffadc9..d5dd7bb 100644
--- a/plugins/html/html.c
+++ b/plugins/html/html.c
@@ -286,7 +286,9 @@ html_write_cell_content (GsfOutput *output, GnmCell *cell, GnmStyle const *style
gsf_output_printf (output, "<font color=\"#%02X%02X%02X\">", r, g, b);
}
- if ((cell->value->type == VALUE_STRING) && (VALUE_FMT (cell->value) != NULL))
+ if ((cell->value->type == VALUE_STRING)
+ && (VALUE_FMT (cell->value) != NULL)
+ && go_format_is_markup (VALUE_FMT (cell->value)))
markup = go_format_get_markup (VALUE_FMT (cell->value));
if (markup != NULL) {
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 8d52347..65a9801 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-17 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * openoffice-read.c (odf_find_style): make sure that we would
+ correctly handle the case that we are trying to find a style we
+ did not write.
+
2009-05-16 Andreas J. Guelzow <aguelzow pyrshep ca>
* openoffice-read.c (oo_set_gnm_border): new
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 6895463..8b85793 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -626,18 +626,21 @@ odf_find_style (GnmOOExport *state, GnmStyle const *style, gboolean write)
new_style = found->data;
return new_style->name;
} else {
- new_style = g_new0 (cell_styles_t,1);
- new_style->style = style;
- gnm_style_ref (style);
- new_style->counter = g_slist_length (state->cell_styles);
- new_style->name = g_strdup_printf ("ACELL-%i", new_style->counter);
- state->cell_styles = g_slist_prepend (state->cell_styles, new_style);
if (write) {
+ new_style = g_new0 (cell_styles_t,1);
+ new_style->style = style;
+ gnm_style_ref (style);
+ new_style->counter = g_slist_length (state->cell_styles);
+ new_style->name = g_strdup_printf ("ACELL-%i", new_style->counter);
+ state->cell_styles = g_slist_prepend (state->cell_styles, new_style);
odf_start_style (state->xml, new_style->name, "table-cell");
odf_write_style (state, new_style->style);
gsf_xml_out_end_element (state->xml); /* </style:style */
+ return new_style->name;
+ } else {
+ g_warning("We forgot to export a required style!");
+ return "Missing-Style";
}
- return new_style->name;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]