[libgsf] Write/read the correct attribute name for the value-type of user defined meta-data.



commit e629c991eded1bc16cf6b60144f1a162bf2bb6fc
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon May 9 21:41:27 2011 -0600

    Write/read the correct attribute name for the value-type of user defined meta-data.
    
    2011-05-09  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* gsf/gsf-opendoc-utils.c (od_meta_user_defined): check for all ODF defined
    	value types and use the correct attribute name
    	(meta_write_props): use the correct attribute name

 ChangeLog               |    6 ++++++
 NEWS                    |    2 ++
 gsf/gsf-opendoc-utils.c |   13 +++++++++++--
 3 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7b735cf..2418905 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-05-09  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* gsf/gsf-opendoc-utils.c (od_meta_user_defined): check for all ODF defined
+	value types and use the correct attribute name
+	(meta_write_props): use the correct attribute name
+
+2011-05-09  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* gsf/gsf-opendoc-utils.c (od_meta_user_defined): initialize type
 	and name.
 
diff --git a/NEWS b/NEWS
index 2786850..df07e09 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ libgsf 1.14.21
 Andreas:
 	* Fix crash on encountering user defined meta data of default 
 	type. [649827]
+	* Write/read the correct attribute name for the value-type of user
+	defined meta-data. 
 
 Gilles Dartiguelongue:
 	* Implement --without-gconf for explicit dependency control.  [#645775]
diff --git a/gsf/gsf-opendoc-utils.c b/gsf/gsf-opendoc-utils.c
index 477e387..8c3d333 100644
--- a/gsf/gsf-opendoc-utils.c
+++ b/gsf/gsf-opendoc-utils.c
@@ -217,7 +217,13 @@ od_meta_user_defined (GsfXMLIn *xin,  xmlChar const **attrs)
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
 		if (!strcmp (CXML2C (attrs[0]), "meta:name"))
 			mi->name = g_strdup (CXML2C (attrs[1]));
-		else if (!strcmp (CXML2C (attrs[0]), "meta:type")) {
+		else if (!strcmp (CXML2C (attrs[0]), "meta:value-type") ||
+			 !strcmp (CXML2C (attrs[0]), "meta:type")) {
+				/*
+				 * "meta:type" is a typo on the write 
+				 * side that was
+				 * fixed on 20110509.
+				 */
 			if (!strcmp (CXML2C (attrs[1]), "boolean")) {
 				mi->typ = G_TYPE_BOOLEAN;
 			} else if (!strcmp (CXML2C (attrs[1]), "float")) {
@@ -231,6 +237,9 @@ od_meta_user_defined (GsfXMLIn *xin,  xmlChar const **attrs)
 				 * fixed on 20110311.
 				 */
 				mi->typ = GSF_TIMESTAMP_TYPE;
+			} else if (!strcmp (CXML2C (attrs[1]), "time")) {
+				mi->typ = G_TYPE_STRING;
+				/* We should be able to do better */
 			} else {
 				/* What? */
 			}
@@ -542,7 +551,7 @@ meta_write_props (char const *prop_name, GsfDocProp *prop, GsfXMLOut *output)
 				type_name = "date";
 		}
 		if (NULL != type_name)
-			gsf_xml_out_add_cstr (output, "meta:type", type_name);
+			gsf_xml_out_add_cstr (output, "meta:value-type", type_name);
 	} else
 		gsf_xml_out_start_element (output, mapped_name);
 	if (NULL != val)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]