]> Pileus Git - ~andy/gtk/commitdiff
Don't crash if a node has no name. (start_element_handler): Accept
authorMatthias Clasen <mclasen@redhat.com>
Tue, 13 Apr 2004 20:06:12 +0000 (20:06 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 13 Apr 2004 20:06:12 +0000 (20:06 +0000)
2004-04-13  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkuimanager.c (get_child_node): Don't crash if a node
has no name.
(start_element_handler): Accept separators without unique
names.  (#133302, Anders Carlsson)

* gtk/gtkuimanager.c (node_remove_ui_reference): Don't leak
list nodes.  (#138862, Morten Welinder)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/reference/ChangeLog
docs/reference/gtk/tmpl/gtkuimanager.sgml
gtk/gtkuimanager.c

index b6c801da263bd5316df5c71dec35627ae6883fe9..26ee54d8d5ddda39bf77708ef5b921e789168f83 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2004-04-13  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkuimanager.c (get_child_node): Don't crash if a node 
+       has no name.
+       (start_element_handler): Accept separators without unique 
+       names.  (#133302, Anders Carlsson)
+
        * gtk/gtkactiongroup.c (gtk_action_group_add_action): Document
        possible accelerator gotcha when using this function.  (#139641, 
        Christian Persch)
index b6c801da263bd5316df5c71dec35627ae6883fe9..26ee54d8d5ddda39bf77708ef5b921e789168f83 100644 (file)
@@ -1,5 +1,10 @@
 2004-04-13  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkuimanager.c (get_child_node): Don't crash if a node 
+       has no name.
+       (start_element_handler): Accept separators without unique 
+       names.  (#133302, Anders Carlsson)
+
        * gtk/gtkactiongroup.c (gtk_action_group_add_action): Document
        possible accelerator gotcha when using this function.  (#139641, 
        Christian Persch)
index b6c801da263bd5316df5c71dec35627ae6883fe9..26ee54d8d5ddda39bf77708ef5b921e789168f83 100644 (file)
@@ -1,5 +1,10 @@
 2004-04-13  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkuimanager.c (get_child_node): Don't crash if a node 
+       has no name.
+       (start_element_handler): Accept separators without unique 
+       names.  (#133302, Anders Carlsson)
+
        * gtk/gtkactiongroup.c (gtk_action_group_add_action): Document
        possible accelerator gotcha when using this function.  (#139641, 
        Christian Persch)
index b6c801da263bd5316df5c71dec35627ae6883fe9..26ee54d8d5ddda39bf77708ef5b921e789168f83 100644 (file)
@@ -1,5 +1,10 @@
 2004-04-13  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkuimanager.c (get_child_node): Don't crash if a node 
+       has no name.
+       (start_element_handler): Accept separators without unique 
+       names.  (#133302, Anders Carlsson)
+
        * gtk/gtkactiongroup.c (gtk_action_group_add_action): Document
        possible accelerator gotcha when using this function.  (#139641, 
        Christian Persch)
index b6c801da263bd5316df5c71dec35627ae6883fe9..26ee54d8d5ddda39bf77708ef5b921e789168f83 100644 (file)
@@ -1,5 +1,10 @@
 2004-04-13  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkuimanager.c (get_child_node): Don't crash if a node 
+       has no name.
+       (start_element_handler): Accept separators without unique 
+       names.  (#133302, Anders Carlsson)
+
        * gtk/gtkactiongroup.c (gtk_action_group_add_action): Document
        possible accelerator gotcha when using this function.  (#139641, 
        Christian Persch)
index a109d03f130917714aca366760ddabb29bd5ea5c..8bbf232b5701d373a57f000019446e4d3e0156f8 100644 (file)
@@ -1,3 +1,7 @@
+2004-04-13  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/tmpl/gtkuimanager.sgml: Some corrections.
+
 2004-04-13  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/tmpl/gtkfilechooser.sgml: Typo fix.
index 8355b05db47bb17c51b8be27fff4a195af52a1d3..e9700b176d004809a848c6dd70f3b405b4683f8c 100644 (file)
@@ -29,6 +29,7 @@ roughly described by the following DTD.
 &lt;!ATTLIST toolbar      name               &num;IMPLIED &gt;
 &lt;!ATTLIST popup        name               &num;IMPLIED &gt;
 &lt;!ATTLIST placeholder  name               &num;IMPLIED &gt;
+&lt;!ATTLIST separator    name               &num;IMPLIED &gt;
 &lt;!ATTLIST menu         name               &num;IMPLIED
                        action             &num;REQUIRED
                        position (top|bot) &num;IMPLIED &gt;
@@ -126,7 +127,7 @@ The most remarkable feature of #GtkUIManager is that it can overlay a set
 of menuitems and toolitems over another one, and demerge them later.
 </para>
 <para>
-Merging is done based on the name of the XML elements. Each element is 
+Merging is done based on the names of the XML elements. Each element is 
 identified by a path which consists of the names of its anchestors, separated
 by slashes. For example, the menuitem named "Left" in the example above
 has the path <literal>/ui/menubar/JustifyMenu/Left</literal> and the
index f1fde1382bda099ff504c572d51faf7f730d9a01..93ab1a067cc44bfe7b63708bfcb60ae72f923a95 100644 (file)
@@ -824,7 +824,8 @@ get_child_node (GtkUIManager *self,
        {
          for (child = parent->children; child != NULL; child = child->next)
            {
-             if (strlen (NODE_INFO (child)->name) == childname_length &&
+             if (NODE_INFO (child)->name &&
+                 strlen (NODE_INFO (child)->name) == childname_length &&
                  !strncmp (NODE_INFO (child)->name, childname, childname_length))
                {
                  /* if undecided about node type, set it */
@@ -1215,15 +1216,24 @@ start_element_handler (GMarkupParseContext *context,
          !strcmp (element_name, "separator"))
        {
          GNode *node;
+         gint length;
 
          if (ctx->state == STATE_TOOLBAR)
            ctx->state = STATE_TOOLITEM;
          else
            ctx->state = STATE_MENUITEM;
+         if (!strcmp (node_name, "separator"))
+           {
+             node_name = NULL;
+             length = -1;
+           }
+         else
+           length = strlen (node_name);
          node = get_child_node (self, ctx->current,
-                                node_name, strlen (node_name),
+                                node_name, length,
                                 NODE_TYPE_SEPARATOR,
                                 TRUE, top);
+
          if (NODE_INFO (node)->action_name == 0)
            NODE_INFO (node)->action_name = action_quark;