[gnome-db] gda_xml_value_stringify problem
- From: Álvaro Peña González <apg esware com>
- To: gnome-db-list gnome org
- Subject: [gnome-db] gda_xml_value_stringify problem
- Date: Wed, 28 Apr 2004 14:03:59 +0200
Hi all,
I have found a problem opening a xml database, the problem is that a
boolean value is saved translated, for example a TRUE is turned to
VERDADERO (spanish), and then the opening generate a error.
I have attachment a patch that don't use gda_xml_value_stringify if the
value type is boolean, only for xml an txt databases.
What do you think?
regards, apg.
Álvaro Peña
http://blogs.esware.com/apg
apg esware com
Index: libgda/gda-data-model.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-data-model.c,v
retrieving revision 1.44
diff -u -r1.44 gda-data-model.c
--- libgda/gda-data-model.c 20 Apr 2004 15:55:36 -0000 1.44
+++ libgda/gda-data-model.c 28 Apr 2004 11:34:32 -0000
@@ -962,7 +962,10 @@
gchar *txt;
value = gda_data_model_get_value_at (model, c, r);
- txt = gda_value_stringify ((GdaValue *) value);
+ if (gda_value_get_type (value) == GDA_VALUE_TYPE_BOOLEAN)
+ txt = gda_value_get_boolean (value) ? "TRUE" : "FALSE";
+ else
+ txt = gda_value_stringify (value);
if (c > 0)
str = g_string_append_c (str, sep);
str = g_string_append_c (str, '"');
@@ -1137,7 +1140,10 @@
gchar *str;
value = gda_data_model_get_value_at (model, c, r);
- str = gda_value_stringify (value);
+ if (gda_value_get_type (value) == GDA_VALUE_TYPE_BOOLEAN)
+ str = gda_value_get_boolean (value) ? "TRUE" : "FALSE";
+ else
+ str = gda_value_stringify (value);
field = xmlNewChild (row, NULL, "value", str);
xml_set_int (field, "position", c);
xmlSetProp (field, "gdatype", gda_type_to_string (gda_value_get_type (value)));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]