Add alt-X and alt-shift-x for debug output html and text

This commit is contained in:
akkana%netscape.com 1999-06-09 19:12:28 +00:00
Родитель 219d5cf489
Коммит f9aaca405d
2 изменённых файлов: 72 добавлений и 0 удалений

Просмотреть файл

@ -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<nsIHTMLEditor> htmlEditor (do_QueryInterface(mEditor));
if (htmlEditor)
{
if (isShift)
res = htmlEditor->OutputTextToString(output);
else
res = htmlEditor->OutputHTMLToString(output);
}
else
{
nsCOMPtr<nsITextEditor> 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

Просмотреть файл

@ -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<nsIHTMLEditor> htmlEditor (do_QueryInterface(mEditor));
if (htmlEditor)
{
if (isShift)
res = htmlEditor->OutputTextToString(output);
else
res = htmlEditor->OutputHTMLToString(output);
}
else
{
nsCOMPtr<nsITextEditor> 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