From cabff886d3397c61c1a2248ec6ebcd07f71e3bb7 Mon Sep 17 00:00:00 2001 From: "akkana%netscape.com" Date: Wed, 9 Jun 1999 19:12:28 +0000 Subject: [PATCH] Add alt-X and alt-shift-x for debug output html and text git-svn-id: svn://10.0.0.236/trunk@34439 18797224-902f-48f8-a5cc-f745e15eee43 --- .../editor/base/nsEditorEventListeners.cpp | 36 +++++++++++++++++++ .../libeditor/text/nsEditorEventListeners.cpp | 36 +++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/mozilla/editor/base/nsEditorEventListeners.cpp b/mozilla/editor/base/nsEditorEventListeners.cpp index 30d00e2a0df..d5941019361 100644 --- a/mozilla/editor/base/nsEditorEventListeners.cpp +++ b/mozilla/editor/base/nsEditorEventListeners.cpp @@ -350,6 +350,42 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr if (mEditor) mEditor->Cut(); } + else if (PR_TRUE==altKey) + { + printf("alt X\n"); + aProcessed=PR_TRUE; + nsString output; + nsresult res = NS_ERROR_FAILURE; + nsCOMPtr htmlEditor (do_QueryInterface(mEditor)); + if (htmlEditor) + { + if (isShift) + res = htmlEditor->OutputTextToString(output); + else + res = htmlEditor->OutputHTMLToString(output); + } + else + { + nsCOMPtr textEditor (do_QueryInterface(mEditor)); + if (textEditor) + { + if (isShift) + res = textEditor->OutputTextToString(output); + else + res = textEditor->OutputHTMLToString(output); + } + } + + if (NS_SUCCEEDED(res)) + { + char* buf = output.ToNewCString(); + if (buf) + { + puts(buf); + delete[] buf; + } + } + } break; // XXX: hard-coded copy diff --git a/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp b/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp index 30d00e2a0df..d5941019361 100644 --- a/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp +++ b/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp @@ -350,6 +350,42 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr if (mEditor) mEditor->Cut(); } + else if (PR_TRUE==altKey) + { + printf("alt X\n"); + aProcessed=PR_TRUE; + nsString output; + nsresult res = NS_ERROR_FAILURE; + nsCOMPtr htmlEditor (do_QueryInterface(mEditor)); + if (htmlEditor) + { + if (isShift) + res = htmlEditor->OutputTextToString(output); + else + res = htmlEditor->OutputHTMLToString(output); + } + else + { + nsCOMPtr textEditor (do_QueryInterface(mEditor)); + if (textEditor) + { + if (isShift) + res = textEditor->OutputTextToString(output); + else + res = textEditor->OutputHTMLToString(output); + } + } + + if (NS_SUCCEEDED(res)) + { + char* buf = output.ToNewCString(); + if (buf) + { + puts(buf); + delete[] buf; + } + } + } break; // XXX: hard-coded copy