[gimp] app: when disconnecting from the text layer, also empty our text buffer



commit 42de0453da5191d5ccc07111f7c755fd0592a691
Author: Michael Natterer <mitch gimp org>
Date:   Sat Feb 20 19:43:17 2010 +0100

    app: when disconnecting from the text layer, also empty our text buffer
    
    or the remaining text will be added to the next text layer which is
    created.

 app/tools/gimptexttool.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c
index 3ffe11b..5f59432 100644
--- a/app/tools/gimptexttool.c
+++ b/app/tools/gimptexttool.c
@@ -1117,6 +1117,16 @@ gimp_text_tool_connect (GimpTextTool  *text_tool,
           text_tool->text = NULL;
 
           g_object_set (text_tool->proxy, "text", NULL, NULL);
+
+          g_signal_handlers_block_by_func (text_tool->text_buffer,
+                                           gimp_text_tool_buffer_changed,
+                                           text_tool);
+
+          gtk_text_buffer_set_text (text_tool->text_buffer, "", -1);
+
+          g_signal_handlers_unblock_by_func (text_tool->text_buffer,
+                                             gimp_text_tool_buffer_changed,
+                                             text_tool);
         }
 
       gimp_context_define_property (GIMP_CONTEXT (options),



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