[gnome-menus] [libmenu] Fix DefaultLayout attributes not being inherited



commit 89ab14f5fd34d18ef1591baf1000f5197344cd92
Author: Vincent Untz <vuntz gnome org>
Date:   Fri Jun 26 23:19:47 2009 +0200

    [libmenu] Fix DefaultLayout attributes not being inherited
    
    The submenus were not inheriting the DefaultLayout attributes (eg,
    all the inline parameters) of their parent when there was no child to
    the DefaultLayout of their parent.
    
    Concretely, this was ignored for submenus:
      <DefaultLayout inline="true"/>
    while this should have behaved like:
      <DefaultLayout inline="true"><Merge type="all"/></DefaultLayout>

 libmenu/gmenu-tree.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libmenu/gmenu-tree.c b/libmenu/gmenu-tree.c
index ec4f611..be6eea8 100644
--- a/libmenu/gmenu-tree.c
+++ b/libmenu/gmenu-tree.c
@@ -3166,10 +3166,11 @@ set_default_layout_values (GMenuTreeDirectory *parent,
   GSList *tmp;
 
   /* if the child has a defined default layout, we don't want to override its
-   * values, and if the parent doesn't have a defined default layout, then
-   * everybody already uses the default values */
-  if (parent->default_layout_info == NULL ||
-      child->default_layout_info != NULL)
+   * values. The parent might have a non-defined layout info (ie, no child of
+   * the DefaultLayout node) but it doesn't meant the default layout values
+   * (ie, DefaultLayout attributes) aren't different from the global defaults.
+   */
+  if (child->default_layout_info != NULL)
     return;
 
   child->default_layout_values = parent->default_layout_values;



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