[gtk/matthiasc/for-master] fixup! cssshadowvalue: Add a parsing function



commit 95b78eecc731c44ce13ef176b33576b34d01dcfa
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 5 23:25:47 2021 -0500

    fixup! cssshadowvalue: Add a parsing function

 gtk/gtkcssshadowvalue.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c
index b7b409ca72..caffdf73ce 100644
--- a/gtk/gtkcssshadowvalue.c
+++ b/gtk/gtkcssshadowvalue.c
@@ -515,17 +515,15 @@ fail:
 GtkCssValue *
 _gtk_css_shadow_value_parse_filter (GtkCssParser *parser)
 {
-  GtkCssValue *result;
+  ShadowValue shadow;
 
-  result = _gtk_css_shadow_value_parse (parser, FALSE);
-
-  if (result && result->n_shadows != 1)
+  if (_gtk_css_shadow_value_parse_one (parser, FALSE, &shadow))
+    return gtk_css_shadow_value_new (&shadow, 1);
+  else
     {
       gtk_css_parser_error_syntax (parser, "A single shadow is required");
-      g_clear_pointer (&result, gtk_css_value_unref);
+      return NULL;
     }
-
-  return result;
 }
 
 void


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