diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2009-04-06 19:42:06 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2009-04-06 19:42:06 -0400 |
commit | e61e53f197bf238269a9db736901e64fd999190a (patch) | |
tree | 36f5b88e5536e5041e570d213fc5749f1d774ff7 /pango/fonts.c | |
parent | 3948365307f6b70863d89af7da832b84af72c263 (diff) | |
download | pango-e61e53f197bf238269a9db736901e64fd999190a.tar.gz |
Allow desc_to_merge=NULL in pango_font_description_merge()
Diffstat (limited to 'pango/fonts.c')
-rw-r--r-- | pango/fonts.c | 8 |
1 files changed, 6 insertions, 2 deletions
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); |