diff options
author | Benjamin Otte <otte@redhat.com> | 2019-04-05 13:41:08 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2019-04-12 19:34:28 +0200 |
commit | 7f99c1e58842613573da51737a126bdeec835f1a (patch) | |
tree | 8d2d8bf88d0e9861da8893fe95720636f5539f38 /gtk/gtkcssfontfeaturesvalue.c | |
parent | 5f3e5a04066ffa96c3dc2ce423c6cb9cd50df1b2 (diff) | |
download | gtk+-7f99c1e58842613573da51737a126bdeec835f1a.tar.gz |
cssparser: Split integer gettig into has/consume functions
We can't try to get an integer because ultimately integer getters
support the same shenanigans that numbers and percentages do with calc()
and whatnot.
Diffstat (limited to 'gtk/gtkcssfontfeaturesvalue.c')
-rw-r--r-- | gtk/gtkcssfontfeaturesvalue.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gtk/gtkcssfontfeaturesvalue.c b/gtk/gtkcssfontfeaturesvalue.c index a64ee3fce5..6f7c2894f0 100644 --- a/gtk/gtkcssfontfeaturesvalue.c +++ b/gtk/gtkcssfontfeaturesvalue.c @@ -256,8 +256,19 @@ gtk_css_font_features_value_parse (GtkCssParser *parser) val = _gtk_css_number_value_new (1.0, GTK_CSS_NUMBER); else if (gtk_css_parser_try_ident (parser, "off")) val = _gtk_css_number_value_new (0.0, GTK_CSS_NUMBER); - else if (_gtk_css_parser_try_int (parser, &num)) - val = _gtk_css_number_value_new ((double)num, GTK_CSS_NUMBER); + else if (gtk_css_parser_has_integer (parser)) + { + if (gtk_css_parser_consume_integer (parser, &num)) + { + val = _gtk_css_number_value_new ((double)num, GTK_CSS_NUMBER); + } + else + { + g_free (name); + _gtk_css_value_unref (result); + return NULL; + } + } else val = _gtk_css_number_value_new (1.0, GTK_CSS_NUMBER); |