From 66b4aa2d3482f53e4e9037c4ffdc5d267e983a3f Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Sat, 20 Oct 2012 16:24:56 +0200 Subject: [PATCH] Bug 684483 - Text tool: crash after double clicking text It seems that when the undo action reverts a text -> mark-up change (or v.v.) the notifications are inverted, first is emitted the new value notification and successively the property becoming NULL. The result is that gimp_text_buffer_set_{text,mark-up} is called last with NULL, unsetting both text_buffer text and mark-up. The right way to do it is to always prefer "markup" over "text" if markup is present, no matter if the notification was for "markup" or "text". (cherry picked from commit 9b58e2ba0ccbcd8108f576ac0aea4573f13875e0) --- app/tools/gimptexttool.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c index ddc674173b..d7f6a6b739 100644 --- a/app/tools/gimptexttool.c +++ b/app/tools/gimptexttool.c @@ -1167,11 +1167,10 @@ gimp_text_tool_text_notify (GimpText *text, g_signal_handlers_block_by_func (text_tool->buffer, gimp_text_tool_buffer_end_edit, text_tool); - - if (pspec->name[0] == 't') - gimp_text_buffer_set_text (text_tool->buffer, text->text); - else + if (text->markup) gimp_text_buffer_set_markup (text_tool->buffer, text->markup); + else + gimp_text_buffer_set_text (text_tool->buffer, text->text); g_signal_handlers_unblock_by_func (text_tool->buffer, gimp_text_tool_buffer_end_edit,