massive change to prepare for ender-lite. should be a no-op for current implementation

git-svn-id: svn://10.0.0.236/trunk@68218 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mjudge%netscape.com
2000-05-04 08:33:48 +00:00
parent f53c27afc4
commit 447ac72532
21 changed files with 189 additions and 149 deletions

View File

@@ -111,7 +111,7 @@ nsTextEditRules::Init(nsHTMLEditor *aEditor, PRUint32 aFlags)
// create a range that is the entire body contents
if (NS_FAILED(res)) return res;
nsCOMPtr<nsIDOMElement> bodyElement;
res = mEditor->GetBodyElement(getter_AddRefs(bodyElement));
res = mEditor->GetRootElement(getter_AddRefs(bodyElement));
if (NS_FAILED(res)) return res;
if (!bodyElement) return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsIDOMNode>bodyNode = do_QueryInterface(bodyElement);
@@ -120,7 +120,15 @@ nsTextEditRules::Init(nsHTMLEditor *aEditor, PRUint32 aFlags)
res = nsComponentManager::CreateInstance(kRangeCID, nsnull, NS_GET_IID(nsIDOMRange),
getter_AddRefs(wholeDoc));
if (NS_FAILED(res)) return res;
res = wholeDoc->SelectNode(bodyNode);
wholeDoc->SetStart(bodyNode,0);
nsCOMPtr<nsIDOMNodeList> list;
res = bodyNode->GetChildNodes(getter_AddRefs(list));
if (NS_FAILED(res) || !list) return res?res:NS_ERROR_FAILURE;
PRUint32 listCount;
res = list->GetLength(&listCount);
if (NS_FAILED(res)) return res;
res = wholeDoc->SetEnd(bodyNode,listCount);
if (NS_FAILED(res)) return res;
// replace newlines in that range with breaks
@@ -967,7 +975,7 @@ nsTextEditRules:: DidUndo(nsIDOMSelection *aSelection, nsresult aResult)
else
{
nsCOMPtr<nsIDOMElement> theBody;
res = mEditor->GetBodyElement(getter_AddRefs(theBody));
res = mEditor->GetRootElement(getter_AddRefs(theBody));
if (NS_FAILED(res)) return res;
if (!theBody) return NS_ERROR_FAILURE;
@@ -1016,7 +1024,7 @@ nsTextEditRules::DidRedo(nsIDOMSelection *aSelection, nsresult aResult)
else
{
nsCOMPtr<nsIDOMElement> theBody;
res = mEditor->GetBodyElement(getter_AddRefs(theBody));
res = mEditor->GetRootElement(getter_AddRefs(theBody));
if (NS_FAILED(res)) return res;
if (!theBody) return NS_ERROR_FAILURE;
@@ -1186,7 +1194,7 @@ nsTextEditRules::CreateBogusNodeIfNeeded(nsIDOMSelection *aSelection)
nsCOMPtr<nsIDOMElement> bodyElement;
nsresult res = mEditor->GetBodyElement(getter_AddRefs(bodyElement));
nsresult res = mEditor->GetRootElement(getter_AddRefs(bodyElement));
if (NS_FAILED(res)) return res;
if (!bodyElement) return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsIDOMNode>bodyNode = do_QueryInterface(bodyElement);