shuffled around the responsibilities of core editing objects.

The key listener is now mostly a mapper of key events to editor actions.  Soon, this should be 100% true.
The editor builds transactions that are themselves intelligent. The editor makes very few DOM calls itself.
It relies on the transactions to do most of the actual editing.


git-svn-id: svn://10.0.0.236/trunk@17518 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
buster%netscape.com
1999-01-11 22:47:23 +00:00
parent 19f97e42a1
commit 8a19fb26be
24 changed files with 470 additions and 472 deletions

View File

@@ -19,7 +19,6 @@
#include "SplitElementTxn.h"
#include "editor.h"
#include "nsIDOMNode.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMElement.h"
// note that aEditor is not refcounted
@@ -55,7 +54,7 @@ nsresult SplitElementTxn::Do(void)
// insert the new node
if ((NS_SUCCEEDED(result)) && (nsnull!=mParent))
{
result = EditTxn::SplitNode(mNode, mOffset, mNewNode, mParent);
result = mEditor->SplitNode(mNode, mOffset, mNewNode, mParent);
}
}
return result;
@@ -64,13 +63,13 @@ nsresult SplitElementTxn::Do(void)
nsresult SplitElementTxn::Undo(void)
{
// this assumes Do inserted the new node in front of the prior existing node
nsresult result = EditTxn::JoinNodes(mNode, mNewNode, mParent, PR_FALSE);
nsresult result = mEditor->JoinNodes(mNode, mNewNode, mParent, PR_FALSE);
return result;
}
nsresult SplitElementTxn::Redo(void)
{
nsresult result = EditTxn::SplitNode(mNode, mOffset, mNewNode, mParent);
nsresult result = mEditor->SplitNode(mNode, mOffset, mNewNode, mParent);
return result;
}