[gimp/gimp-2-8] Bug 742775: Crash when editing text with certain fonts
- From: Massimo Valentini <mvalentini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] Bug 742775: Crash when editing text with certain fonts
- Date: Tue, 3 Feb 2015 17:44:04 +0000 (UTC)
commit 9d6c4685a9abba0947464e5e4ad0ff6cf04ab3d5
Author: Massimo Valentini <mvalentini src gnome org>
Date: Tue Feb 3 18:33:12 2015 +0100
Bug 742775: Crash when editing text with certain fonts
(cherry picked from commit 09c5fcc32bb0ee8d068ccaed7ef4761881747df2)
app/widgets/gimptextbuffer.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/app/widgets/gimptextbuffer.c b/app/widgets/gimptextbuffer.c
index 7f41ceb..25a4920 100644
--- a/app/widgets/gimptextbuffer.c
+++ b/app/widgets/gimptextbuffer.c
@@ -844,6 +844,10 @@ gimp_text_buffer_get_font_tag (GimpTextBuffer *buffer,
GList *list;
GtkTextTag *tag;
gchar name[256];
+ PangoFontDescription *pfd = pango_font_description_from_string (font);
+ char *description = pango_font_description_to_string (pfd);
+
+ pango_font_description_free (pfd);
for (list = buffer->font_tags; list; list = g_list_next (list))
{
@@ -853,22 +857,23 @@ gimp_text_buffer_get_font_tag (GimpTextBuffer *buffer,
tag_font = gimp_text_tag_get_font (tag);
- if (! strcmp (font, tag_font))
+ if (! strcmp (description, tag_font))
{
g_free (tag_font);
+ g_free (description);
return tag;
}
g_free (tag_font);
}
- g_snprintf (name, sizeof (name), "font-%s", font);
+ g_snprintf (name, sizeof (name), "font-%s", description);
tag = gtk_text_buffer_create_tag (GTK_TEXT_BUFFER (buffer),
name,
- "font", font,
+ "font", description,
NULL);
-
+ g_free (description);
buffer->font_tags = g_list_prepend (buffer->font_tags, tag);
return tag;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]