summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2008-08-06 08:40:03 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2008-08-06 08:40:03 +0000
commita29377c7a5ceffc53a2a651faa2d099701b4e53e (patch)
tree5007bc598aa739f8b692bb34cc60909e69b29205
parente77df055f63ed72278684ac6c426af4f74114fc0 (diff)
downloadpango-a29377c7a5ceffc53a2a651faa2d099701b4e53e.tar.gz
Bug 546534 – pango_cairo_font_map_set_default(NULL) errs
2008-08-06 Behdad Esfahbod <behdad@gnome.org> Bug 546534 – pango_cairo_font_map_set_default(NULL) errs * pango/pangocairo-fontmap.c (pango_cairo_font_map_set_default): Allow NULL. svn path=/trunk/; revision=2681
-rw-r--r--ChangeLog7
-rw-r--r--pango/pangocairo-fontmap.c9
2 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 031634a8..77cc1ead 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2008-08-06 Behdad Esfahbod <behdad@gnome.org>
+ Bug 546534 – pango_cairo_font_map_set_default(NULL) errs
+
+ * pango/pangocairo-fontmap.c (pango_cairo_font_map_set_default):
+ Allow NULL.
+
+2008-08-06 Behdad Esfahbod <behdad@gnome.org>
+
Bug 431394 – Use pango_glyph_item_iter in more places
* pango/glyphstring.c (pango_glyph_string_get_logical_widths):
diff --git a/pango/pangocairo-fontmap.c b/pango/pangocairo-fontmap.c
index 1661c88b..11f663da 100644
--- a/pango/pangocairo-fontmap.c
+++ b/pango/pangocairo-fontmap.c
@@ -187,7 +187,8 @@ pango_cairo_font_map_get_default (void)
* default fontmap uses for example. The old default font map
* is unreffed and the new font map referenced.
*
- * A value of %NULL for @fontmap will cause a new default font
+ * A value of %NULL for @fontmap will cause the current default
+ * font map to be released and a new default font
* map to be created on demand, using pango_cairo_font_map_new().
*
* Since: 1.22
@@ -195,7 +196,7 @@ pango_cairo_font_map_get_default (void)
void
pango_cairo_font_map_set_default (PangoCairoFontMap *fontmap)
{
- g_return_if_fail (PANGO_IS_CAIRO_FONT_MAP (fontmap));
+ g_return_if_fail (fontmap == NULL || PANGO_IS_CAIRO_FONT_MAP (fontmap));
if ((PangoFontMap *) fontmap == default_font_map)
return;
@@ -203,7 +204,9 @@ pango_cairo_font_map_set_default (PangoCairoFontMap *fontmap)
if (default_font_map)
g_object_unref (default_font_map);
- default_font_map = g_object_ref (fontmap);
+ if (fontmap)
+ g_object_ref (fontmap);
+ default_font_map = fontmap;
}
/**