From 88c0d8e924ee560057e11e22c7f690a1a86eadd4 Mon Sep 17 00:00:00 2001 From: "jfrancis%netscape.com" Date: Wed, 16 Feb 2000 00:53:31 +0000 Subject: [PATCH] fix for 27699: ime text insert screwed up for single line edit fields --- editor/base/nsTextEditRules.cpp | 6 +++++- editor/libeditor/text/nsTextEditRules.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/editor/base/nsTextEditRules.cpp b/editor/base/nsTextEditRules.cpp index 5453b07c29a..12b5d9f9099 100644 --- a/editor/base/nsTextEditRules.cpp +++ b/editor/base/nsTextEditRules.cpp @@ -566,7 +566,11 @@ nsTextEditRules::WillInsertText(PRInt32 aAction, // fixes bug 21032 // *** there's some debate about whether we should replace CRLF with spaces, or // truncate the string at the first CRLF. Here, we replace with spaces. - if (nsIHTMLEditor::eEditorSingleLineMask & mFlags) { + // Hack: I stripped out this test for IME inserts - it screws up double byte chars + // that happen to end in the same values as CR or LF. Bug 27699 + if (aInString->IsEmpty() && (aAction != kInsertTextIME)) + if ((nsIHTMLEditor::eEditorSingleLineMask & mFlags) && (aAction != kInsertTextIME)) + { aOutString->ReplaceChar(CRLF, ' '); } diff --git a/editor/libeditor/text/nsTextEditRules.cpp b/editor/libeditor/text/nsTextEditRules.cpp index 5453b07c29a..12b5d9f9099 100644 --- a/editor/libeditor/text/nsTextEditRules.cpp +++ b/editor/libeditor/text/nsTextEditRules.cpp @@ -566,7 +566,11 @@ nsTextEditRules::WillInsertText(PRInt32 aAction, // fixes bug 21032 // *** there's some debate about whether we should replace CRLF with spaces, or // truncate the string at the first CRLF. Here, we replace with spaces. - if (nsIHTMLEditor::eEditorSingleLineMask & mFlags) { + // Hack: I stripped out this test for IME inserts - it screws up double byte chars + // that happen to end in the same values as CR or LF. Bug 27699 + if (aInString->IsEmpty() && (aAction != kInsertTextIME)) + if ((nsIHTMLEditor::eEditorSingleLineMask & mFlags) && (aAction != kInsertTextIME)) + { aOutString->ReplaceChar(CRLF, ' '); }