* Added StartLogging() and StopLogging() methods to nsIEditor,

nsIHTMLEditor, nsITextEditor, and nsIEditorShell and enabled
  the "Start Log" and "End Log" menu items in the editor test bed.

* Modified makefiles for Unix and Win32 to turn on  Editor API Logging.

* Added action argument to the DeleteSelection() method in nsIEditorShell.

* Modified nsJSTxnLog to use nsJSEditorLog when writing it's output.
This commit is contained in:
kin@netscape.com
1999-06-14 20:02:46 +00:00
parent ae991edbc0
commit e381bbffbb
26 changed files with 689 additions and 202 deletions
+81 -3
View File
@@ -1336,13 +1336,27 @@ nsEditorShell::SelectAll()
NS_IMETHODIMP
nsEditorShell::DeleteSelection()
nsEditorShell::DeleteSelection(PRInt32 action)
{
nsresult err = NS_NOINTERFACE;
nsIEditor::ECollapsedSelectionAction selectionAction;
switch(action)
{
case nsIEditor::eDeleteRight:
selectionAction = nsIEditor::eDeleteRight;
break;
case nsIEditor::eDeleteLeft:
selectionAction = nsIEditor::eDeleteLeft;
break;
default:
selectionAction = nsIEditor::eDoNothing;
break;
}
nsCOMPtr<nsIEditor> editor = do_QueryInterface(mEditor);
if (editor)
err = editor->DeleteSelection(nsIEditor::eDoNothing);
err = editor->DeleteSelection(selectionAction);
return err;
}
@@ -2230,6 +2244,70 @@ nsEditorShell::RunUnitTests()
return NS_OK;
}
NS_IMETHODIMP
nsEditorShell::StartLogging(nsIFileSpec *logFile)
{
nsresult err = NS_OK;
#if 1
switch (mEditorType)
{
case ePlainTextEditorType:
{
nsCOMPtr<nsITextEditor> textEditor = do_QueryInterface(mEditor);
if (textEditor)
err = textEditor->StartLogging(logFile);
}
break;
case eHTMLTextEditorType:
{
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor);
if (htmlEditor)
err = htmlEditor->StartLogging(logFile);
}
break;
default:
err = NS_ERROR_NOT_IMPLEMENTED;
}
#endif
return err;
}
NS_IMETHODIMP
nsEditorShell::StopLogging()
{
nsresult err = NS_OK;
#if 1
switch (mEditorType)
{
case ePlainTextEditorType:
{
nsCOMPtr<nsITextEditor> textEditor = do_QueryInterface(mEditor);
if (textEditor)
err = textEditor->StopLogging();
}
break;
case eHTMLTextEditorType:
{
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor);
if (htmlEditor)
err = htmlEditor->StopLogging();
}
break;
default:
err = NS_ERROR_NOT_IMPLEMENTED;
}
#endif
return err;
}
#ifdef XP_MAC
#pragma mark -
#endif