[gtk+] stylecontext: Make build_properties create the style



commit 0bab285fe0f5ce4accec8b941742306ef54f4655
Author: Benjamin Otte <otte redhat com>
Date:   Sun Dec 14 23:20:19 2014 +0100

    stylecontext: Make build_properties create the style

 gtk/gtkstylecontext.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index ba7763c..bc79821 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -713,9 +713,8 @@ update_properties (GtkStyleContext             *context,
   gtk_widget_path_free (path);
 }
 
-static void
+static GtkCssStyle *
 build_properties (GtkStyleContext             *context,
-                  GtkCssStyle                 *style,
                   const GtkCssNodeDeclaration *decl,
                   GtkCssChange                *out_change)
 {
@@ -723,9 +722,12 @@ build_properties (GtkStyleContext             *context,
   GtkCssMatcher matcher;
   GtkWidgetPath *path;
   GtkCssLookup *lookup;
+  GtkCssStyle *style;
 
   priv = context->priv;
 
+  style = gtk_css_static_style_new ();
+
   path = create_query_path (context, decl);
   lookup = _gtk_css_lookup_new (NULL);
 
@@ -743,6 +745,8 @@ build_properties (GtkStyleContext             *context,
 
   _gtk_css_lookup_free (lookup);
   gtk_widget_path_free (path);
+
+  return style;
 }
 
 static GtkCssStyle *
@@ -770,18 +774,15 @@ style_values_lookup (GtkStyleContext *context)
           return values;
         }
 
-      values = gtk_css_static_style_new ();
+      values = build_properties (context, info->decl, NULL);
       g_hash_table_insert (priv->style_values,
                            gtk_css_node_declaration_ref (info->decl),
                            g_object_ref (values));
 
-      build_properties (context, values, info->decl, NULL);
     }
   else
     {
-      values = gtk_css_static_style_new ();
-
-      build_properties (context, values, info->decl, &priv->relevant_changes);
+      values = build_properties (context, info->decl, &priv->relevant_changes);
       /* These flags are always relevant */
       priv->relevant_changes |= GTK_CSS_CHANGE_SOURCE;
     }
@@ -807,8 +808,7 @@ style_values_lookup_for_state (GtkStyleContext *context,
 
   decl = gtk_css_node_declaration_ref (context->priv->info->decl);
   gtk_css_node_declaration_set_state (&decl, state);
-  values = gtk_css_static_style_new ();
-  build_properties (context, values, decl, NULL);
+  values = build_properties (context, decl, NULL);
   gtk_css_node_declaration_unref (decl);
 
   return values;


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