[gimp] Bug 684483 - Text tool: crash after double clicking text

commit 9b58e2ba0ccbcd8108f576ac0aea4573f13875e0
Author: Massimo Valentini <mvalentini src gnome org>
Date:   Sat Oct 20 16:24:56 2012 +0200

    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

 app/tools/gimptexttool.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c
index ddc6741..d7f6a6b 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,
-      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,

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]