markup: Remove error from markup parser constructor
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 14 Dec 2012 18:01:46 +0000 (13:01 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 14 Dec 2012 18:03:57 +0000 (13:03 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=679299

pango/pango-attributes.h
pango/pango-markup.c

index 7cd80d8..cbbaf96 100644 (file)
@@ -293,8 +293,7 @@ gboolean pango_parse_markup (const char                 *markup_text,
                             gunichar                   *accel_char,
                             GError                    **error);
 
-GMarkupParseContext * pango_markup_parser_new (gunichar               accel_marker,
-                                               GError               **error);
+GMarkupParseContext * pango_markup_parser_new (gunichar               accel_marker);
 gboolean              pango_markup_parser_finish (GMarkupParseContext   *context,
                                                   PangoAttrList        **attr_list,
                                                   char                 **text,
index 0f83185..a162f5b 100644 (file)
@@ -689,7 +689,6 @@ pango_parse_markup (const char                 *markup_text,
 /**
  * pango_markup_parser_new:
  * @accel_marker: character that precedes an accelerator, or 0 for none
- * @error: address of return location for errors, or %NULL
  *
  * Parses marked-up text (see
  * <link linkend="PangoMarkupFormat">markup format</link>) to create
@@ -703,9 +702,6 @@ pango_parse_markup (const char                 *markup_text,
  * when calling finish(). Two @accel_marker characters following each
  * other produce a single literal @accel_marker character.
  *
- * If any error happens, none of the output arguments are touched except
- * for @error.
- *
  * To feed markup to the parser, use g_markup_parse_context_parse()
  * on the returned #GMarkupParseContext. When done with feeding markup
  * to the parser, use pango_markup_parser_finish() to get the data out
@@ -721,10 +717,16 @@ pango_parse_markup (const char                 *markup_text,
  * Since: 1.31.0
  **/
 GMarkupParseContext *
-pango_markup_parser_new (gunichar               accel_marker,
-                         GError               **error)
+pango_markup_parser_new (gunichar               accel_marker)
 {
-  return pango_markup_parser_new_internal (accel_marker, error, TRUE);
+  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;
 }
 
 /**