From dc08d4dbd98d5c4260f86b31808fe839cc5970e9 Mon Sep 17 00:00:00 2001 From: "joki%netscape.com" Date: Fri, 15 Sep 2000 06:09:26 +0000 Subject: [PATCH] Partially fix bug 28323 by changing the text field editor keypress listener to not add characters into the text field if the user has cancelled the event. r:jst --- editor/base/nsEditorEventListeners.cpp | 12 ++++++------ editor/libeditor/text/nsEditorEventListeners.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/editor/base/nsEditorEventListeners.cpp b/editor/base/nsEditorEventListeners.cpp index acff9f53fd7..0a37f5c080b 100644 --- a/editor/base/nsEditorEventListeners.cpp +++ b/editor/base/nsEditorEventListeners.cpp @@ -42,7 +42,7 @@ #include "nsIPrivateCompositionEvent.h" #include "nsIEditorMailSupport.h" #include "nsIDocumentEncoder.h" -#include "nsIPrivateDOMEvent.h" +#include "nsIDOMNSUIEvent.h" #include "nsIPref.h" #include "nsILookAndFeel.h" #include "nsIPresContext.h" @@ -158,12 +158,12 @@ nsTextEditorKeyListener::KeyPress(nsIDOMEvent* aKeyEvent) return NS_OK; } - nsCOMPtr privateEvent = do_QueryInterface(aKeyEvent); - if(privateEvent) + nsCOMPtr nsUIEvent = do_QueryInterface(aKeyEvent); + if(nsUIEvent) { - PRBool dispatchStopped; - privateEvent->IsDispatchStopped(&dispatchStopped); - if(dispatchStopped) + PRBool defaultPrevented; + nsUIEvent->GetPreventDefault(&defaultPrevented); + if(defaultPrevented) return NS_OK; } diff --git a/editor/libeditor/text/nsEditorEventListeners.cpp b/editor/libeditor/text/nsEditorEventListeners.cpp index acff9f53fd7..0a37f5c080b 100644 --- a/editor/libeditor/text/nsEditorEventListeners.cpp +++ b/editor/libeditor/text/nsEditorEventListeners.cpp @@ -42,7 +42,7 @@ #include "nsIPrivateCompositionEvent.h" #include "nsIEditorMailSupport.h" #include "nsIDocumentEncoder.h" -#include "nsIPrivateDOMEvent.h" +#include "nsIDOMNSUIEvent.h" #include "nsIPref.h" #include "nsILookAndFeel.h" #include "nsIPresContext.h" @@ -158,12 +158,12 @@ nsTextEditorKeyListener::KeyPress(nsIDOMEvent* aKeyEvent) return NS_OK; } - nsCOMPtr privateEvent = do_QueryInterface(aKeyEvent); - if(privateEvent) + nsCOMPtr nsUIEvent = do_QueryInterface(aKeyEvent); + if(nsUIEvent) { - PRBool dispatchStopped; - privateEvent->IsDispatchStopped(&dispatchStopped); - if(dispatchStopped) + PRBool defaultPrevented; + nsUIEvent->GetPreventDefault(&defaultPrevented); + if(defaultPrevented) return NS_OK; }