From 294024ffbd2bb4919b8ccce14f08a46dec8d6442 Mon Sep 17 00:00:00 2001 From: "anthonyd%netscape.com" Date: Wed, 30 Aug 2000 23:38:26 +0000 Subject: [PATCH] fix for bug# 50847 (regression) r=kin git-svn-id: svn://10.0.0.236/trunk@77676 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp index 6ab790fb370..12e72883373 100644 --- a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp +++ b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp @@ -2906,7 +2906,10 @@ nsGfxTextControlFrame2::SetTextControlFrameState(const nsAReadableString& aValue flags &= ~(nsIHTMLEditor::eEditorDisabledMask); flags &= ~(nsIHTMLEditor::eEditorReadonlyMask); mEditor->SetFlags(flags); - htmlEditor->InsertText(currentValue); + if (currentValue.Length() < 1) + mEditor->DeleteSelection(nsIEditor::eNone); + else + htmlEditor->InsertText(currentValue); mEditor->SetFlags(savedFlags); if (domSel) domSel->EndBatchChanges();