diff options
Diffstat (limited to 'pango/pango-markup.c')
-rw-r--r-- | pango/pango-markup.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/pango/pango-markup.c b/pango/pango-markup.c index 258ca717..38e908c5 100644 --- a/pango/pango-markup.c +++ b/pango/pango-markup.c @@ -584,17 +584,10 @@ pango_markup_parser_new_internal (char accel_marker, 0, md, (GDestroyNotify)destroy_markup_data); - if (!g_markup_parse_context_parse (context, - "<markup>", - -1, - error)) - goto error; + if (!g_markup_parse_context_parse (context, "<markup>", -1, error)) + g_clear_pointer (&context, g_markup_parse_context_free); return context; - - error: - g_markup_parse_context_free (context); - return NULL; } /** @@ -654,8 +647,6 @@ pango_parse_markup (const char *markup_text, context = pango_markup_parser_new_internal (accel_marker, error, (attr_list != NULL)); - if (context == NULL) - goto out; if (!g_markup_parse_context_parse (context, markup_text, @@ -711,16 +702,9 @@ pango_parse_markup (const char *markup_text, * Since: 1.31.0 **/ GMarkupParseContext * -pango_markup_parser_new (gunichar accel_marker) +pango_markup_parser_new (gunichar accel_marker) { - GError *error = NULL; - GMarkupParseContext *context; - context = pango_markup_parser_new_internal (accel_marker, &error, TRUE); - - if (context == NULL) - g_critical ("Had error when making markup parser: %s\n", error->message); - - return context; + return pango_markup_parser_new_internal (accel_marker, NULL, TRUE); } /** @@ -1245,11 +1229,16 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED, CHECK_ATTRIBUTE (underline); CHECK_ATTRIBUTE (underline_color); break; - default: + case 'r': CHECK_ATTRIBUTE (rise); + break; + case 'v': CHECK_ATTRIBUTE (variant); + break; + case 'w': CHECK_ATTRIBUTE (weight); break; + default:; } if (!found) @@ -1657,6 +1646,7 @@ markup_parse_func (MarkupData *md G_GNUC_UNUSED, GError **error G_GNUC_UNUSED) { /* We don't do anything with this tag at the moment. */ + CHECK_NO_ATTRS("markup"); return TRUE; } |