Only append a node when its role is known and really handled

This commit is contained in:
Pierre Pronchery 2010-11-13 23:04:51 +00:00
parent fa52529c53
commit 6eb7ba6f9b

View File

@ -339,14 +339,15 @@ static void _open_document_node(XMLEditor * xmleditor, XMLNode * node,
if(node == NULL)
return;
gtk_tree_store_append(xmleditor->store, &iter, parent);
switch(node->type)
{
case XML_NODE_TYPE_DATA:
gtk_tree_store_append(xmleditor->store, &iter, parent);
gtk_tree_store_set(xmleditor->store, &iter, 0,
node->data.buffer, -1);
break;
case XML_NODE_TYPE_TAG:
gtk_tree_store_append(xmleditor->store, &iter, parent);
gtk_tree_store_set(xmleditor->store, &iter, 0,
node->tag.name, -1);
for(i = 0; i < node->tag.childs_cnt; i++)