summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2011-10-09 14:45:46 -0400
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2011-10-09 15:00:12 -0400
commitee98d82585da32c84c7f3c0d8239b0445f89a263 (patch)
treee6e661b7de9e3e8deb2afd9ebd8c7b8db5f0d73f
parent18a99f9e170f3ae2534fbabadb5a9f78899ed7cf (diff)
downloadglade-ee98d82585da32c84c7f3c0d8239b0445f89a263.tar.gz
* gladeui/glade-property.c, gladeui/glade-xml-utils.c:
Fix a bug on the GtkComboBoxText (and probably others) when adding a special char (like '&') in an item's name: every characters following the special char disappeared while writting the xml file. Bug 654609.
-rw-r--r--ChangeLog10
-rw-r--r--gladeui/glade-property.c7
-rw-r--r--gladeui/glade-xml-utils.c8
3 files changed, 17 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index e6bf68b8..996bb947 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-10-09 Fabien Parent <parent.f@gmail.com>
+
+ * gladeui/glade-property.c, gladeui/glade-xml-utils.c:
+
+ Fix a bug on the GtkComboBoxText (and probably others) when adding
+ a special char (like '&') in an item's name: every characters following
+ the special char disappeared while writting the xml file.
+
+ Bug 654609.
+
2011-10-06 Tristan Van Berkom <tvb@gnome.org>
* gladeui/glade-widget-adaptor.c: Implemented a generic ->depends() routine
diff --git a/gladeui/glade-property.c b/gladeui/glade-property.c
index 8bd9bc82..a90d2561 100644
--- a/gladeui/glade-property.c
+++ b/gladeui/glade-property.c
@@ -1192,13 +1192,6 @@ glade_property_write (GladeProperty * property,
* funcs that may not like NULL.
*/
value = g_strdup ("");
- else
- {
- /* Escape the string so that it will be parsed as it should. */
- tmp = value;
- value = g_markup_escape_text (value, -1);
- g_free (tmp);
- }
/* Now dump the node values... */
prop_node = glade_xml_node_new (context, GLADE_XML_TAG_PROPERTY);
diff --git a/gladeui/glade-xml-utils.c b/gladeui/glade-xml-utils.c
index 29fb2aed..aea3f77d 100644
--- a/gladeui/glade-xml-utils.c
+++ b/gladeui/glade-xml-utils.c
@@ -123,8 +123,14 @@ void
glade_xml_set_content (GladeXmlNode * node_in, const gchar * content)
{
xmlNodePtr node = (xmlNodePtr) node_in;
+ xmlChar *content_encoded;
- xmlNodeSetContent (node, BAD_CAST (content));
+ g_return_if_fail (node != NULL);
+ g_return_if_fail (node->doc != NULL);
+
+ content_encoded = xmlEncodeSpecialChars (node->doc, BAD_CAST (content));
+ xmlNodeSetContent (node, BAD_CAST (content_encoded));
+ xmlFree (content_encoded);
}
/*