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 9b58e2ba0c)
This commit is contained in:
Massimo Valentini 2012-10-20 16:24:56 +02:00 committed by Michael Natterer
parent e41e5ab643
commit 66b4aa2d34

View file

@ -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,