From 2b99cca805ebf157789ce0427b34db1035f3854a Mon Sep 17 00:00:00 2001 From: "brade%netscape.com" Date: Tue, 16 Nov 1999 14:41:03 +0000 Subject: [PATCH] fix bug 14624 (don't handle tab key twice). r=kin@netscape.com. --- editor/base/nsEditorEventListeners.cpp | 30 ------------------- .../libeditor/text/nsEditorEventListeners.cpp | 30 ------------------- 2 files changed, 60 deletions(-) diff --git a/editor/base/nsEditorEventListeners.cpp b/editor/base/nsEditorEventListeners.cpp index 8cfa93354f4..06624bd94a8 100644 --- a/editor/base/nsEditorEventListeners.cpp +++ b/editor/base/nsEditorEventListeners.cpp @@ -127,28 +127,6 @@ nsTextEditorKeyListener::HandleEvent(nsIDOMEvent* aEvent) nsresult nsTextEditorKeyListener::KeyDown(nsIDOMEvent* aKeyEvent) { - PRUint32 keyCode; - nsCOMPtrkeyEvent; - keyEvent = do_QueryInterface(aKeyEvent); - if (keyEvent) - { - if (NS_SUCCEEDED(keyEvent->GetKeyCode(&keyCode))) - { - if (nsIDOMKeyEvent::DOM_VK_TAB==keyCode) - { - nsCOMPtr htmlEditor = do_QueryInterface(mEditor); - PRUint32 flags=0; - mEditor->GetFlags(&flags); - if ((flags & nsIHTMLEditor::eEditorSingleLineMask)) - return NS_OK; // let it be used for focus switching - - // else we insert the tab straight through - htmlEditor->EditorKeyPress(keyEvent); - ScrollSelectionIntoView(); - return NS_ERROR_BASE; // "I handled the event, don't do default processing" - } - } - } return NS_OK; } @@ -235,14 +213,6 @@ nsTextEditorKeyListener::KeyPress(nsIDOMEvent* aKeyEvent) } } -#if 0 - // XXX: this must change. DOM_VK_tab must be handled here, not in keyDown - if (nsIDOMKeyEvent::DOM_VK_TAB==keyCode) - { - return NS_OK; // ignore tabs here, they're handled in keyDown if at all - } -#endif - htmlEditor->EditorKeyPress(keyEvent); ScrollSelectionIntoView(); } diff --git a/editor/libeditor/text/nsEditorEventListeners.cpp b/editor/libeditor/text/nsEditorEventListeners.cpp index 8cfa93354f4..06624bd94a8 100644 --- a/editor/libeditor/text/nsEditorEventListeners.cpp +++ b/editor/libeditor/text/nsEditorEventListeners.cpp @@ -127,28 +127,6 @@ nsTextEditorKeyListener::HandleEvent(nsIDOMEvent* aEvent) nsresult nsTextEditorKeyListener::KeyDown(nsIDOMEvent* aKeyEvent) { - PRUint32 keyCode; - nsCOMPtrkeyEvent; - keyEvent = do_QueryInterface(aKeyEvent); - if (keyEvent) - { - if (NS_SUCCEEDED(keyEvent->GetKeyCode(&keyCode))) - { - if (nsIDOMKeyEvent::DOM_VK_TAB==keyCode) - { - nsCOMPtr htmlEditor = do_QueryInterface(mEditor); - PRUint32 flags=0; - mEditor->GetFlags(&flags); - if ((flags & nsIHTMLEditor::eEditorSingleLineMask)) - return NS_OK; // let it be used for focus switching - - // else we insert the tab straight through - htmlEditor->EditorKeyPress(keyEvent); - ScrollSelectionIntoView(); - return NS_ERROR_BASE; // "I handled the event, don't do default processing" - } - } - } return NS_OK; } @@ -235,14 +213,6 @@ nsTextEditorKeyListener::KeyPress(nsIDOMEvent* aKeyEvent) } } -#if 0 - // XXX: this must change. DOM_VK_tab must be handled here, not in keyDown - if (nsIDOMKeyEvent::DOM_VK_TAB==keyCode) - { - return NS_OK; // ignore tabs here, they're handled in keyDown if at all - } -#endif - htmlEditor->EditorKeyPress(keyEvent); ScrollSelectionIntoView(); }