Commit 4cfb3013 authored by Andreas J. Guelzow 's avatar Andreas J. Guelzow

Map TRUE->TRUE() and FALSE->FALSE on ODF export

2012-03-26  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* src/expr.c (do_expr_as_string): use new convs->output.boolean
	* src/parse-util.h (_GnmConventions): add output.boolean
	* src/parse-util.c (gnm_conventions_new_full): initialize output.boolean

2012-03-26  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* openoffice-write.c (odf_boolean_handler): new
	(odf_expr_conventions_new): connect the above
parent cf502498
2012-03-26 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/expr.c (do_expr_as_string): use new convs->output.boolean
* src/parse-util.h (_GnmConventions): add output.boolean
* src/parse-util.c (gnm_conventions_new_full): initialize output.boolean
2012-03-26 Jean Brefort <jean.brefort@normalesup.org>
* src/sheet-object-image.c (sheet_object_image_set_image),
......
2012-03-26 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* openoffice-write.c (odf_boolean_handler): new
(odf_expr_conventions_new): connect the above
2012-03-26 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* openoffice-read.c (odf_func_true_handler): new
......
......@@ -2547,6 +2547,12 @@ odf_string_handler (GnmConventionsOut *out, GOString const *str)
odf_print_string (out, str->str, '"');
}
static void
odf_boolean_handler (GnmConventionsOut *out, gboolean val)
{
g_string_append (out->accum, val ? "TRUE()" : "FALSE()");
}
static GnmConventions *
odf_expr_conventions_new (void)
......@@ -2564,6 +2570,7 @@ odf_expr_conventions_new (void)
conv->output.cell_ref = odf_cellref_as_string;
conv->output.range_ref = odf_rangeref_as_string;
conv->output.func = odf_expr_func_handler;
conv->output.boolean = odf_boolean_handler;
return conv;
}
......
......@@ -1729,6 +1729,13 @@ do_expr_as_string (GnmExpr const *expr, int paren_level,
return;
}
if (v->type == VALUE_BOOLEAN &&
out->convs->output.boolean != NULL) {
out->convs->output.boolean (out, v->v_bool.val);
return;
}
value_get_as_gstring (v, target, out->convs);
/* If the number has a sign, pretend that it is the result of
......
......@@ -1406,6 +1406,7 @@ gnm_conventions_new_full (unsigned size)
convs->output.func = std_expr_func_handler;
convs->output.cell_ref = cellref_as_string;
convs->output.range_ref = rangeref_as_string;
convs->output.boolean = NULL;
convs->output.quote_sheet_name = std_sheet_name_quote;
return convs;
......
......@@ -193,6 +193,8 @@ struct _GnmConventions {
gboolean no_sheetname);
void (*range_ref) (GnmConventionsOut *out,
GnmRangeRef const *range_ref);
void (*boolean) (GnmConventionsOut *out,
gboolean val);
GString * (*quote_sheet_name) (GnmConventions const *convs,
char const *name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment