Add DocumentIsEmpty to EditorShell.idl and nsIEditor, and modify length and content getters to do the right thing with an empty document (which contains the bogus text node).

git-svn-id: svn://10.0.0.236/trunk@46444 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sfraser%netscape.com
1999-09-08 23:32:04 +00:00
parent 3ecbeb8efc
commit 8a797c14a4
16 changed files with 196 additions and 22 deletions

View File

@@ -2019,15 +2019,9 @@ nsEditorShell::GetEditorDocument(nsIDOMDocument** aEditorDocument)
NS_IMETHODIMP
nsEditorShell::GetEditorSelection(nsIDOMSelection** aEditorSelection)
{
if (mEditor)
{
nsCOMPtr<nsIEditor> editor = do_QueryInterface(mEditor);
if (editor)
{
nsCOMPtr<nsIEditor> editor = do_QueryInterface(mEditor);
if (editor)
return editor->GetSelection(aEditorSelection);
}
}
return NS_NOINTERFACE;
}
@@ -2043,6 +2037,27 @@ nsEditorShell::GetDocumentModified(PRBool *aDocumentModified)
}
NS_IMETHODIMP
nsEditorShell::GetDocumentIsEmpty(PRBool *aDocumentIsEmpty)
{
nsCOMPtr<nsIEditor> editor = do_QueryInterface(mEditor);
if (editor)
return editor->GetDocumentIsEmpty(aDocumentIsEmpty);
return NS_NOINTERFACE;
}
NS_IMETHODIMP
nsEditorShell::GetDocumentLength(PRInt32 *aDocumentLength)
{
nsCOMPtr<nsIHTMLEditor> editor = do_QueryInterface(mEditor);
if (editor)
return editor->GetDocumentLength(aDocumentLength);
return NS_NOINTERFACE;
}
NS_IMETHODIMP
nsEditorShell::InsertList(const PRUnichar *listType)
{