[gnome-builder/wip/slaf/xml-pack: 55/56] xml-pack: fix nodes handling



commit e9e50d98e078dd51df1c0491914139fa571585c4
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Thu Jul 13 13:47:31 2017 +0200

    xml-pack: fix nodes handling
    
    In .ui files, we need to handle node with no
    'name' attribute yet.
    
    In node parsing main loop, we need to be sure that
    the node exist before changing its value.

 plugins/xml-pack/ide-xml-parser.c      |    2 +-
 plugins/xml-pack/ide-xml-symbol-node.c |    2 --
 2 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/plugins/xml-pack/ide-xml-parser.c b/plugins/xml-pack/ide-xml-parser.c
index 9be76a1..cfa399a 100644
--- a/plugins/xml-pack/ide-xml-parser.c
+++ b/plugins/xml-pack/ide-xml-parser.c
@@ -194,7 +194,7 @@ ide_xml_parser_state_processing (IdeXmlParser          *self,
 
   g_assert (IDE_IS_XML_SYMBOL_NODE (node) || node == NULL);
 
-  if (callback_type == IDE_XML_SAX_CALLBACK_TYPE_CHAR)
+  if (callback_type == IDE_XML_SAX_CALLBACK_TYPE_CHAR && IDE_IS_XML_SYMBOL_NODE (node))
     {
       ide_xml_symbol_node_set_value (state->current_node, element_name);
       return;
diff --git a/plugins/xml-pack/ide-xml-symbol-node.c b/plugins/xml-pack/ide-xml-symbol-node.c
index cb1f5af..d93c9e6 100644
--- a/plugins/xml-pack/ide-xml-symbol-node.c
+++ b/plugins/xml-pack/ide-xml-symbol-node.c
@@ -155,8 +155,6 @@ ide_xml_symbol_node_new (const gchar            *name,
   IdeXmlSymbolNode *self;
   IdeSymbolFlags flags = IDE_SYMBOL_FLAGS_NONE;
 
-  g_return_val_if_fail (!ide_str_empty0 (name), NULL);
-
   self = g_object_new (IDE_TYPE_XML_SYMBOL_NODE,
                        "name", name,
                        "kind", kind,


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