[libgsf] Fix gsf_xml_out_start_element to allow child elements mixed with other content



commit 9f2c71a754b1b4a1169cbacfee926cb7bd37cdf7
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Wed May 13 23:39:02 2009 -0600

     Fix gsf_xml_out_start_element to allow child elements mixed with other content
    
    2009-05-13  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* gsf/gsf-libxml.c (gsf_xml_out_start_element): remove erroneous
    	  g_return_if_fail. Note that some part of the code specifically
    	  handles that situation.
    	(close_tag_if_neccessary): If we are in GSF_XML_OUT_CHILD we need
    	  not close the tag
---
 ChangeLog        |    8 ++++++++
 NEWS             |    2 ++
 gsf/gsf-libxml.c |    3 +--
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e20d128..beb8194 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-05-13  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* gsf/gsf-libxml.c (gsf_xml_out_start_element): remove erroneous
+	  g_return_if_fail. Note that some part of the code specifically 
+	  handles that situation.
+	(close_tag_if_neccessary): If we are in GSF_XML_OUT_CHILD we need
+	  not close the tag
+
 2009-05-10  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* gsf/gsf-opendoc-utils.h: add namespace enumeration constant for 
diff --git a/NEWS b/NEWS
index 479cd53..4f1a923 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ libgsf 1.14.14
 
 Andreas:
 	* Added namespaces used by openoffice 3.0, Lotus Symphony, etc.
+	* Fix gsf_xml_out_start_element to allow child elements mixed
+	  with other content
 
 --------------------------------------------------------------------------
 libgsf 1.14.13
diff --git a/gsf/gsf-libxml.c b/gsf/gsf-libxml.c
index 992cb5b..79fa159 100644
--- a/gsf/gsf-libxml.c
+++ b/gsf/gsf-libxml.c
@@ -1441,7 +1441,6 @@ gsf_xml_out_start_element (GsfXMLOut *xout, char const *id)
 {
 	g_return_if_fail (id != NULL);
 	g_return_if_fail (xout != NULL);
-	g_return_if_fail (xout->state != GSF_XML_OUT_CONTENT);
 
 	if (xout->needs_header) {
 		static char const header0[] =
@@ -1562,7 +1561,7 @@ gsf_xml_out_simple_float_element (GsfXMLOut *xout, char const *id,
 static void
 close_tag_if_neccessary (GsfXMLOut* xout)
 {
-	if (xout->state != GSF_XML_OUT_CONTENT) {
+	if (xout->state == GSF_XML_OUT_NOCONTENT) {
 		xout->state = GSF_XML_OUT_CONTENT;
 		gsf_output_write (xout->output, 1, ">");
 	}



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