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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user