From 2e3c6ea1b10c2bbffcc8d441106fa44db6791f2a Mon Sep 17 00:00:00 2001 From: "pavlov%pavlov.net" Date: Mon, 15 Feb 1999 01:54:08 +0000 Subject: [PATCH] apply patch from Tomi Leppikangas to fix nsTextHelper::SetText() --- widget/src/gtk/nsTextHelper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/widget/src/gtk/nsTextHelper.cpp b/widget/src/gtk/nsTextHelper.cpp index eb89f632f9d..28a4ef9b4f5 100644 --- a/widget/src/gtk/nsTextHelper.cpp +++ b/widget/src/gtk/nsTextHelper.cpp @@ -101,7 +101,10 @@ NS_METHOD nsTextHelper::SetText(const nsString& aText, PRUint32& aActualSize) if (GTK_IS_ENTRY(mWidget)) { gtk_entry_set_text(GTK_ENTRY(mWidget), buf); } else if (GTK_IS_TEXT(mWidget)) { - gtk_text_insert(GTK_TEXT(mWidget), nsnull, nsnull, nsnull, buf, aText.Length()); + gtk_editable_delete_text(GTK_EDITABLE(mWidget), 0, + gtk_text_get_length(GTK_TEXT (mWidget))); + gtk_text_insert(GTK_TEXT(mWidget), nsnull, nsnull, nsnull, + buf, aText.Length()); } aActualSize = aText.Length();