summaryrefslogtreecommitdiff
path: root/gtk/gtkcssimagescaled.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2019-04-05 13:41:08 +0200
committerBenjamin Otte <otte@redhat.com>2019-04-12 19:34:28 +0200
commit7f99c1e58842613573da51737a126bdeec835f1a (patch)
tree8d2d8bf88d0e9861da8893fe95720636f5539f38 /gtk/gtkcssimagescaled.c
parent5f3e5a04066ffa96c3dc2ce423c6cb9cd50df1b2 (diff)
downloadgtk+-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/gtkcssimagescaled.c')
-rw-r--r--gtk/gtkcssimagescaled.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkcssimagescaled.c b/gtk/gtkcssimagescaled.c
index a5d4e22898..6e01464a6f 100644
--- a/gtk/gtkcssimagescaled.c
+++ b/gtk/gtkcssimagescaled.c
@@ -160,10 +160,12 @@ gtk_css_image_scaled_parse_arg (GtkCssParser *parser,
child = _gtk_css_image_new_parse (parser);
if (child == NULL)
- return FALSE;
+ return 0;
- if (!_gtk_css_parser_try_int (parser, &scale))
+ if (!gtk_css_parser_has_integer (parser))
scale = arg > 0 ? g_array_index (data->scales, int, arg - 1) + 1 : 1;
+ else if (!gtk_css_parser_consume_integer (parser, &scale))
+ return 0;
g_ptr_array_add (data->images, child);
g_array_append_val (data->scales, scale);