goffice r2238 - in trunk: . goffice/app



Author: jody
Date: Wed Oct 15 08:19:32 2008
New Revision: 2238
URL: http://svn.gnome.org/viewvc/goffice?rev=2238&view=rev

Log:
2008-10-14  Jody Goldberg <jody gnome org>

	* /gnome/src/goffice/goffice/app/go-doc.c (go_doc_write) : only
	  generate a GODoc node if there is something to put in.


Modified:
   trunk/ChangeLog
   trunk/goffice/app/go-doc.c

Modified: trunk/goffice/app/go-doc.c
==============================================================================
--- trunk/goffice/app/go-doc.c	(original)
+++ trunk/goffice/app/go-doc.c	Wed Oct 15 08:19:32 2008
@@ -396,9 +396,11 @@
 void
 go_doc_write (GODoc *doc, GsfXMLOut *output)
 {
-	gsf_xml_out_start_element (output, "GODoc");
-	g_hash_table_foreach (doc->imagebuf, save_image_cb, output);
-	gsf_xml_out_end_element (output);
+	if (g_hash_table_size (doc->imagebuf) > 0) {
+		gsf_xml_out_start_element (output, "GODoc");
+		g_hash_table_foreach (doc->imagebuf, save_image_cb, output);
+		gsf_xml_out_end_element (output);
+	}
 	g_hash_table_destroy (doc->imagebuf);
 	doc->imagebuf = NULL;
 }



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