From 928b9dbbe2d8a5b34001ae833f6c8577479d18a0 Mon Sep 17 00:00:00 2001 From: "yokoyama%netscape.com" Date: Fri, 30 Nov 2001 21:48:31 +0000 Subject: [PATCH] Bug 109265 checking in for skamio@netscape.net Disabling IME for Readonly attribute of /r=yokoyama; /sr=kin --- editor/libeditor/text/nsEditorEventListeners.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/editor/libeditor/text/nsEditorEventListeners.cpp b/editor/libeditor/text/nsEditorEventListeners.cpp index 54cba6a31df..faa35941231 100644 --- a/editor/libeditor/text/nsEditorEventListeners.cpp +++ b/editor/libeditor/text/nsEditorEventListeners.cpp @@ -577,8 +577,19 @@ nsTextEditorTextListener::HandleText(nsIDOMEvent* aTextEvent) textRangeList->AddRef(); nsCOMPtr imeEditor = do_QueryInterface(mEditor, &result); if (imeEditor) { - result = imeEditor->SetCompositionString(composedText,textRangeList,textEventReply); - ScrollSelectionIntoView(mEditor); + PRUint32 flags; + // if we are readonly or disabled, then do nothing. + if (NS_SUCCEEDED(mEditor->GetFlags(&flags))) { + if (flags & nsIPlaintextEditor::eEditorReadonlyMask || + flags & nsIPlaintextEditor::eEditorDisabledMask) { +#if DEBUG_IME + printf("nsTextEditorTextListener::HandleText, Readonly or Disabled\n"); +#endif + return NS_OK; + } + } + result = imeEditor->SetCompositionString(composedText,textRangeList,textEventReply); + ScrollSelectionIntoView(mEditor); } return result; }