[gtk/wip/otte/for-master: 7/11] builder-tool: Don't allow property to be both resize and shrink



commit 317dcddddb76d2f87eee08e2b929b1b901c23aaa
Author: Benjamin Otte <otte redhat com>
Date:   Fri Mar 6 05:29:46 2020 +0100

    builder-tool: Don't allow property to be both resize and shrink
    
    Otherwise builder-tool crashes when you do
    
      <property name="shrink" name="resize">1</property>
    
    Thanks to the static analyzer for figuring that one out.

 gtk/tools/gtk-builder-tool-simplify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/tools/gtk-builder-tool-simplify.c b/gtk/tools/gtk-builder-tool-simplify.c
index a2b42d135b..32cda19afd 100644
--- a/gtk/tools/gtk-builder-tool-simplify.c
+++ b/gtk/tools/gtk-builder-tool-simplify.c
@@ -1215,7 +1215,7 @@ rewrite_paned_child (Element *element,
               if (g_str_equal (elt2->element_name, "property") &&
                   has_attribute (elt2, "name", "resize"))
                 resize = elt2;
-              if (g_str_equal (elt2->element_name, "property") &&
+              else if (g_str_equal (elt2->element_name, "property") &&
                   has_attribute (elt2, "name", "shrink"))
                 shrink = elt2;
             }


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