summaryrefslogtreecommitdiff
path: root/gtk/gtkcssnodedeclaration.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-10-22 20:58:52 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-10-22 20:58:52 -0400
commitd1a85fc9e49a0afa3cafc3aec98264d65a630f18 (patch)
tree4fcd4b7b096ee01b83e47631ee0c2605dab496e4 /gtk/gtkcssnodedeclaration.c
parente0d9250a07a4aa7678d2f89bffe1302ea48c8220 (diff)
downloadgtk+-d1a85fc9e49a0afa3cafc3aec98264d65a630f18.tar.gz
css node declaration: Allow both name and type to be set
The widget path machinery assumes that we always have types, and without this change, it will start spewing warnings when we start to introduce node names.
Diffstat (limited to 'gtk/gtkcssnodedeclaration.c')
-rw-r--r--gtk/gtkcssnodedeclaration.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gtk/gtkcssnodedeclaration.c b/gtk/gtkcssnodedeclaration.c
index 6d861fb448..1c5187b4b6 100644
--- a/gtk/gtkcssnodedeclaration.c
+++ b/gtk/gtkcssnodedeclaration.c
@@ -170,12 +170,10 @@ gboolean
gtk_css_node_declaration_set_type (GtkCssNodeDeclaration **decl,
GType type)
{
- if ((*decl)->type == type &&
- (*decl)->name == NULL)
+ if ((*decl)->type == type)
return FALSE;
gtk_css_node_declaration_make_writable (decl);
- (*decl)->name = NULL;
(*decl)->type = type;
return TRUE;
@@ -191,12 +189,10 @@ gboolean
gtk_css_node_declaration_set_name (GtkCssNodeDeclaration **decl,
/*interned*/ const char *name)
{
- if ((*decl)->type == 0 &&
- (*decl)->name == name)
+ if ((*decl)->name == name)
return FALSE;
gtk_css_node_declaration_make_writable (decl);
- (*decl)->type = 0;
(*decl)->name = name;
return TRUE;