From e61e53f197bf238269a9db736901e64fd999190a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 6 Apr 2009 19:42:06 -0400 Subject: Allow desc_to_merge=NULL in pango_font_description_merge() --- pango/fonts.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pango/fonts.c') diff --git a/pango/fonts.c b/pango/fonts.c index 76ffc17e..441e0d38 100644 --- a/pango/fonts.c +++ b/pango/fonts.c @@ -519,7 +519,7 @@ pango_font_description_unset_fields (PangoFontDescription *desc, /** * pango_font_description_merge: * @desc: a #PangoFontDescription - * @desc_to_merge: the #PangoFontDescription to merge from + * @desc_to_merge: the #PangoFontDescription to merge from, or %NULL * @replace_existing: if %TRUE, replace fields in @desc with the * corresponding values from @desc_to_merge, even if they * are already exist. @@ -528,6 +528,8 @@ pango_font_description_unset_fields (PangoFontDescription *desc, * @desc. If @replace_existing is %FALSE, only fields in @desc that * are not already set are affected. If %TRUE, then fields that are * already set will be replaced as well. + * + * If @desc_to_merge is %NULL, this function performs nothing. **/ void pango_font_description_merge (PangoFontDescription *desc, @@ -537,7 +539,9 @@ pango_font_description_merge (PangoFontDescription *desc, gboolean family_merged; g_return_if_fail (desc != NULL); - g_return_if_fail (desc_to_merge != NULL); + + if (desc_to_merge == NULL) + return; family_merged = desc_to_merge->family_name && (replace_existing || !desc->family_name); -- cgit v1.2.1